diff --git a/blint/cli.py b/blint/cli.py index 89b50fe..36397df 100644 --- a/blint/cli.py +++ b/blint/cli.py @@ -6,10 +6,10 @@ import os import sys -from blint.analysis import AnalysisRunner, report +from blint.lib.analysis import AnalysisRunner, report from blint.logger import LOG -from blint.sbom import generate -from blint.utils import gen_file_list +from blint.lib.sbom import generate +from blint.lib.utils import gen_file_list BLINT_LOGO = """ ██████╗ ██╗ ██╗███╗ ██╗████████╗ diff --git a/blint/lib/__init__.py b/blint/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/blint/analysis.py b/blint/lib/analysis.py similarity index 99% rename from blint/analysis.py rename to blint/lib/analysis.py index 0efbb73..3e59189 100644 --- a/blint/analysis.py +++ b/blint/lib/analysis.py @@ -14,10 +14,10 @@ from rich.progress import Progress from rich.terminal_theme import MONOKAI -from blint.binary import parse +from blint.lib.binary import parse # pylint: disable-next=unused-import -from blint.checks import ( +from blint.lib.checks import ( check_nx, check_pie, check_relro, @@ -31,7 +31,7 @@ ) from blint.config import FIRST_STAGE_WORDS, PII_WORDS, get_int_from_env from blint.logger import LOG, console -from blint.utils import create_findings_table, is_fuzzable_name, print_findings_table +from blint.lib.utils import create_findings_table, is_fuzzable_name, print_findings_table try: import importlib.resources # pylint: disable=ungrouped-imports diff --git a/blint/android.py b/blint/lib/android.py similarity index 98% rename from blint/android.py rename to blint/lib/android.py index f616629..5b7accd 100644 --- a/blint/android.py +++ b/blint/lib/android.py @@ -4,7 +4,7 @@ import sys import tempfile -from blint.binary import parse, parse_dex +from blint.lib.binary import parse, parse_dex from blint.config import SYMBOL_DELIMITER from blint.cyclonedx.spec import ( Component, @@ -14,7 +14,7 @@ Type, ) from blint.logger import LOG -from blint.utils import check_command, create_component_evidence, find_files, unzip_unsafe +from blint.lib.utils import check_command, create_component_evidence, find_files, unzip_unsafe ANDROID_HOME = os.getenv("ANDROID_HOME") APKANALYZER_CMD = os.getenv("APKANALYZER_CMD") diff --git a/blint/binary.py b/blint/lib/binary.py similarity index 99% rename from blint/binary.py rename to blint/lib/binary.py index b841452..c0f2e82 100644 --- a/blint/binary.py +++ b/blint/lib/binary.py @@ -11,7 +11,7 @@ from blint.config import FIRST_STAGE_WORDS, PII_WORDS, get_float_from_env, get_int_from_env from blint.logger import DEBUG, LOG -from blint.utils import ( +from blint.lib.utils import ( camel_to_snake, calculate_entropy, check_secret, diff --git a/blint/checks.py b/blint/lib/checks.py similarity index 98% rename from blint/checks.py rename to blint/lib/checks.py index 337a8cf..a154fe2 100644 --- a/blint/checks.py +++ b/blint/lib/checks.py @@ -1,5 +1,5 @@ # pylint: disable=missing-function-docstring,unused-argument -from blint.utils import parse_pe_manifest +from blint.lib.utils import parse_pe_manifest def check_nx(f, metadata, rule_obj): # noqa diff --git a/blint/sbom.py b/blint/lib/sbom.py similarity index 99% rename from blint/sbom.py rename to blint/lib/sbom.py index 9998fa2..7db792b 100644 --- a/blint/sbom.py +++ b/blint/lib/sbom.py @@ -9,8 +9,8 @@ import orjson from rich.progress import Progress -from blint.android import collect_app_metadata -from blint.binary import parse +from blint.lib.android import collect_app_metadata +from blint.lib.binary import parse from blint.config import SYMBOL_DELIMITER from blint.cyclonedx.spec import ( BomFormat, @@ -28,7 +28,7 @@ Type, ) from blint.logger import LOG -from blint.utils import ( +from blint.lib.utils import ( camel_to_snake, create_component_evidence, find_android_files, diff --git a/blint/utils.py b/blint/lib/utils.py similarity index 100% rename from blint/utils.py rename to blint/lib/utils.py diff --git a/pyproject.toml b/pyproject.toml index 27c4b57..f6f0f92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "blint" -version = "2.3.1" +version = "2.3.2" description = "Linter and SBOM generator for binary files." authors = ["Prabhu Subramanian ", "Caroline Russell "] license = "MIT" diff --git a/tests/test_analysis.py b/tests/test_analysis.py index e7fcfe3..0929831 100644 --- a/tests/test_analysis.py +++ b/tests/test_analysis.py @@ -1,12 +1,11 @@ import orjson from pathlib import Path -from blint.analysis import ReviewRunner, run_checks +from blint.lib.analysis import ReviewRunner, run_checks def test_gobinary(): test_go_file = Path(__file__).parent / "data" / "ngrok-elf.json" - # test_go_file = Path('C:\\Users\\user\\PycharmProjects\\blint\\tests\\data\\ngrok-elf.json') with open(test_go_file) as fp: file_content = fp.read() metadata = orjson.loads(file_content) @@ -21,7 +20,6 @@ def test_gobinary(): def test_genericbinary(): test_gnu_file = Path(__file__).parent / "data" / "netstat-elf.json" - # test_gnu_file = Path('data/netstat-elf.json') with open(test_gnu_file) as fp: file_content = fp.read() metadata = orjson.loads(file_content) diff --git a/tests/test_android.py b/tests/test_android.py index 02e104b..ef55abf 100644 --- a/tests/test_android.py +++ b/tests/test_android.py @@ -1,6 +1,6 @@ from pathlib import Path -from blint.android import parse_apk_summary +from blint.lib.android import parse_apk_summary def test_parse_summary(): diff --git a/tests/test_binary.py b/tests/test_binary.py index c2fdd7e..cbcfa3b 100644 --- a/tests/test_binary.py +++ b/tests/test_binary.py @@ -2,7 +2,7 @@ import pytest import sys -from blint.binary import demangle_symbolic_name, parse +from blint.lib.binary import demangle_symbolic_name, parse def test_parse():