blint 2.0.6__tar.gz → 2.0.7__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.
- {blint-2.0.6 → blint-2.0.7}/PKG-INFO +2 -1
- {blint-2.0.6 → blint-2.0.7}/README.md +1 -0
- {blint-2.0.6 → blint-2.0.7}/blint/cli.py +19 -7
- {blint-2.0.6 → blint-2.0.7}/blint/sbom.py +22 -13
- {blint-2.0.6 → blint-2.0.7}/pyproject.toml +1 -1
- {blint-2.0.6 → blint-2.0.7}/LICENSE +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/__init__.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/analysis.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/android.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/binary.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/checks.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/config.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/cyclonedx/README.md +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/cyclonedx/__init__.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/cyclonedx/spdx.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/cyclonedx/spec.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/__init__.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/__init__.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_entries_generic.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_entries_pe.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_exe_go.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_imports_pe.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_methods_generic.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_methods_mips.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_monero_generic.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_monero_go.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_monero_rust +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_monero_rust.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_rootkits_win.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_symbols_antiforensic.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_symbols_generic.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_symbols_hooka.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_symbols_macho.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/annotations/review_symbols_rust.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/data/rules.yml +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/logger.py +0 -0
- {blint-2.0.6 → blint-2.0.7}/blint/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: blint
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.7
|
|
4
4
|
Summary: Linter and SBOM generator for binary files.
|
|
5
5
|
Home-page: https://github.com/OWASP-dep-scan/blint
|
|
6
6
|
License: MIT
|
|
@@ -108,6 +108,7 @@ options:
|
|
|
108
108
|
SBOM output file. Defaults to bom.json in current directory.
|
|
109
109
|
--deep Enable deep mode to collect more used symbols and modules aggressively. Slow
|
|
110
110
|
operation.
|
|
111
|
+
--stdout Print the SBOM to stdout instead of a file.
|
|
111
112
|
```
|
|
112
113
|
|
|
113
114
|
To test any binary, including default commands
|
|
@@ -78,6 +78,7 @@ options:
|
|
|
78
78
|
SBOM output file. Defaults to bom.json in current directory.
|
|
79
79
|
--deep Enable deep mode to collect more used symbols and modules aggressively. Slow
|
|
80
80
|
operation.
|
|
81
|
+
--stdout Print the SBOM to stdout instead of a file.
|
|
81
82
|
```
|
|
82
83
|
|
|
83
84
|
To test any binary, including default commands
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
|
|
4
4
|
import argparse
|
|
5
|
+
import logging
|
|
5
6
|
import os
|
|
6
7
|
import sys
|
|
7
8
|
|
|
@@ -104,6 +105,13 @@ def build_args():
|
|
|
104
105
|
help="Enable deep mode to collect more used symbols and modules "
|
|
105
106
|
"aggressively. Slow operation.",
|
|
106
107
|
)
|
|
108
|
+
sbom_parser.add_argument(
|
|
109
|
+
"--stdout",
|
|
110
|
+
action="store_true",
|
|
111
|
+
default=False,
|
|
112
|
+
dest="stdout_mode",
|
|
113
|
+
help="Print the SBOM to stdout instead of a file.",
|
|
114
|
+
)
|
|
107
115
|
return parser.parse_args()
|
|
108
116
|
|
|
109
117
|
|
|
@@ -138,7 +146,7 @@ def handle_args():
|
|
|
138
146
|
source directory.
|
|
139
147
|
"""
|
|
140
148
|
args = build_args()
|
|
141
|
-
if not args.no_banner:
|
|
149
|
+
if not args.no_banner and args.subcommand_name != "sbom":
|
|
142
150
|
print(BLINT_LOGO)
|
|
143
151
|
if not args.src_dir_image:
|
|
144
152
|
args.src_dir_image = [os.getcwd()]
|
|
@@ -163,13 +171,17 @@ def main():
|
|
|
163
171
|
|
|
164
172
|
# SBOM command
|
|
165
173
|
if args.subcommand_name == "sbom":
|
|
166
|
-
if args.
|
|
167
|
-
sbom_output =
|
|
174
|
+
if args.stdout_mode:
|
|
175
|
+
sbom_output = sys.stdout
|
|
176
|
+
LOG.setLevel(logging.ERROR)
|
|
168
177
|
else:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
if args.sbom_output:
|
|
179
|
+
sbom_output = args.sbom_output
|
|
180
|
+
else:
|
|
181
|
+
sbom_output = os.path.join(os.getcwd(), "bom.json")
|
|
182
|
+
sbom_output_dir = os.path.dirname(sbom_output)
|
|
183
|
+
if sbom_output_dir and not os.path.exists(sbom_output_dir):
|
|
184
|
+
os.makedirs(sbom_output_dir)
|
|
173
185
|
generate(src_dirs, sbom_output, args.deep_mode)
|
|
174
186
|
# Default case
|
|
175
187
|
else:
|
|
@@ -175,20 +175,29 @@ def create_sbom(
|
|
|
175
175
|
)
|
|
176
176
|
# Populate the dependencies
|
|
177
177
|
sbom.dependencies = dependencies
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
with open(output_file, mode="w", encoding="utf-8") as fp:
|
|
182
|
-
fp.write(
|
|
183
|
-
sbom.model_dump_json(
|
|
184
|
-
indent=None if deep_mode else 2,
|
|
185
|
-
exclude_none=True,
|
|
186
|
-
exclude_defaults=True,
|
|
187
|
-
warnings=False,
|
|
188
|
-
by_alias=True
|
|
189
|
-
)
|
|
178
|
+
if isinstance(output_file, str):
|
|
179
|
+
LOG.debug(
|
|
180
|
+
f"SBOM includes {len(components)} components and {len(dependencies)} dependencies",
|
|
190
181
|
)
|
|
191
|
-
|
|
182
|
+
with open(output_file, mode="w", encoding="utf-8") as fp:
|
|
183
|
+
fp.write(
|
|
184
|
+
sbom.model_dump_json(
|
|
185
|
+
indent=None if deep_mode else 2,
|
|
186
|
+
exclude_none=True,
|
|
187
|
+
exclude_defaults=True,
|
|
188
|
+
warnings=False,
|
|
189
|
+
by_alias=True
|
|
190
|
+
)
|
|
191
|
+
)
|
|
192
|
+
LOG.debug(f"SBOM file generated successfully at {output_file}")
|
|
193
|
+
else:
|
|
194
|
+
output_file.write(sbom.model_dump_json(
|
|
195
|
+
indent=2,
|
|
196
|
+
exclude_none=True,
|
|
197
|
+
exclude_defaults=True,
|
|
198
|
+
warnings=False,
|
|
199
|
+
by_alias=True
|
|
200
|
+
))
|
|
192
201
|
return True
|
|
193
202
|
|
|
194
203
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|