Skip to content

Commit ab7e148

Browse files
committed
Move config items to config.py, extract duplicate code into functions.
Signed-off-by: Caroline Russell <[email protected]>
1 parent eb1e0f9 commit ab7e148

File tree

7 files changed

+1503
-1353
lines changed

7 files changed

+1503
-1353
lines changed

blint/analysis.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
from pathlib import Path
1212

1313
import yaml
14-
from rich import box
1514
from rich.progress import Progress
16-
from rich.table import Table
1715
from rich.terminal_theme import MONOKAI
1816

1917
from blint.binary import parse
2018
from blint.logger import LOG, console
21-
from blint.utils import (is_fuzzable_name, print_findings_table, )
19+
from blint.utils import (create_findings_table, is_fuzzable_name, print_findings_table, )
2220
from blint.checks import (check_nx, check_pie, # noqa, pylint: disable=unused-import
2321
check_relro, check_canary, check_rpath,
2422
check_virtual_size, check_authenticode,
@@ -279,15 +277,7 @@ def print_reviews_table(reviews, files):
279277
files: A list of file names associated with the reviews.
280278
281279
"""
282-
table = Table(
283-
title="BLint Capability Review",
284-
box=box.DOUBLE_EDGE,
285-
header_style="bold magenta",
286-
show_lines=True,
287-
)
288-
table.add_column("ID")
289-
if len(files) > 1:
290-
table.add_column("Binary")
280+
table = create_findings_table(files, "BLint Capability Review")
291281
table.add_column("Capabilities")
292282
table.add_column("Evidence (Top 5)", overflow="fold")
293283
for r in reviews:

blint/android.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Type,
1919
)
2020
from blint.logger import LOG
21-
from blint.utils import check_command, find_files, unzip_unsafe
21+
from blint.utils import check_command, create_component_evidence, find_files, unzip_unsafe
2222

2323
ANDROID_HOME = os.getenv("ANDROID_HOME")
2424
APKANALYZER_CMD = os.getenv("APKANALYZER_CMD")
@@ -284,19 +284,7 @@ def parse_so_file(app_file, app_temp_dir, sof):
284284
version=version,
285285
purl=purl,
286286
scope=Scope.required,
287-
evidence=ComponentEvidence(
288-
identity=Identity(
289-
field=FieldModel.purl,
290-
confidence=0.5,
291-
methods=[
292-
Method(
293-
technique=Technique.binary_analysis,
294-
value=rel_path,
295-
confidence=0.5,
296-
)
297-
],
298-
)
299-
),
287+
evidence=create_component_evidence(str(rel_path), 0.5),
300288
properties=[
301289
Property(name="internal:srcFile", value=rel_path),
302290
Property(name="internal:appFile", value=app_file),

0 commit comments

Comments
 (0)