fosslight-scanner 2.1.14__tar.gz → 2.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fosslight_scanner-2.1.14/src/fosslight_scanner.egg-info → fosslight_scanner-2.1.16}/PKG-INFO +64 -46
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/README.md +62 -44
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/requirements.txt +2 -2
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/setup.py +1 -1
- fosslight_scanner-2.1.16/src/fosslight_scanner/_help.py +95 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/fosslight_scanner.py +39 -58
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16/src/fosslight_scanner.egg-info}/PKG-INFO +64 -46
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/requires.txt +2 -2
- fosslight_scanner-2.1.14/src/fosslight_scanner/_help.py +0 -58
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/LICENSE +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/MANIFEST.in +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/setup.cfg +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/__init__.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/_get_input.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/_parse_setting.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/_run_compare.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/cli.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/common.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/resources/bom_compare.html +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/SOURCES.txt +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/dependency_links.txt +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/entry_points.txt +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/top_level.txt +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test__get_input.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test__help.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test__parse_setting.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test__run_compare.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test_cli.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test_common.py +0 -0
- {fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/tests/test_fosslight_scanner.py +0 -0
{fosslight_scanner-2.1.14/src/fosslight_scanner.egg-info → fosslight_scanner-2.1.16}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_scanner
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.16
|
|
4
4
|
Summary: FOSSLight Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_scanner
|
|
@@ -20,9 +20,9 @@ Requires-Dist: openpyxl
|
|
|
20
20
|
Requires-Dist: progress
|
|
21
21
|
Requires-Dist: pyyaml
|
|
22
22
|
Requires-Dist: beautifulsoup4
|
|
23
|
-
Requires-Dist: fosslight_util<3.0.0,>=2.1.
|
|
23
|
+
Requires-Dist: fosslight_util<3.0.0,>=2.1.38
|
|
24
24
|
Requires-Dist: fosslight_source<3.0.0,>=2.2.3
|
|
25
|
-
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.
|
|
25
|
+
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.31
|
|
26
26
|
Requires-Dist: fosslight_binary<6.0.0,>=5.1.17
|
|
27
27
|
Requires-Dist: fosslight_prechecker<5.0.0,>=4.0.0
|
|
28
28
|
Dynamic: author
|
|
@@ -45,8 +45,7 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
45
45
|
# FOSSLight Scanner
|
|
46
46
|
<strong>Analyze at once for Open Source Compliance.</strong><br>
|
|
47
47
|
|
|
48
|
-
<img src="https://img.shields.io/pypi/l/fosslight_scanner" alt="FOSSLight Scanner
|
|
49
|
-
|
|
48
|
+
<img src="https://img.shields.io/pypi/l/fosslight_scanner" alt="FOSSLight Scanner license: Apache-2.0" /> <img src="https://img.shields.io/pypi/v/fosslight_scanner" alt="Current python package version" /> <img src="https://img.shields.io/pypi/pyversions/fosslight_scanner" /> [](https://api.reuse.software/info/github.com/fosslight/fosslight_scanner)
|
|
50
49
|
|
|
51
50
|
**FOSSLight Scanner** performs open source analysis after downloading the source by passing a link that can be cloned by wget or git. Instead, open source analysis can be performed for the local source path. The output result is generated in [FOSSLight Report][or] format.
|
|
52
51
|
|
|
@@ -72,44 +71,50 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
72
71
|
- [🚀 How to run](#-how-to-run)
|
|
73
72
|
- [Parameters](#parameters)
|
|
74
73
|
- [Ex 1. Local Source Analysis](#ex-1-local-source-analysis)
|
|
75
|
-
- [Ex 2.
|
|
74
|
+
- [Ex 2. Local Source Analysis with Path to Exclude](#ex-2-local-source-analysis-with-path-to-exclude)
|
|
75
|
+
- [Ex 3. Download Link and analyze](#ex-3-download-link-and-analyze)
|
|
76
|
+
- [Ex 4. Compare the BOM of two FOSSLight reports](#ex-4-compare-the-bom-of-two-fosslight-reports)
|
|
76
77
|
- [📁 Result](#-result)
|
|
77
78
|
- [🐳 How to run using Docker](#-how-to-run-using-docker)
|
|
78
79
|
- [👏 How to report issue](#-how-to-report-issue)
|
|
79
80
|
- [📄 License](#-license)
|
|
80
81
|
|
|
81
|
-
|
|
82
82
|
## 📋 Prerequisite
|
|
83
83
|
|
|
84
84
|
FOSSLight Scanner needs a Python 3.10+.
|
|
85
85
|
|
|
86
86
|
## 🎉 How to install
|
|
87
87
|
|
|
88
|
+
It can be installed using pip3. It is recommended to install it in a [virtualenv](https://fosslight.org/fosslight-guide-en/scanner/etc/guide_virtualenv.html) environment.
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
$ pip3 install fosslight_scanner
|
|
90
|
+
```bash
|
|
91
|
+
pip3 install fosslight_scanner
|
|
93
92
|
```
|
|
94
93
|
|
|
95
94
|
## 🚀 How to run
|
|
96
95
|
|
|
97
96
|
FOSSLight Scanner is run with the **fosslight** command.
|
|
98
|
-
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
99
|
fosslight [Mode] [option1] <arg1> [option2] <arg2>...
|
|
100
|
-
```
|
|
101
|
-
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Parameters
|
|
103
|
+
|
|
102
104
|
Mode
|
|
103
|
-
|
|
105
|
+
|
|
106
|
+
```text
|
|
104
107
|
all Run all scanners(Default)
|
|
105
108
|
source Run FOSSLight Source
|
|
106
109
|
dependency Run FOSSLight Dependency
|
|
107
110
|
binary Run FOSSLight Binary
|
|
108
111
|
prechecker Run FOSSLight Prechecker
|
|
109
112
|
compare Compare two FOSSLight reports
|
|
110
|
-
```
|
|
113
|
+
```
|
|
114
|
+
|
|
111
115
|
Options:
|
|
112
|
-
|
|
116
|
+
|
|
117
|
+
```text
|
|
113
118
|
-h Print help message
|
|
114
119
|
-p <path> Path to analyze (ex, -p {input_path})
|
|
115
120
|
* Compare mode input file: Two FOSSLight reports (supports excel, yaml)
|
|
@@ -119,7 +124,7 @@ Options:
|
|
|
119
124
|
* Compare mode result file: supports excel, json, yaml, html
|
|
120
125
|
-o <output> Output directory or file
|
|
121
126
|
-c <number> Number of processes to analyze source
|
|
122
|
-
-e <path> Path to exclude from analysis (files and directories, pattern matching is available
|
|
127
|
+
-e <path> Path to exclude from analysis (files and directories, pattern matching is available)
|
|
123
128
|
* IMPORTANT: Always wrap patterns in quotes("") to avoid shell expansion.
|
|
124
129
|
Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
125
130
|
-r Keep raw data
|
|
@@ -129,68 +134,81 @@ Options:
|
|
|
129
134
|
* Direct cli flags have higher priority than setting file
|
|
130
135
|
(ex, '-f yaml -s setting.json' - result file extension is .yaml)
|
|
131
136
|
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
137
|
+
|
|
138
|
+
- Refs.
|
|
139
|
+
- Additional arguments for running dependency analysis. See the [FOSSLight Dependency Guide][fd_guide] for instructions.
|
|
140
|
+
- In the case of DB URL, it is the [DB connection information to be used in FOSSLight Binary][flbindb].
|
|
141
|
+
- Pattern matching guide for the -e option
|
|
142
|
+
- ⚠️ Make sure to use double quotes ("") when entering values.
|
|
143
|
+
- Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
144
|
+
- ⚠️ File names and extensions are case-sensitive, so please enter them exactly as intended.
|
|
139
145
|
|
|
140
146
|
[flbindb]: https://fosslight.org/fosslight-guide-en/scanner/etc/binary_db.html
|
|
141
147
|
[fd_guide]: https://fosslight.org/fosslight-guide-en/scanner/2_dependency.html
|
|
142
148
|
|
|
143
149
|
### Ex 1. Local Source Analysis
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
fosslight all -p /home/source_path -d "-a 'source /test/Projects/venv/bin/activate' -d 'deactivate'"
|
|
144
153
|
```
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
|
|
155
|
+
If using additional flags like -d, document them in Options section or link to related guide.
|
|
147
156
|
|
|
148
157
|
### Ex 2. Local Source Analysis with Path to Exclude
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
fosslight all -p /home/source_path -e "temp_dir" "src/temp.py"
|
|
151
161
|
```
|
|
152
162
|
|
|
153
163
|
### Ex 3. Download Link and analyze
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
If you want to analyze private repository, set your github token like below.
|
|
158
|
-
```
|
|
159
|
-
$ fosslight all -w "https://my_github_token@github.com/Foo/private_repo
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
fosslight all -o test_result_wget -w "https://github.com/LGE-OSS/example.git"
|
|
160
167
|
```
|
|
161
168
|
|
|
162
|
-
|
|
169
|
+
If you want to analyze private repository, set your GitHub token like below.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
fosslight all -w "https://my_github_token@github.com/Foo/private_repo"
|
|
163
173
|
```
|
|
164
|
-
|
|
174
|
+
|
|
175
|
+
### Ex 4. Compare the BOM of two FOSSLight reports
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
fosslight compare -p FOSSLight_before_proj.yaml FOSSLight_after_proj.yaml -f excel
|
|
165
179
|
```
|
|
166
180
|
|
|
167
181
|
## 📁 Result
|
|
168
182
|
|
|
169
|
-
```
|
|
183
|
+
```text
|
|
170
184
|
$ tree
|
|
171
185
|
.
|
|
172
186
|
├── fosslight_log
|
|
173
|
-
│
|
|
187
|
+
│ ├── fosslight_log_20210924_022422.txt
|
|
174
188
|
└── FOSSLight-Report_20210924_022422.xlsx
|
|
175
189
|
```
|
|
176
190
|
|
|
177
|
-
- FOSSLight_Report-[datetime].xlsx
|
|
191
|
+
- FOSSLight_Report-[datetime].xlsx: OSS Report format file that outputs source code analysis, binary analysis, and dependency analysis results.
|
|
178
192
|
- fosslight_raw_data_[datetime] directory: Directory in which raw data files are created as a result of analysis
|
|
179
193
|
|
|
180
194
|
## 🐳 How to run using Docker
|
|
195
|
+
|
|
181
196
|
1. Build image using Dockerfile.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
docker build -t fosslight .
|
|
182
200
|
```
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
2. Run with the image you built.
|
|
201
|
+
|
|
202
|
+
2. Run with the image you built.
|
|
186
203
|
ex. Output: /Users/fosslight_source_scanner/test_output, Path to be analyzed: tests/test_files
|
|
187
|
-
|
|
188
|
-
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
docker run -it -v /Users/fosslight_source_scanner/test_output:/app/output fosslight -p tests/test_files -o output
|
|
189
207
|
```
|
|
190
208
|
|
|
191
209
|
## 👏 How to report issue
|
|
192
210
|
|
|
193
|
-
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].
|
|
211
|
+
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].
|
|
194
212
|
Then there will be quick bug fixes and upgrades. Ideas to improve are always welcome.
|
|
195
213
|
|
|
196
214
|
[cl]: https://github.com/fosslight/fosslight_scanner/issues
|
|
@@ -6,8 +6,7 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
6
6
|
# FOSSLight Scanner
|
|
7
7
|
<strong>Analyze at once for Open Source Compliance.</strong><br>
|
|
8
8
|
|
|
9
|
-
<img src="https://img.shields.io/pypi/l/fosslight_scanner" alt="FOSSLight Scanner
|
|
10
|
-
|
|
9
|
+
<img src="https://img.shields.io/pypi/l/fosslight_scanner" alt="FOSSLight Scanner license: Apache-2.0" /> <img src="https://img.shields.io/pypi/v/fosslight_scanner" alt="Current python package version" /> <img src="https://img.shields.io/pypi/pyversions/fosslight_scanner" /> [](https://api.reuse.software/info/github.com/fosslight/fosslight_scanner)
|
|
11
10
|
|
|
12
11
|
**FOSSLight Scanner** performs open source analysis after downloading the source by passing a link that can be cloned by wget or git. Instead, open source analysis can be performed for the local source path. The output result is generated in [FOSSLight Report][or] format.
|
|
13
12
|
|
|
@@ -33,44 +32,50 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
33
32
|
- [🚀 How to run](#-how-to-run)
|
|
34
33
|
- [Parameters](#parameters)
|
|
35
34
|
- [Ex 1. Local Source Analysis](#ex-1-local-source-analysis)
|
|
36
|
-
- [Ex 2.
|
|
35
|
+
- [Ex 2. Local Source Analysis with Path to Exclude](#ex-2-local-source-analysis-with-path-to-exclude)
|
|
36
|
+
- [Ex 3. Download Link and analyze](#ex-3-download-link-and-analyze)
|
|
37
|
+
- [Ex 4. Compare the BOM of two FOSSLight reports](#ex-4-compare-the-bom-of-two-fosslight-reports)
|
|
37
38
|
- [📁 Result](#-result)
|
|
38
39
|
- [🐳 How to run using Docker](#-how-to-run-using-docker)
|
|
39
40
|
- [👏 How to report issue](#-how-to-report-issue)
|
|
40
41
|
- [📄 License](#-license)
|
|
41
42
|
|
|
42
|
-
|
|
43
43
|
## 📋 Prerequisite
|
|
44
44
|
|
|
45
45
|
FOSSLight Scanner needs a Python 3.10+.
|
|
46
46
|
|
|
47
47
|
## 🎉 How to install
|
|
48
48
|
|
|
49
|
+
It can be installed using pip3. It is recommended to install it in a [virtualenv](https://fosslight.org/fosslight-guide-en/scanner/etc/guide_virtualenv.html) environment.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
$ pip3 install fosslight_scanner
|
|
51
|
+
```bash
|
|
52
|
+
pip3 install fosslight_scanner
|
|
54
53
|
```
|
|
55
54
|
|
|
56
55
|
## 🚀 How to run
|
|
57
56
|
|
|
58
57
|
FOSSLight Scanner is run with the **fosslight** command.
|
|
59
|
-
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
60
|
fosslight [Mode] [option1] <arg1> [option2] <arg2>...
|
|
61
|
-
```
|
|
62
|
-
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
63
65
|
Mode
|
|
64
|
-
|
|
66
|
+
|
|
67
|
+
```text
|
|
65
68
|
all Run all scanners(Default)
|
|
66
69
|
source Run FOSSLight Source
|
|
67
70
|
dependency Run FOSSLight Dependency
|
|
68
71
|
binary Run FOSSLight Binary
|
|
69
72
|
prechecker Run FOSSLight Prechecker
|
|
70
73
|
compare Compare two FOSSLight reports
|
|
71
|
-
```
|
|
74
|
+
```
|
|
75
|
+
|
|
72
76
|
Options:
|
|
73
|
-
|
|
77
|
+
|
|
78
|
+
```text
|
|
74
79
|
-h Print help message
|
|
75
80
|
-p <path> Path to analyze (ex, -p {input_path})
|
|
76
81
|
* Compare mode input file: Two FOSSLight reports (supports excel, yaml)
|
|
@@ -80,7 +85,7 @@ Options:
|
|
|
80
85
|
* Compare mode result file: supports excel, json, yaml, html
|
|
81
86
|
-o <output> Output directory or file
|
|
82
87
|
-c <number> Number of processes to analyze source
|
|
83
|
-
-e <path> Path to exclude from analysis (files and directories, pattern matching is available
|
|
88
|
+
-e <path> Path to exclude from analysis (files and directories, pattern matching is available)
|
|
84
89
|
* IMPORTANT: Always wrap patterns in quotes("") to avoid shell expansion.
|
|
85
90
|
Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
86
91
|
-r Keep raw data
|
|
@@ -90,68 +95,81 @@ Options:
|
|
|
90
95
|
* Direct cli flags have higher priority than setting file
|
|
91
96
|
(ex, '-f yaml -s setting.json' - result file extension is .yaml)
|
|
92
97
|
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
98
|
+
|
|
99
|
+
- Refs.
|
|
100
|
+
- Additional arguments for running dependency analysis. See the [FOSSLight Dependency Guide][fd_guide] for instructions.
|
|
101
|
+
- In the case of DB URL, it is the [DB connection information to be used in FOSSLight Binary][flbindb].
|
|
102
|
+
- Pattern matching guide for the -e option
|
|
103
|
+
- ⚠️ Make sure to use double quotes ("") when entering values.
|
|
104
|
+
- Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
105
|
+
- ⚠️ File names and extensions are case-sensitive, so please enter them exactly as intended.
|
|
100
106
|
|
|
101
107
|
[flbindb]: https://fosslight.org/fosslight-guide-en/scanner/etc/binary_db.html
|
|
102
108
|
[fd_guide]: https://fosslight.org/fosslight-guide-en/scanner/2_dependency.html
|
|
103
109
|
|
|
104
110
|
### Ex 1. Local Source Analysis
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
fosslight all -p /home/source_path -d "-a 'source /test/Projects/venv/bin/activate' -d 'deactivate'"
|
|
105
114
|
```
|
|
106
|
-
|
|
107
|
-
|
|
115
|
+
|
|
116
|
+
If using additional flags like -d, document them in Options section or link to related guide.
|
|
108
117
|
|
|
109
118
|
### Ex 2. Local Source Analysis with Path to Exclude
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
fosslight all -p /home/source_path -e "temp_dir" "src/temp.py"
|
|
112
122
|
```
|
|
113
123
|
|
|
114
124
|
### Ex 3. Download Link and analyze
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
If you want to analyze private repository, set your github token like below.
|
|
119
|
-
```
|
|
120
|
-
$ fosslight all -w "https://my_github_token@github.com/Foo/private_repo
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
fosslight all -o test_result_wget -w "https://github.com/LGE-OSS/example.git"
|
|
121
128
|
```
|
|
122
129
|
|
|
123
|
-
|
|
130
|
+
If you want to analyze private repository, set your GitHub token like below.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
fosslight all -w "https://my_github_token@github.com/Foo/private_repo"
|
|
124
134
|
```
|
|
125
|
-
|
|
135
|
+
|
|
136
|
+
### Ex 4. Compare the BOM of two FOSSLight reports
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
fosslight compare -p FOSSLight_before_proj.yaml FOSSLight_after_proj.yaml -f excel
|
|
126
140
|
```
|
|
127
141
|
|
|
128
142
|
## 📁 Result
|
|
129
143
|
|
|
130
|
-
```
|
|
144
|
+
```text
|
|
131
145
|
$ tree
|
|
132
146
|
.
|
|
133
147
|
├── fosslight_log
|
|
134
|
-
│
|
|
148
|
+
│ ├── fosslight_log_20210924_022422.txt
|
|
135
149
|
└── FOSSLight-Report_20210924_022422.xlsx
|
|
136
150
|
```
|
|
137
151
|
|
|
138
|
-
- FOSSLight_Report-[datetime].xlsx
|
|
152
|
+
- FOSSLight_Report-[datetime].xlsx: OSS Report format file that outputs source code analysis, binary analysis, and dependency analysis results.
|
|
139
153
|
- fosslight_raw_data_[datetime] directory: Directory in which raw data files are created as a result of analysis
|
|
140
154
|
|
|
141
155
|
## 🐳 How to run using Docker
|
|
156
|
+
|
|
142
157
|
1. Build image using Dockerfile.
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
docker build -t fosslight .
|
|
143
161
|
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
2. Run with the image you built.
|
|
162
|
+
|
|
163
|
+
2. Run with the image you built.
|
|
147
164
|
ex. Output: /Users/fosslight_source_scanner/test_output, Path to be analyzed: tests/test_files
|
|
148
|
-
|
|
149
|
-
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
docker run -it -v /Users/fosslight_source_scanner/test_output:/app/output fosslight -p tests/test_files -o output
|
|
150
168
|
```
|
|
151
169
|
|
|
152
170
|
## 👏 How to report issue
|
|
153
171
|
|
|
154
|
-
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].
|
|
172
|
+
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].
|
|
155
173
|
Then there will be quick bug fixes and upgrades. Ideas to improve are always welcome.
|
|
156
174
|
|
|
157
175
|
[cl]: https://github.com/fosslight/fosslight_scanner/issues
|
|
@@ -160,4 +178,4 @@ Then there will be quick bug fixes and upgrades. Ideas to improve are always wel
|
|
|
160
178
|
|
|
161
179
|
FOSSLight Scanner is released under [Apache-2.0][l].
|
|
162
180
|
|
|
163
|
-
[l]: https://github.com/fosslight/fosslight_scanner/blob/main/LICENSE
|
|
181
|
+
[l]: https://github.com/fosslight/fosslight_scanner/blob/main/LICENSE
|
|
@@ -4,8 +4,8 @@ openpyxl
|
|
|
4
4
|
progress
|
|
5
5
|
pyyaml
|
|
6
6
|
beautifulsoup4
|
|
7
|
-
fosslight_util>=2.1.
|
|
7
|
+
fosslight_util>=2.1.38,<3.0.0
|
|
8
8
|
fosslight_source>=2.2.3,<3.0.0
|
|
9
|
-
fosslight_dependency>=4.1.
|
|
9
|
+
fosslight_dependency>=4.1.31,<5.0.0
|
|
10
10
|
fosslight_binary>=5.1.17,<6.0.0
|
|
11
11
|
fosslight_prechecker>=4.0.0,<5.0.0
|
|
@@ -15,7 +15,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
|
|
|
15
15
|
if __name__ == "__main__":
|
|
16
16
|
setup(
|
|
17
17
|
name='fosslight_scanner',
|
|
18
|
-
version='2.1.
|
|
18
|
+
version='2.1.16',
|
|
19
19
|
package_dir={"": "src"},
|
|
20
20
|
packages=find_packages(where='src'),
|
|
21
21
|
description='FOSSLight Scanner',
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Copyright (c) 2021 LG Electronics Inc.
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
from fosslight_util.help import PrintHelpMsg
|
|
6
|
+
from fosslight_util.output_format import SUPPORT_FORMAT
|
|
7
|
+
|
|
8
|
+
_HELP_MESSAGE_SCANNER = f"""
|
|
9
|
+
📖 Usage
|
|
10
|
+
────────────────────────────────────────────────────────────────────
|
|
11
|
+
fosslight [mode] [options] <arguments>
|
|
12
|
+
|
|
13
|
+
📝 Description
|
|
14
|
+
────────────────────────────────────────────────────────────────────
|
|
15
|
+
FOSSLight Scanner performs comprehensive open source analysis by running
|
|
16
|
+
multiple modes (Source, Dependency, Binary) together. It can download
|
|
17
|
+
source code from URLs (git/wget) or analyze local paths, and generates
|
|
18
|
+
results in OSS Report format.
|
|
19
|
+
|
|
20
|
+
📚 Guide: https://fosslight.org/fosslight-guide/scanner/
|
|
21
|
+
|
|
22
|
+
🔧 Modes
|
|
23
|
+
────────────────────────────────────────────────────────────────────
|
|
24
|
+
all (default) Run all modes (Source, Dependency, Binary)
|
|
25
|
+
source Run FOSSLight Source analysis only
|
|
26
|
+
dependency Run FOSSLight Dependency analysis only
|
|
27
|
+
binary Run FOSSLight Binary analysis only
|
|
28
|
+
compare Compare two FOSSLight reports
|
|
29
|
+
|
|
30
|
+
Note: Multiple modes can be specified separated by comma
|
|
31
|
+
Example: fosslight source,binary -p /path/to/analyze
|
|
32
|
+
|
|
33
|
+
⚙️ General Options
|
|
34
|
+
────────────────────────────────────────────────────────────────────
|
|
35
|
+
-p <path> Path to analyze
|
|
36
|
+
• Compare mode: path to two FOSSLight reports (excel/yaml)
|
|
37
|
+
-w <url> URL to download and analyze (git clone or wget)
|
|
38
|
+
-f <format> Output format ({', '.join(SUPPORT_FORMAT)})
|
|
39
|
+
• Compare mode: excel, json, yaml, html
|
|
40
|
+
• Multiple formats: ex) -f excel yaml json (separated by space)
|
|
41
|
+
-e <pattern> Exclude paths from analysis (files and directories)
|
|
42
|
+
⚠️ IMPORTANT: Always wrap in quotes to avoid shell expansion
|
|
43
|
+
Example: fosslight -e "test/" "*.jar"
|
|
44
|
+
-o <path> Output directory or file name
|
|
45
|
+
-c <number> Number of processes for source analysis
|
|
46
|
+
-r Keep raw data from scanners
|
|
47
|
+
-t Hide progress bar
|
|
48
|
+
-h Show this help message
|
|
49
|
+
-v Show version information
|
|
50
|
+
-s <path> Apply settings from JSON file(check format with 'setting.json' in this repository)
|
|
51
|
+
Note: CLI flags override settings file
|
|
52
|
+
Example: -f yaml -s setting.json → output is .yaml
|
|
53
|
+
--no_correction Skip OSS information correction with sbom-info.yaml
|
|
54
|
+
(Correction only supports excel format)
|
|
55
|
+
--correct_fpath <path> Path to sbom-info.yaml file for correction
|
|
56
|
+
--ui Generate UI mode result file
|
|
57
|
+
--recursive_dep Recursively analyze dependencies
|
|
58
|
+
|
|
59
|
+
🔍 Mode-Specific Options
|
|
60
|
+
────────────────────────────────────────────────────────────────────
|
|
61
|
+
For 'all' or 'binary' mode:
|
|
62
|
+
-u <db_url> Database connection string
|
|
63
|
+
Format: postgresql://username:password@host:port/database
|
|
64
|
+
|
|
65
|
+
For 'all' or 'dependency' mode:
|
|
66
|
+
-d <args> Additional arguments for dependency analysis
|
|
67
|
+
|
|
68
|
+
💡 Examples
|
|
69
|
+
────────────────────────────────────────────────────────────────────
|
|
70
|
+
# Scan current directory with all scanners
|
|
71
|
+
fosslight
|
|
72
|
+
|
|
73
|
+
# Scan specific path with exclusions
|
|
74
|
+
fosslight -p /path/to/source -e "test/" "node_modules/" "*.pyc"
|
|
75
|
+
|
|
76
|
+
# Generate output in specific format
|
|
77
|
+
fosslight -p /path/to/source -f yaml
|
|
78
|
+
|
|
79
|
+
# Run specific modes only
|
|
80
|
+
fosslight source,dependency -p /path/to/source
|
|
81
|
+
|
|
82
|
+
# Download and analyze from git repository
|
|
83
|
+
fosslight -w https://github.com/user/repo.git -o result_dir
|
|
84
|
+
|
|
85
|
+
# Compare two FOSSLight reports
|
|
86
|
+
fosslight compare -p report_v1.xlsx report_v2.xlsx -f excel
|
|
87
|
+
|
|
88
|
+
# Run with database connection for binary analysis
|
|
89
|
+
fosslight binary -p /path/to/binary -u "postgresql://user:pass@localhost:5432/sample"
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def print_help_msg():
|
|
94
|
+
helpMsg = PrintHelpMsg(_HELP_MESSAGE_SCANNER)
|
|
95
|
+
helpMsg.print_help_msg(True)
|
{fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/fosslight_scanner.py
RENAMED
|
@@ -47,7 +47,7 @@ COMPARE_OUTPUT_REPORT_PREFIX = "fosslight_compare_"
|
|
|
47
47
|
PKG_NAME = "fosslight_scanner"
|
|
48
48
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
|
49
49
|
warnings.simplefilter(action='ignore', category=FutureWarning)
|
|
50
|
-
_output_dir = "
|
|
50
|
+
_output_dir = "fosslight_raw_data"
|
|
51
51
|
_log_file = "fosslight_log_all_"
|
|
52
52
|
_start_time = ""
|
|
53
53
|
_executed_path = ""
|
|
@@ -137,7 +137,9 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
137
137
|
correct_mode=True, correct_fpath="", ui_mode=False, path_to_exclude=[],
|
|
138
138
|
selected_source_scanner="all", source_write_json_file=False, source_print_matched_text=False,
|
|
139
139
|
source_time_out=120, binary_simple=False, formats=[], recursive_dep=False):
|
|
140
|
+
|
|
140
141
|
final_excel_dir = output_path
|
|
142
|
+
final_reports = []
|
|
141
143
|
success = True
|
|
142
144
|
all_cover_items = []
|
|
143
145
|
all_scan_item = ScannerItem(PKG_NAME, _start_time)
|
|
@@ -145,6 +147,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
145
147
|
if not remove_src_data:
|
|
146
148
|
success, final_excel_dir, result_log = init(output_path)
|
|
147
149
|
|
|
150
|
+
|
|
148
151
|
if not output_files:
|
|
149
152
|
# If -o does not contains file name, set default name
|
|
150
153
|
while len(output_files) < len(output_extensions):
|
|
@@ -267,10 +270,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
267
270
|
input_path=abs_path,
|
|
268
271
|
exclude_path=excluded_path_without_dot,
|
|
269
272
|
simple_mode=False)
|
|
270
|
-
|
|
271
|
-
for ci in all_cover_items:
|
|
272
|
-
merge_comment.append(str(f'[{ci.tool_name}] {ci.comment}'))
|
|
273
|
-
cover.comment = '\n'.join(merge_comment)
|
|
273
|
+
cover.comment = cover.create_merged_comment(all_cover_items)
|
|
274
274
|
all_scan_item.cover = cover
|
|
275
275
|
|
|
276
276
|
if correct_mode:
|
|
@@ -287,16 +287,8 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
287
287
|
for success, msg, result_file in results:
|
|
288
288
|
if success:
|
|
289
289
|
final_reports.append(result_file)
|
|
290
|
-
logger.info(f"Output file: {result_file}")
|
|
291
290
|
else:
|
|
292
291
|
logger.error(f"Fail to generate result file {result_file}. msg:({msg})")
|
|
293
|
-
|
|
294
|
-
if success:
|
|
295
|
-
if final_reports:
|
|
296
|
-
logger.info(f'Generated the result file: {", ".join(final_reports)}')
|
|
297
|
-
result_log["Output File"] = ', '.join(final_reports)
|
|
298
|
-
else:
|
|
299
|
-
result_log["Output File"] = 'Nothing is detected from the scanner so output file is not generated.'
|
|
300
292
|
|
|
301
293
|
if ui_mode:
|
|
302
294
|
if output_files:
|
|
@@ -307,7 +299,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
307
299
|
ui_mode_report = f"{output_file_without_ext}.json"
|
|
308
300
|
success, err_msg = create_scancodejson(all_scan_item, ui_mode_report, src_path)
|
|
309
301
|
if success and os.path.isfile(ui_mode_report):
|
|
310
|
-
|
|
302
|
+
final_reports.append(ui_mode_report)
|
|
311
303
|
else:
|
|
312
304
|
logger.error(f'Fail to generate a ui mode result file({ui_mode_report}): {err_msg}')
|
|
313
305
|
|
|
@@ -322,6 +314,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
322
314
|
shutil.rmtree(src_path)
|
|
323
315
|
except Exception as ex:
|
|
324
316
|
logger.debug(f"Error to remove temp files:{ex}")
|
|
317
|
+
return final_reports
|
|
325
318
|
|
|
326
319
|
|
|
327
320
|
def download_source(link, out_dir):
|
|
@@ -351,38 +344,6 @@ def download_source(link, out_dir):
|
|
|
351
344
|
return success, temp_src_dir, oss_name, oss_version
|
|
352
345
|
|
|
353
346
|
|
|
354
|
-
def rename_and_remove_hidden_folder(output_path, output_dir, keep_raw_data=False):
|
|
355
|
-
try:
|
|
356
|
-
hidden_log_dir = os.path.join(output_path, ".fosslight_log")
|
|
357
|
-
visible_log_dir = os.path.join(output_path, "fosslight_log")
|
|
358
|
-
if os.path.exists(hidden_log_dir):
|
|
359
|
-
try:
|
|
360
|
-
if os.path.exists(visible_log_dir):
|
|
361
|
-
shutil.rmtree(visible_log_dir)
|
|
362
|
-
shutil.move(hidden_log_dir, visible_log_dir)
|
|
363
|
-
except Exception as ex:
|
|
364
|
-
logger.debug(f"Error renaming log folder: {ex}")
|
|
365
|
-
|
|
366
|
-
if keep_raw_data:
|
|
367
|
-
visible_raw_dir = os.path.join(os.path.dirname(output_dir), "fosslight_raw_data")
|
|
368
|
-
if os.path.exists(output_dir):
|
|
369
|
-
if os.path.exists(visible_raw_dir):
|
|
370
|
-
shutil.rmtree(visible_raw_dir)
|
|
371
|
-
shutil.move(output_dir, visible_raw_dir)
|
|
372
|
-
logger.debug(f"Renamed {output_dir} to {visible_raw_dir}")
|
|
373
|
-
else:
|
|
374
|
-
logger.debug(f"Remove temporary files: {output_dir}")
|
|
375
|
-
if os.path.exists(output_dir):
|
|
376
|
-
shutil.rmtree(output_dir)
|
|
377
|
-
|
|
378
|
-
visible_raw_dir = os.path.join(os.path.dirname(output_dir), "fosslight_raw_data")
|
|
379
|
-
if os.path.exists(visible_raw_dir):
|
|
380
|
-
shutil.rmtree(visible_raw_dir)
|
|
381
|
-
logger.debug(f"Removed previous raw data folder: {visible_raw_dir}")
|
|
382
|
-
except Exception as ex:
|
|
383
|
-
logger.debug(f"Error cleaning up output directories: {ex}")
|
|
384
|
-
|
|
385
|
-
|
|
386
347
|
def init(output_path="", make_outdir=True):
|
|
387
348
|
global _output_dir, _log_file, _start_time, logger
|
|
388
349
|
|
|
@@ -400,7 +361,7 @@ def init(output_path="", make_outdir=True):
|
|
|
400
361
|
Path(_output_dir).mkdir(parents=True, exist_ok=True)
|
|
401
362
|
_output_dir = os.path.abspath(_output_dir)
|
|
402
363
|
|
|
403
|
-
log_dir = os.path.join(output_root_dir, "
|
|
364
|
+
log_dir = os.path.join(output_root_dir, "fosslight_log")
|
|
404
365
|
logger, result_log = init_log(os.path.join(log_dir, f"{_log_file}{_start_time}.txt"),
|
|
405
366
|
True, logging.INFO, logging.DEBUG, PKG_NAME)
|
|
406
367
|
|
|
@@ -463,6 +424,9 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
|
|
|
463
424
|
else:
|
|
464
425
|
output_path = os.path.abspath(output_path)
|
|
465
426
|
|
|
427
|
+
final_dir = output_path
|
|
428
|
+
output_path = os.path.join(os.path.dirname(output_path), f".fosslight_temp_{datetime.now().strftime('%Y%m%d_%H%M%S')}")
|
|
429
|
+
final_reports = []
|
|
466
430
|
if not success:
|
|
467
431
|
logger.error(msg)
|
|
468
432
|
sys.exit(1)
|
|
@@ -515,22 +479,39 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
|
|
|
515
479
|
success, src_path, default_oss_name, default_oss_version = download_source(url_to_analyze, output_path)
|
|
516
480
|
|
|
517
481
|
if src_path != "":
|
|
518
|
-
run_scanner(src_path, dep_arguments, output_path, keep_raw_data,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
482
|
+
final_reports = run_scanner(src_path, dep_arguments, output_path, keep_raw_data,
|
|
483
|
+
run_src, run_bin, run_dep, run_prechecker,
|
|
484
|
+
remove_downloaded_source, {}, output_files,
|
|
485
|
+
output_extensions, num_cores, db_url,
|
|
486
|
+
default_oss_name, default_oss_version, url_to_analyze,
|
|
487
|
+
correct_mode, correct_fpath, ui_mode, path_to_exclude,
|
|
488
|
+
selected_source_scanner, source_write_json_file, source_print_matched_text, source_time_out,
|
|
489
|
+
binary_simple, formats, recursive_dep)
|
|
526
490
|
|
|
527
491
|
if extract_folder:
|
|
528
492
|
shutil.rmtree(extract_folder)
|
|
529
493
|
else:
|
|
530
494
|
logger.error("(mode) No mode has been selected for analysis.")
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
495
|
+
try:
|
|
496
|
+
if not keep_raw_data:
|
|
497
|
+
logger.debug(f"Remove temporary files: {_output_dir}")
|
|
498
|
+
shutil.rmtree(_output_dir)
|
|
499
|
+
if os.path.exists(output_path):
|
|
500
|
+
os.makedirs(final_dir, exist_ok=True)
|
|
501
|
+
for item in os.listdir(output_path):
|
|
502
|
+
src_item = os.path.join(output_path, item)
|
|
503
|
+
dst_item = os.path.join(final_dir, item)
|
|
504
|
+
if os.path.isdir(src_item) and os.path.exists(dst_item):
|
|
505
|
+
for sub_item in os.listdir(src_item):
|
|
506
|
+
shutil.move(os.path.join(src_item, sub_item), os.path.join(dst_item, sub_item))
|
|
507
|
+
else:
|
|
508
|
+
shutil.move(src_item, dst_item)
|
|
509
|
+
shutil.rmtree(output_path)
|
|
510
|
+
if final_reports:
|
|
511
|
+
final_reports = [report.replace(output_path, final_dir) for report in final_reports]
|
|
512
|
+
logger.info(f'Output File: {", ".join(final_reports)}')
|
|
513
|
+
except Exception as ex:
|
|
514
|
+
logger.debug(f"Error to remove temp files:{ex}")
|
|
534
515
|
except Exception as ex:
|
|
535
516
|
logger.warning(str(ex))
|
|
536
517
|
return False
|
{fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16/src/fosslight_scanner.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_scanner
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.16
|
|
4
4
|
Summary: FOSSLight Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_scanner
|
|
@@ -20,9 +20,9 @@ Requires-Dist: openpyxl
|
|
|
20
20
|
Requires-Dist: progress
|
|
21
21
|
Requires-Dist: pyyaml
|
|
22
22
|
Requires-Dist: beautifulsoup4
|
|
23
|
-
Requires-Dist: fosslight_util<3.0.0,>=2.1.
|
|
23
|
+
Requires-Dist: fosslight_util<3.0.0,>=2.1.38
|
|
24
24
|
Requires-Dist: fosslight_source<3.0.0,>=2.2.3
|
|
25
|
-
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.
|
|
25
|
+
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.31
|
|
26
26
|
Requires-Dist: fosslight_binary<6.0.0,>=5.1.17
|
|
27
27
|
Requires-Dist: fosslight_prechecker<5.0.0,>=4.0.0
|
|
28
28
|
Dynamic: author
|
|
@@ -45,8 +45,7 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
45
45
|
# FOSSLight Scanner
|
|
46
46
|
<strong>Analyze at once for Open Source Compliance.</strong><br>
|
|
47
47
|
|
|
48
|
-
<img src="https://img.shields.io/pypi/l/fosslight_scanner" alt="FOSSLight Scanner
|
|
49
|
-
|
|
48
|
+
<img src="https://img.shields.io/pypi/l/fosslight_scanner" alt="FOSSLight Scanner license: Apache-2.0" /> <img src="https://img.shields.io/pypi/v/fosslight_scanner" alt="Current python package version" /> <img src="https://img.shields.io/pypi/pyversions/fosslight_scanner" /> [](https://api.reuse.software/info/github.com/fosslight/fosslight_scanner)
|
|
50
49
|
|
|
51
50
|
**FOSSLight Scanner** performs open source analysis after downloading the source by passing a link that can be cloned by wget or git. Instead, open source analysis can be performed for the local source path. The output result is generated in [FOSSLight Report][or] format.
|
|
52
51
|
|
|
@@ -72,44 +71,50 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
72
71
|
- [🚀 How to run](#-how-to-run)
|
|
73
72
|
- [Parameters](#parameters)
|
|
74
73
|
- [Ex 1. Local Source Analysis](#ex-1-local-source-analysis)
|
|
75
|
-
- [Ex 2.
|
|
74
|
+
- [Ex 2. Local Source Analysis with Path to Exclude](#ex-2-local-source-analysis-with-path-to-exclude)
|
|
75
|
+
- [Ex 3. Download Link and analyze](#ex-3-download-link-and-analyze)
|
|
76
|
+
- [Ex 4. Compare the BOM of two FOSSLight reports](#ex-4-compare-the-bom-of-two-fosslight-reports)
|
|
76
77
|
- [📁 Result](#-result)
|
|
77
78
|
- [🐳 How to run using Docker](#-how-to-run-using-docker)
|
|
78
79
|
- [👏 How to report issue](#-how-to-report-issue)
|
|
79
80
|
- [📄 License](#-license)
|
|
80
81
|
|
|
81
|
-
|
|
82
82
|
## 📋 Prerequisite
|
|
83
83
|
|
|
84
84
|
FOSSLight Scanner needs a Python 3.10+.
|
|
85
85
|
|
|
86
86
|
## 🎉 How to install
|
|
87
87
|
|
|
88
|
+
It can be installed using pip3. It is recommended to install it in a [virtualenv](https://fosslight.org/fosslight-guide-en/scanner/etc/guide_virtualenv.html) environment.
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
$ pip3 install fosslight_scanner
|
|
90
|
+
```bash
|
|
91
|
+
pip3 install fosslight_scanner
|
|
93
92
|
```
|
|
94
93
|
|
|
95
94
|
## 🚀 How to run
|
|
96
95
|
|
|
97
96
|
FOSSLight Scanner is run with the **fosslight** command.
|
|
98
|
-
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
99
|
fosslight [Mode] [option1] <arg1> [option2] <arg2>...
|
|
100
|
-
```
|
|
101
|
-
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Parameters
|
|
103
|
+
|
|
102
104
|
Mode
|
|
103
|
-
|
|
105
|
+
|
|
106
|
+
```text
|
|
104
107
|
all Run all scanners(Default)
|
|
105
108
|
source Run FOSSLight Source
|
|
106
109
|
dependency Run FOSSLight Dependency
|
|
107
110
|
binary Run FOSSLight Binary
|
|
108
111
|
prechecker Run FOSSLight Prechecker
|
|
109
112
|
compare Compare two FOSSLight reports
|
|
110
|
-
```
|
|
113
|
+
```
|
|
114
|
+
|
|
111
115
|
Options:
|
|
112
|
-
|
|
116
|
+
|
|
117
|
+
```text
|
|
113
118
|
-h Print help message
|
|
114
119
|
-p <path> Path to analyze (ex, -p {input_path})
|
|
115
120
|
* Compare mode input file: Two FOSSLight reports (supports excel, yaml)
|
|
@@ -119,7 +124,7 @@ Options:
|
|
|
119
124
|
* Compare mode result file: supports excel, json, yaml, html
|
|
120
125
|
-o <output> Output directory or file
|
|
121
126
|
-c <number> Number of processes to analyze source
|
|
122
|
-
-e <path> Path to exclude from analysis (files and directories, pattern matching is available
|
|
127
|
+
-e <path> Path to exclude from analysis (files and directories, pattern matching is available)
|
|
123
128
|
* IMPORTANT: Always wrap patterns in quotes("") to avoid shell expansion.
|
|
124
129
|
Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
125
130
|
-r Keep raw data
|
|
@@ -129,68 +134,81 @@ Options:
|
|
|
129
134
|
* Direct cli flags have higher priority than setting file
|
|
130
135
|
(ex, '-f yaml -s setting.json' - result file extension is .yaml)
|
|
131
136
|
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
137
|
+
|
|
138
|
+
- Refs.
|
|
139
|
+
- Additional arguments for running dependency analysis. See the [FOSSLight Dependency Guide][fd_guide] for instructions.
|
|
140
|
+
- In the case of DB URL, it is the [DB connection information to be used in FOSSLight Binary][flbindb].
|
|
141
|
+
- Pattern matching guide for the -e option
|
|
142
|
+
- ⚠️ Make sure to use double quotes ("") when entering values.
|
|
143
|
+
- Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
144
|
+
- ⚠️ File names and extensions are case-sensitive, so please enter them exactly as intended.
|
|
139
145
|
|
|
140
146
|
[flbindb]: https://fosslight.org/fosslight-guide-en/scanner/etc/binary_db.html
|
|
141
147
|
[fd_guide]: https://fosslight.org/fosslight-guide-en/scanner/2_dependency.html
|
|
142
148
|
|
|
143
149
|
### Ex 1. Local Source Analysis
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
fosslight all -p /home/source_path -d "-a 'source /test/Projects/venv/bin/activate' -d 'deactivate'"
|
|
144
153
|
```
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
|
|
155
|
+
If using additional flags like -d, document them in Options section or link to related guide.
|
|
147
156
|
|
|
148
157
|
### Ex 2. Local Source Analysis with Path to Exclude
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
fosslight all -p /home/source_path -e "temp_dir" "src/temp.py"
|
|
151
161
|
```
|
|
152
162
|
|
|
153
163
|
### Ex 3. Download Link and analyze
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
If you want to analyze private repository, set your github token like below.
|
|
158
|
-
```
|
|
159
|
-
$ fosslight all -w "https://my_github_token@github.com/Foo/private_repo
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
fosslight all -o test_result_wget -w "https://github.com/LGE-OSS/example.git"
|
|
160
167
|
```
|
|
161
168
|
|
|
162
|
-
|
|
169
|
+
If you want to analyze private repository, set your GitHub token like below.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
fosslight all -w "https://my_github_token@github.com/Foo/private_repo"
|
|
163
173
|
```
|
|
164
|
-
|
|
174
|
+
|
|
175
|
+
### Ex 4. Compare the BOM of two FOSSLight reports
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
fosslight compare -p FOSSLight_before_proj.yaml FOSSLight_after_proj.yaml -f excel
|
|
165
179
|
```
|
|
166
180
|
|
|
167
181
|
## 📁 Result
|
|
168
182
|
|
|
169
|
-
```
|
|
183
|
+
```text
|
|
170
184
|
$ tree
|
|
171
185
|
.
|
|
172
186
|
├── fosslight_log
|
|
173
|
-
│
|
|
187
|
+
│ ├── fosslight_log_20210924_022422.txt
|
|
174
188
|
└── FOSSLight-Report_20210924_022422.xlsx
|
|
175
189
|
```
|
|
176
190
|
|
|
177
|
-
- FOSSLight_Report-[datetime].xlsx
|
|
191
|
+
- FOSSLight_Report-[datetime].xlsx: OSS Report format file that outputs source code analysis, binary analysis, and dependency analysis results.
|
|
178
192
|
- fosslight_raw_data_[datetime] directory: Directory in which raw data files are created as a result of analysis
|
|
179
193
|
|
|
180
194
|
## 🐳 How to run using Docker
|
|
195
|
+
|
|
181
196
|
1. Build image using Dockerfile.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
docker build -t fosslight .
|
|
182
200
|
```
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
2. Run with the image you built.
|
|
201
|
+
|
|
202
|
+
2. Run with the image you built.
|
|
186
203
|
ex. Output: /Users/fosslight_source_scanner/test_output, Path to be analyzed: tests/test_files
|
|
187
|
-
|
|
188
|
-
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
docker run -it -v /Users/fosslight_source_scanner/test_output:/app/output fosslight -p tests/test_files -o output
|
|
189
207
|
```
|
|
190
208
|
|
|
191
209
|
## 👏 How to report issue
|
|
192
210
|
|
|
193
|
-
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].
|
|
211
|
+
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].
|
|
194
212
|
Then there will be quick bug fixes and upgrades. Ideas to improve are always welcome.
|
|
195
213
|
|
|
196
214
|
[cl]: https://github.com/fosslight/fosslight_scanner/issues
|
{fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/requires.txt
RENAMED
|
@@ -4,8 +4,8 @@ openpyxl
|
|
|
4
4
|
progress
|
|
5
5
|
pyyaml
|
|
6
6
|
beautifulsoup4
|
|
7
|
-
fosslight_util<3.0.0,>=2.1.
|
|
7
|
+
fosslight_util<3.0.0,>=2.1.38
|
|
8
8
|
fosslight_source<3.0.0,>=2.2.3
|
|
9
|
-
fosslight_dependency<5.0.0,>=4.1.
|
|
9
|
+
fosslight_dependency<5.0.0,>=4.1.31
|
|
10
10
|
fosslight_binary<6.0.0,>=5.1.17
|
|
11
11
|
fosslight_prechecker<5.0.0,>=4.0.0
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
# Copyright (c) 2021 LG Electronics Inc.
|
|
4
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
from fosslight_util.help import PrintHelpMsg
|
|
6
|
-
from fosslight_util.output_format import SUPPORT_FORMAT
|
|
7
|
-
|
|
8
|
-
_HELP_MESSAGE_SCANNER = f"""
|
|
9
|
-
FOSSLight Scanner performs open source analysis after downloading the source from URL that can be cloned by git or wget.
|
|
10
|
-
Instead, open source analysis and checking copyright/license rules can be performed for the local source path.
|
|
11
|
-
The output result is generated in OSS Report format.
|
|
12
|
-
|
|
13
|
-
Usage: fosslight [Mode] [option1] <arg1> [option2] <arg2>...
|
|
14
|
-
|
|
15
|
-
Parameters:
|
|
16
|
-
Mode: Multiple modes can be entered by separating them with , (ex. source,binary)
|
|
17
|
-
all\t\t\t Run all scanners(Default)
|
|
18
|
-
source\t\t Run FOSSLight Source Scanner
|
|
19
|
-
dependency\t\t Run FOSSLight Dependency Scanner
|
|
20
|
-
binary\t\t Run FOSSLight Binary Scanner
|
|
21
|
-
compare\t\t Compare two FOSSLight reports
|
|
22
|
-
|
|
23
|
-
Options:
|
|
24
|
-
-h\t\t\t Print help message
|
|
25
|
-
-p <path>\t\t Path to analyze (ex, -p [input_path])
|
|
26
|
-
* Compare mode input file: Two FOSSLight reports (supports excel, yaml)
|
|
27
|
-
(ex, -p [before_name].xlsx [after_name].xlsx)
|
|
28
|
-
-w <link>\t\t Link to be analyzed can be downloaded by wget or git clone
|
|
29
|
-
-f <formats> [<format> ...]\t FOSSLight Report file format ({', '.join(SUPPORT_FORMAT)})
|
|
30
|
-
* Compare mode result file: supports excel, json, yaml, html
|
|
31
|
-
* Multiple formats can be specified separated by space.
|
|
32
|
-
-e <path>\t\t Path to exclude from analysis (files and directories)
|
|
33
|
-
* IMPORTANT: Always wrap patterns in double quotes ("") to avoid shell expansion.
|
|
34
|
-
Example) fosslight -e "test/abc.py" "*.jar"
|
|
35
|
-
-o <output>\t\t Output directory or file
|
|
36
|
-
-c <number>\t\t Number of processes to analyze source
|
|
37
|
-
-r\t\t\t Keep raw data
|
|
38
|
-
-t\t\t\t Hide the progress bar
|
|
39
|
-
-v\t\t\t Print FOSSLight Scanner version
|
|
40
|
-
-s <path>\t Path to apply setting from file (check format with 'setting.json' in this repository)
|
|
41
|
-
* Direct cli flags have higher priority than setting file
|
|
42
|
-
(ex, '-f yaml -s setting.json' - result file extension is .yaml)
|
|
43
|
-
--no_correction\t Enter if you don't want to correct OSS information with sbom-info.yaml
|
|
44
|
-
* Correction mode only supported xlsx format.
|
|
45
|
-
--correct_fpath <path> Path to the sbom-info.yaml file
|
|
46
|
-
--ui\t\t Generate UI mode result file
|
|
47
|
-
--recursive_dep\t Recursively analyze dependencies
|
|
48
|
-
|
|
49
|
-
Options for only 'all' or 'bin' mode
|
|
50
|
-
-u <db_url>\t\t DB Connection(format :'postgresql://username:password@host:port/database_name')
|
|
51
|
-
|
|
52
|
-
Options for only 'all' or 'dependency' mode
|
|
53
|
-
-d <dependency_arg>\t Additional arguments for running dependency analysis"""
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def print_help_msg():
|
|
57
|
-
helpMsg = PrintHelpMsg(_HELP_MESSAGE_SCANNER)
|
|
58
|
-
helpMsg.print_help_msg(True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner/_parse_setting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_scanner-2.1.14 → fosslight_scanner-2.1.16}/src/fosslight_scanner.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|