coretrace-python-analyzer 0.9.0__tar.gz → 0.11.0__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.
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/CHANGELOG.md +18 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/PKG-INFO +1 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/docs/usage.md +33 -4
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/pyproject.toml +1 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/__init__.py +1 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/python_stdlib/python_stdlib.py +3 -2
- coretrace_python_analyzer-0.11.0/src/coretrace_python/bundled/security/code_injection/code_injection.py +19 -0
- coretrace_python_analyzer-0.11.0/src/coretrace_python/bundled/security/code_injection/plugin.toml +9 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cli.py +7 -2
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/sbom.py +23 -3
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/vex.py +8 -2
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/engine.py +88 -27
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/findings/__init__.py +4 -0
- coretrace_python_analyzer-0.11.0/src/coretrace_python/findings/provenance.py +26 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/reporters/json_format.py +15 -5
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/reporters/report.py +3 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/reporters/sarif.py +13 -2
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/pygoat.json +14 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/vulnerable-flask.json +7 -0
- coretrace_python_analyzer-0.11.0/tests/test_code_injection.py +68 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_detectors.py +2 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_django_http_clients.py +1 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_docs.py +1 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_packaging.py +2 -2
- coretrace_python_analyzer-0.11.0/tests/test_provenance.py +232 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_release.py +1 -1
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/.github/workflows/ci.yml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/.github/workflows/release.yml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/.gitignore +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/LICENSE +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/NOTICE +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/README.md +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/docs/architecture.md +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/docs/plugins.md +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/examples/add.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/examples/canonical_symbols.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/__main__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/abstract/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/abstract/constants.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/abstract/heap.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/abstract/ranges.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/abstract/values.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/analysis/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/analysis/manager.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/analysis/provider.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/dependency_policy/dependency_policy.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/dependency_policy/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/reachable_vulnerability/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/reachable_vulnerability/reachable_vulnerability.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/sample_advisories/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/sample_advisories/sample_advisories.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/vulnerable_dependency/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/dependency/vulnerable_dependency/vulnerable_dependency.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/aiohttp/aiohttp_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/aiohttp/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/bottle/bottle_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/bottle/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/cli/cli_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/cli/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/credentials/credential_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/credentials/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/db_drivers/db_driver_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/db_drivers/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/django/django_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/django/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/fastapi/fastapi_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/fastapi/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/flask/flask_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/flask/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/http_clients/http_client_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/http_clients/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/python_stdlib/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/sqlalchemy/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/sqlalchemy/sqlalchemy_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/tornado/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/models/tornado/tornado_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/secrets/config_secrets/config_secrets.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/secrets/config_secrets/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/secrets/hardcoded_secrets/hardcoded_secrets.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/secrets/hardcoded_secrets/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/command_injection/command_injection.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/command_injection/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/insecure_deserialization/insecure_deserialization.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/insecure_deserialization/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/open_redirect/open_redirect.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/open_redirect/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/path_traversal/path_traversal.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/path_traversal/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/plaintext_credentials/plaintext_credentials.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/plaintext_credentials/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/sql_injection/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/sql_injection/sql_injection.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/ssrf/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/ssrf/ssrf.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/xss/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/security/xss/xss.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/dangerous_eval/dangerous_eval.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/dangerous_eval/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/flask_debug/flask_debug.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/flask_debug/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/insecure_tempfile/insecure_tempfile.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/insecure_tempfile/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/insecure_tls/insecure_tls.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/insecure_tls/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/missing_timeout/missing_timeout.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/missing_timeout/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/unsafe_archive/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/unsafe_archive/unsafe_archive.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/unsafe_xml/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/unsafe_xml/unsafe_xml.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/weak_crypto/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/weak_crypto/weak_crypto.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/weak_random/plugin.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/bundled/syntax/weak_random/weak_random.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cache.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cfg/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cfg/builder.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cfg/dominance.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cfg/model.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dataflow/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dataflow/lattice.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dataflow/solver.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/advisories.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/correlation.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/graph.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/dependency/policy.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/findings/baseline.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/findings/coverage.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/findings/model.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/findings/refutation.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/findings/suppressions.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/frontend/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/frontend/ast_adapter.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/frontend/parser.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/hir/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/hir/nodes.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/hir/visitors.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/interprocedural/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/interprocedural/callgraph.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/interprocedural/modulegraph.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/interprocedural/summaries.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/ir/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/ir/defuse.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/ir/lowering.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/ir/model.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/ir/printer.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/ir/ssa.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/api.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/detectors.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/loader.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/manifest.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/registry.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/plugins/secrets.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/reporters/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/reporters/text.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/semantic/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/semantic/identity.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/semantic/imports.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/semantic/scopes.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/semantic/symbols.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/source/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/source/manager.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/source/model.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/taint/__init__.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/taint/engine.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/taint/models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/taint/routes.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/taint/templates.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/Chatbot.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/DjangoGoat.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/Flask-Image-Editing-Website.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/InsecureGram.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/MiniBookApiServer.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/NPL-IA.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/Spam-Detection-Project.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/Vulnerable_fastapi.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/dvpwa.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/full-stack-fastapi-template.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/healthchecks.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/httpie.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/luigi.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/my_gdb.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/network-topologer.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/uploadbox-cloud-storage-solution.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/expected/yt-fts.json +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/fixtures/vulnerable-flask/README.md +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/fixtures/vulnerable-flask/app.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/fixtures/vulnerable-flask/requirements.txt +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/fixtures/vulnerable-flask/vulnerable_services.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/regression/repositories.toml +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_advisory_evidence.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_advisory_feeds.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_aiohttp_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_analysis_manager.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_architecture.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_argument_conditions.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_attacker_arguments.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_audit_detectors.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_baseline.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_cache.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_cfg.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_class_keywords_with_targets.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_cli.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_closures.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_config_secrets_coverage.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_constants.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_correlation.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_credential_context.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_dataflow.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_dependencies.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_discovery.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_django_routes.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_django_safe_values.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_dominance.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_emit_ir.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_exceptions.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_factories_match_loop_else.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_fail_on.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_fastapi_cli_precision.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_frameworks.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_frontend_gaps.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_heap.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_hex_digests.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_hir_builder.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_imports.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_interprocedural.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_interprocedural_taint.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_ir.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_match_patterns.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_module_level.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_nonlocal_writeback.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_operator_sources.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_parallel.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_parser.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_plaintext_credentials.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_plugins.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_project.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_project_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_project_validators.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_pyir_imports.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_read_entry_points.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_real_code_precision.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_redirect_targets.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_refutation.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_refutation_evidence.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_regression.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_relative_paths.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_remaining_limits.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_reporters.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_safe_arguments.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_scale.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_scopes.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_secrets_sbom.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_self_state.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_source_manager.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_ssa.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_ssrf_targets.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_summary_sanitizers.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_suppressions.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_symbol_resolution.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_symbols.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_syntactic_rules.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_syntax_control_flow.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_syntax_coverage.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_syntax_expressions.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_taint.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_template_escaping.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_tornado_bottle_models.py +0 -0
- {coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/tests/test_vex.py +0 -0
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0 (2026-09-25)
|
|
4
|
+
|
|
5
|
+
### Detection
|
|
6
|
+
|
|
7
|
+
- `code-injection` reports attacker input reaching the code `eval` or `exec` runs, with the same verdicts as the other taint rules. The globals and locals passed with the code are data, not code. `dangerous-eval` still reports every call to `eval` or `exec`, whatever it runs. The regression corpus gains three findings, each reviewed as a true positive: pygoat's `mitre_lab_25_api` and `cmd_lab2` evaluate a POST field, and the `vulnerable-flask` fixture evaluates a query parameter (#152).
|
|
8
|
+
|
|
9
|
+
## 0.10.0 (2026-09-25)
|
|
10
|
+
|
|
11
|
+
### Reports
|
|
12
|
+
|
|
13
|
+
- A directory check names what its result was produced with, besides the engine and the sources. It lists each plugin it loaded, by manifest name and version, and each advisory file it read, by path, each with the SHA-256 digest of its content. The formats show them in these places:
|
|
14
|
+
- JSON: `tool.components`;
|
|
15
|
+
- SARIF: `tool.extensions`;
|
|
16
|
+
- CycloneDX SBOM: `metadata.tools.components`, with their hashes;
|
|
17
|
+
- OpenVEX: the document's `tooling`, so its `@id` changes with the advisory data.
|
|
18
|
+
|
|
19
|
+
Every finding about an advisory names the plugin (`name@version`) or advisory file it comes from, in its `advisory_source` metadata. The cache key and the reports identify a plugin by the same digest (#149).
|
|
20
|
+
|
|
3
21
|
## 0.9.0 (2026-09-25)
|
|
4
22
|
|
|
5
23
|
### Precision
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: coretrace-python-analyzer
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
4
4
|
Summary: Static security analysis infrastructure for Python code
|
|
5
5
|
Project-URL: Homepage, https://github.com/CoreTrace/coretrace-python-analyzer
|
|
6
6
|
Project-URL: Repository, https://github.com/CoreTrace/coretrace-python-analyzer
|
|
@@ -110,6 +110,7 @@ variable is not treated that way yet.
|
|
|
110
110
|
| Rule | Reached sink |
|
|
111
111
|
|---|---|
|
|
112
112
|
| `command-injection` | Shell or process execution (`os.system`, `subprocess` with a string, …). |
|
|
113
|
+
| `code-injection` | The code `eval` or `exec` runs; the globals and locals passed with it are data. `dangerous-eval` reports every such call, this rule the ones attacker input reaches. |
|
|
113
114
|
| `sql-injection` | A database statement (`cursor.execute`, SQLAlchemy `text`, Django `raw`, …). Parameters of a parameterised query are not statements. |
|
|
114
115
|
| `path-traversal` | A file system path (`open`, `send_file`, `os.remove`, …). |
|
|
115
116
|
| `ssrf` | The URL of an HTTP client request (Requests, httpx, `urllib`), by position or as `url=`; the body, headers and query parameters are not the destination. |
|
|
@@ -239,7 +240,7 @@ the directory of the checked file; a path outside it is printed as it is.
|
|
|
239
240
|
```json
|
|
240
241
|
{
|
|
241
242
|
"schema_version": 1,
|
|
242
|
-
"tool": {"name": "coretrace-python-analyzer", "version": "0.
|
|
243
|
+
"tool": {"name": "coretrace-python-analyzer", "version": "0.11.0"},
|
|
243
244
|
"root": "/home/me/project",
|
|
244
245
|
"findings": [
|
|
245
246
|
{
|
|
@@ -261,10 +262,34 @@ the directory of the checked file; a path outside it is printed as it is.
|
|
|
261
262
|
|
|
262
263
|
`root` is the directory the paths are relative to.
|
|
263
264
|
|
|
265
|
+
A directory check also lists, in `tool.components`, what the result was produced with
|
|
266
|
+
besides the engine and the sources: each plugin it loaded, by manifest name and version,
|
|
267
|
+
and each advisory file it read, by path (relative to the root when under it). Each
|
|
268
|
+
component carries the SHA-256 digest of its content, so a result can be traced to the
|
|
269
|
+
exact advisory data it used and reproduced. A plugin's digest covers its directory as the
|
|
270
|
+
cache fingerprints it, bytecode and hidden files left out; a file's digest covers its
|
|
271
|
+
bytes. A single-file check lists no components.
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
"tool": {
|
|
275
|
+
"name": "coretrace-python-analyzer", "version": "0.11.0",
|
|
276
|
+
"components": [
|
|
277
|
+
{"kind": "plugin", "name": "curated-advisories", "version": "2026.09.25", "digest": "sha256:…"},
|
|
278
|
+
{"kind": "advisories", "name": "advisories.json", "digest": "sha256:…"}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
A finding about an advisory names, in its `advisory_source` metadata, where the advisory
|
|
284
|
+
comes from. For a plugin this is `name@version`, and for an advisory file its path. When
|
|
285
|
+
several sources define the same advisory, it names the one whose definition is used, as
|
|
286
|
+
the next section describes.
|
|
287
|
+
|
|
264
288
|
`--format sarif` prints a SARIF 2.1.0 log, one run with the tool, its rules and one
|
|
265
289
|
result per finding. The root is declared once as the `SRCROOT` original URI base and
|
|
266
290
|
every location under it is relative to that base, which is what code scanning services
|
|
267
|
-
need to attach results to files
|
|
291
|
+
need to attach results to files. The components of a directory check are the tool's
|
|
292
|
+
`extensions`, their kind and digest in `properties`:
|
|
268
293
|
|
|
269
294
|
```bash
|
|
270
295
|
coretrace-python-analyzer --check src/ --format sarif > report.sarif
|
|
@@ -385,7 +410,9 @@ ignore = ["CVE-2020-1747"]
|
|
|
385
410
|
```
|
|
386
411
|
|
|
387
412
|
`--sbom PATH` writes a CycloneDX 1.5 bill of materials: one component per requirement
|
|
388
|
-
with its package URL, and the advisories affecting them as vulnerabilities.
|
|
413
|
+
with its package URL, and the advisories affecting them as vulnerabilities. Its tools
|
|
414
|
+
list the analyzer and the components of the check, each with its SHA-256 hash: a plugin
|
|
415
|
+
as an `application`, an advisory file as `data`.
|
|
389
416
|
|
|
390
417
|
```bash
|
|
391
418
|
coretrace-python-analyzer --check src/ --sbom sbom.json --policy security/policy.toml
|
|
@@ -407,7 +434,9 @@ not the code of installed packages. A framework calling the vulnerable function
|
|
|
407
434
|
project's behalf would go unseen. Without a lock file, a package is never
|
|
408
435
|
`not_affected`. The document's `@id` derives from its statements, so two runs with the
|
|
409
436
|
same result share it; its `author` is `Unknown Author`, as OpenVEX tools write when they
|
|
410
|
-
cannot know it.
|
|
437
|
+
cannot know it. Its `tooling` names the analyzer and each component with its digest
|
|
438
|
+
(`coretrace-python-analyzer 0.11.0; curated-advisories 2026.09.25 (sha256:…)`), so the
|
|
439
|
+
`@id` changes with the advisory data a statement was decided with.
|
|
411
440
|
|
|
412
441
|
## Large projects
|
|
413
442
|
|
|
@@ -57,8 +57,9 @@ class PythonStdlibModels(ModelPlugin):
|
|
|
57
57
|
Sink(_sym("subprocess.check_call"), TaintKind.COMMAND),
|
|
58
58
|
Sink(_sym("subprocess.check_output"), TaintKind.COMMAND),
|
|
59
59
|
Sink(_sym("subprocess.Popen"), TaintKind.COMMAND),
|
|
60
|
-
|
|
61
|
-
Sink(_sym("builtins.
|
|
60
|
+
# The code is the first argument; the globals and locals it runs with are data.
|
|
61
|
+
Sink(_sym("builtins.eval"), TaintKind.CODE, ((TaintKind.CODE, (0,)),)),
|
|
62
|
+
Sink(_sym("builtins.exec"), TaintKind.CODE, ((TaintKind.CODE, (0,)),)),
|
|
62
63
|
Sink(_sym("builtins.open"), TaintKind.PATH),
|
|
63
64
|
Sink(_sym("os.remove"), TaintKind.PATH),
|
|
64
65
|
Sink(_sym("os.unlink"), TaintKind.PATH),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Code injection: attacker-controlled input reaching a CODE sink, such as the code
|
|
2
|
+
``eval`` or ``exec`` runs. ``dangerous-eval`` reports every such call; this rule reports
|
|
3
|
+
the ones attacker input reaches."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import ClassVar
|
|
8
|
+
|
|
9
|
+
from coretrace_python.findings import Severity
|
|
10
|
+
from coretrace_python.plugins import TaintDetector
|
|
11
|
+
from coretrace_python.taint import TaintKind
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CodeInjectionPlugin(TaintDetector):
|
|
15
|
+
name: ClassVar[str] = "code-injection"
|
|
16
|
+
rule_id: ClassVar[str] = "code-injection"
|
|
17
|
+
kind: ClassVar[TaintKind] = TaintKind.CODE
|
|
18
|
+
severity: ClassVar[Severity] = Severity.HIGH
|
|
19
|
+
title: ClassVar[str] = "Code injection"
|
{coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/cli.py
RENAMED
|
@@ -242,9 +242,12 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
242
242
|
findings = analysis.findings
|
|
243
243
|
coverage = analysis.coverage
|
|
244
244
|
suppressed = analysis.suppressed
|
|
245
|
+
components = analysis.components
|
|
245
246
|
if args.sbom is not None:
|
|
246
247
|
args.sbom.write_text(
|
|
247
|
-
render_sbom(
|
|
248
|
+
render_sbom(
|
|
249
|
+
analysis.dependencies, analysis.advisories, engine.TOOL_NAME, __version__, analysis.components
|
|
250
|
+
),
|
|
248
251
|
encoding="utf-8",
|
|
249
252
|
)
|
|
250
253
|
if args.vex is not None:
|
|
@@ -258,6 +261,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
258
261
|
engine.TOOL_NAME,
|
|
259
262
|
__version__,
|
|
260
263
|
datetime.now(UTC),
|
|
264
|
+
analysis.components,
|
|
261
265
|
),
|
|
262
266
|
encoding="utf-8",
|
|
263
267
|
)
|
|
@@ -265,6 +269,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
265
269
|
file_analysis = engine.analyze_file(SourceManager().load_file(args.path), plugin_roots)
|
|
266
270
|
findings, coverage = file_analysis.findings, file_analysis.coverage
|
|
267
271
|
suppressed = file_analysis.suppressed
|
|
272
|
+
components = ()
|
|
268
273
|
root = args.path.resolve() if args.path.is_dir() else args.path.resolve().parent
|
|
269
274
|
baselined = None
|
|
270
275
|
if args.baseline is not None:
|
|
@@ -273,7 +278,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
273
278
|
else:
|
|
274
279
|
Baseline.of(findings, root).save(args.baseline)
|
|
275
280
|
findings, baselined = (), findings
|
|
276
|
-
report = engine.report(findings, coverage, root, suppressed, baselined)
|
|
281
|
+
report = engine.report(findings, coverage, root, suppressed, baselined, components)
|
|
277
282
|
print(render(args.format or "text", report), end="")
|
|
278
283
|
threshold = Severity(args.fail_on).rank if args.fail_on is not None else 0
|
|
279
284
|
failing = any(finding.severity.rank >= threshold for finding in findings)
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
|
-
from collections.abc import Iterable
|
|
6
|
+
from collections.abc import Iterable, Sequence
|
|
7
7
|
|
|
8
8
|
from coretrace_python.dependency.graph import Advisory, DependencyGraph, Requirement
|
|
9
|
+
from coretrace_python.findings import PLUGIN, Component
|
|
9
10
|
|
|
10
11
|
SPEC_VERSION = "1.5"
|
|
11
12
|
|
|
@@ -33,8 +34,22 @@ def _component(requirement: Requirement) -> dict[str, object]:
|
|
|
33
34
|
return component
|
|
34
35
|
|
|
35
36
|
|
|
37
|
+
def _tool(component: Component) -> dict[str, object]:
|
|
38
|
+
"""A plugin as an application, an advisory file as data, each with its SHA-256."""
|
|
39
|
+
|
|
40
|
+
tool: dict[str, object] = {"type": "application" if component.kind == PLUGIN else "data", "name": component.name}
|
|
41
|
+
if component.version is not None:
|
|
42
|
+
tool["version"] = component.version
|
|
43
|
+
tool["hashes"] = [{"alg": "SHA-256", "content": component.digest.removeprefix("sha256:")}]
|
|
44
|
+
return tool
|
|
45
|
+
|
|
46
|
+
|
|
36
47
|
def render_sbom(
|
|
37
|
-
dependencies: DependencyGraph,
|
|
48
|
+
dependencies: DependencyGraph,
|
|
49
|
+
advisories: Iterable[Advisory],
|
|
50
|
+
tool_name: str,
|
|
51
|
+
tool_version: str,
|
|
52
|
+
components: Sequence[Component] = (),
|
|
38
53
|
) -> str:
|
|
39
54
|
"""A CycloneDX JSON document: one component per requirement, and the advisories
|
|
40
55
|
affecting them as vulnerabilities. Deterministic for a given graph."""
|
|
@@ -57,7 +72,12 @@ def render_sbom(
|
|
|
57
72
|
"specVersion": SPEC_VERSION,
|
|
58
73
|
"version": 1,
|
|
59
74
|
"metadata": {
|
|
60
|
-
"tools": {
|
|
75
|
+
"tools": {
|
|
76
|
+
"components": [
|
|
77
|
+
{"type": "application", "name": tool_name, "version": tool_version},
|
|
78
|
+
*(_tool(component) for component in components),
|
|
79
|
+
]
|
|
80
|
+
}
|
|
61
81
|
},
|
|
62
82
|
"components": [_component(requirement) for requirement in requirements],
|
|
63
83
|
"vulnerabilities": vulnerabilities,
|
|
@@ -23,7 +23,7 @@ from urllib.parse import quote
|
|
|
23
23
|
|
|
24
24
|
from coretrace_python.dependency.graph import Advisory, DependencyGraph, Requirement
|
|
25
25
|
from coretrace_python.dependency.sbom import purl
|
|
26
|
-
from coretrace_python.findings import Finding
|
|
26
|
+
from coretrace_python.findings import Component, Finding
|
|
27
27
|
from coretrace_python.findings.coverage import Coverage
|
|
28
28
|
|
|
29
29
|
CONTEXT = "https://openvex.dev/ns/v0.2.0"
|
|
@@ -44,6 +44,7 @@ def render_vex(
|
|
|
44
44
|
tool_name: str,
|
|
45
45
|
tool_version: str,
|
|
46
46
|
timestamp: datetime,
|
|
47
|
+
components: Sequence[Component] = (),
|
|
47
48
|
) -> str:
|
|
48
49
|
"""The OpenVEX document of the project at ``root``. ``evidence`` is every finding of
|
|
49
50
|
the check, those suppressed or accepted by the policy included. The document's
|
|
@@ -69,7 +70,12 @@ def render_vex(
|
|
|
69
70
|
**_status(advisory, requirement, about, dependencies, coverage, root),
|
|
70
71
|
}
|
|
71
72
|
)
|
|
72
|
-
tooling =
|
|
73
|
+
tooling = "; ".join(
|
|
74
|
+
(
|
|
75
|
+
f"{tool_name} {tool_version}",
|
|
76
|
+
*(" ".join(filter(None, (c.name, c.version, f"({c.digest})"))) for c in components),
|
|
77
|
+
)
|
|
78
|
+
)
|
|
73
79
|
content = {
|
|
74
80
|
"@context": CONTEXT,
|
|
75
81
|
"author": AUTHOR,
|
{coretrace_python_analyzer-0.9.0 → coretrace_python_analyzer-0.11.0}/src/coretrace_python/engine.py
RENAMED
|
@@ -7,9 +7,10 @@ plugins and analyses never import it.
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
import concurrent.futures
|
|
10
|
+
import hashlib
|
|
10
11
|
import multiprocessing
|
|
11
12
|
from collections.abc import Callable, Iterable, Mapping, Sequence
|
|
12
|
-
from dataclasses import dataclass, field
|
|
13
|
+
from dataclasses import dataclass, field, replace
|
|
13
14
|
from pathlib import Path
|
|
14
15
|
from types import MappingProxyType
|
|
15
16
|
from typing import Any, ClassVar
|
|
@@ -55,7 +56,10 @@ from coretrace_python.dependency.correlation import (
|
|
|
55
56
|
correlate,
|
|
56
57
|
)
|
|
57
58
|
from coretrace_python.findings import (
|
|
59
|
+
ADVISORIES,
|
|
58
60
|
FINDING_SCHEMA_VERSION,
|
|
61
|
+
PLUGIN,
|
|
62
|
+
Component,
|
|
59
63
|
Confidence,
|
|
60
64
|
Coverage,
|
|
61
65
|
FileCoverage,
|
|
@@ -217,6 +221,8 @@ class ProjectAnalysis:
|
|
|
217
221
|
suppressed: tuple[Finding, ...] = ()
|
|
218
222
|
# Findings about an advisory the policy accepts, still evidence of what is reached.
|
|
219
223
|
accepted: tuple[Finding, ...] = ()
|
|
224
|
+
# The plugins and advisory files the result was produced with.
|
|
225
|
+
components: tuple[Component, ...] = ()
|
|
220
226
|
|
|
221
227
|
|
|
222
228
|
@dataclass(frozen=True)
|
|
@@ -358,10 +364,10 @@ def analyze_project(
|
|
|
358
364
|
for error in dependencies.errors:
|
|
359
365
|
findings.append(_note("syntax-error", error, sources.add_source(error.split(":")[0], ""), 1))
|
|
360
366
|
advisory_paths = _advisory_paths(root, advisory_files)
|
|
361
|
-
file_advisories: list[Advisory] = []
|
|
367
|
+
file_advisories: list[tuple[Path, tuple[Advisory, ...]]] = []
|
|
362
368
|
for path in advisory_paths:
|
|
363
369
|
try:
|
|
364
|
-
file_advisories.
|
|
370
|
+
file_advisories.append((path, load_advisories(path)))
|
|
365
371
|
except AdvisoryFileError as error:
|
|
366
372
|
findings.append(_note("syntax-error", str(error), sources.add_source(str(path), ""), 1))
|
|
367
373
|
policy = Policy()
|
|
@@ -392,9 +398,8 @@ def analyze_project(
|
|
|
392
398
|
probe = next(iter(managers.values()), None) or _register_all(build_hir(sources.add_source("<empty>", "")))
|
|
393
399
|
registry = load_plugins(plugin_roots, probe)
|
|
394
400
|
all_plugins: tuple[Plugin, ...] = (*(loaded.plugin for loaded in registry), *plugins)
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
)
|
|
401
|
+
components = _components(registry, root, (path for path, _ in file_advisories))
|
|
402
|
+
advisories, origins = _merge_advisories(_contributions(registry, plugins, root, file_advisories))
|
|
398
403
|
affected = affected_symbols(dependencies, advisories)
|
|
399
404
|
models = plugin_models(all_plugins, root).extended(*advisory_sinks(affected))
|
|
400
405
|
for manager in managers.values():
|
|
@@ -425,7 +430,7 @@ def analyze_project(
|
|
|
425
430
|
manager.provide(EscapedTemplates, escaped)
|
|
426
431
|
manager.provide(ClearingAnalysis, clearing)
|
|
427
432
|
|
|
428
|
-
configuration = _configuration_key(
|
|
433
|
+
configuration = _configuration_key(components, plugins, models, advisories, dependencies, routes, escaped)
|
|
429
434
|
keys = module_keys(
|
|
430
435
|
graph,
|
|
431
436
|
{name: fingerprint(configuration, str(files[name].source_id), name, files[name].text) for name in analysable},
|
|
@@ -511,6 +516,7 @@ def analyze_project(
|
|
|
511
516
|
for plugin in all_plugins:
|
|
512
517
|
if isinstance(plugin, ProjectPlugin):
|
|
513
518
|
findings = list(apply_refinement(plugin, findings, plugin.refine(context, tuple(findings))))
|
|
519
|
+
findings = [_sourced(finding, origins) for finding in findings]
|
|
514
520
|
accepted = tuple(f for f in findings if policy.accepts(f))
|
|
515
521
|
kept, suppressed = partition(apply_policy(policy, findings), _text_of(sources))
|
|
516
522
|
return ProjectAnalysis(
|
|
@@ -524,20 +530,78 @@ def analyze_project(
|
|
|
524
530
|
Coverage(tuple(sorted(coverage, key=lambda c: c.path))),
|
|
525
531
|
suppressed,
|
|
526
532
|
accepted,
|
|
533
|
+
components,
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
Origins = Mapping[tuple[str, str], str]
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def _merge_advisories(contributions: Iterable[tuple[str, Iterable[Advisory]]]) -> tuple[tuple[Advisory, ...], Origins]:
|
|
541
|
+
"""One advisory per identifier and package, with the contributor it comes from: a
|
|
542
|
+
later contributor replaces an earlier one, so a curated plugin refines a bundled
|
|
543
|
+
sample and a local file, the project's own feed, wins over every plugin."""
|
|
544
|
+
|
|
545
|
+
merged: dict[tuple[str, str], tuple[str, Advisory]] = {}
|
|
546
|
+
for source, advisories in contributions:
|
|
547
|
+
for advisory in advisories:
|
|
548
|
+
merged[(advisory.id, advisory.package)] = (source, advisory)
|
|
549
|
+
return (
|
|
550
|
+
tuple(advisory for _, advisory in merged.values()),
|
|
551
|
+
MappingProxyType({key: source for key, (source, _) in merged.items()}),
|
|
527
552
|
)
|
|
528
553
|
|
|
529
554
|
|
|
530
|
-
def
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
555
|
+
def _contributions(
|
|
556
|
+
registry: PluginRegistry,
|
|
557
|
+
plugins: Sequence[Plugin],
|
|
558
|
+
root: Path,
|
|
559
|
+
files: Iterable[tuple[Path, tuple[Advisory, ...]]],
|
|
560
|
+
) -> list[tuple[str, Iterable[Advisory]]]:
|
|
561
|
+
"""The advisories of each plugin, then of each advisory file, each under the name a
|
|
562
|
+
finding cites it by: ``name@version`` for a loaded plugin, the path for a file."""
|
|
563
|
+
|
|
564
|
+
return [
|
|
565
|
+
*((f"{loaded.manifest.name}@{loaded.manifest.version}", loaded.plugin.advisories) for loaded in registry),
|
|
566
|
+
*((plugin.name, plugin.advisories) for plugin in plugins),
|
|
567
|
+
*((_located(path, root), advisories) for path, advisories in files),
|
|
568
|
+
]
|
|
536
569
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
570
|
+
|
|
571
|
+
def _components(registry: PluginRegistry, root: Path, files: Iterable[Path]) -> tuple[Component, ...]:
|
|
572
|
+
"""The plugins and advisory files a project result is produced with, each with the
|
|
573
|
+
digest of its content: the plugin directory as the cache fingerprints it, the file's
|
|
574
|
+
bytes."""
|
|
575
|
+
|
|
576
|
+
return (
|
|
577
|
+
*(
|
|
578
|
+
Component(PLUGIN, loaded.manifest.name, f"sha256:{directory_fingerprint(loaded.directory)}", loaded.manifest.version)
|
|
579
|
+
for loaded in registry
|
|
580
|
+
),
|
|
581
|
+
*(
|
|
582
|
+
Component(ADVISORIES, _located(path, root), f"sha256:{hashlib.sha256(path.read_bytes()).hexdigest()}")
|
|
583
|
+
for path in files
|
|
584
|
+
),
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
def _located(path: Path, root: Path) -> str:
|
|
589
|
+
"""``path`` relative to ``root``, POSIX style, when it lies under it."""
|
|
590
|
+
|
|
591
|
+
try:
|
|
592
|
+
return path.resolve().relative_to(root.resolve()).as_posix()
|
|
593
|
+
except ValueError:
|
|
594
|
+
return str(path)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
def _sourced(finding: Finding, origins: Origins) -> Finding:
|
|
598
|
+
"""``finding`` with the plugin or advisory file its advisory comes from, when it
|
|
599
|
+
cites one."""
|
|
600
|
+
|
|
601
|
+
origin = origins.get((finding.metadata.get("advisory", ""), finding.metadata.get("package", "")))
|
|
602
|
+
if origin is None:
|
|
603
|
+
return finding
|
|
604
|
+
return replace(finding, metadata={**finding.metadata, "advisory_source": origin})
|
|
541
605
|
|
|
542
606
|
|
|
543
607
|
def _advisory_paths(root: Path, advisory_files: Sequence[Path]) -> tuple[Path, ...]:
|
|
@@ -623,15 +687,13 @@ def _analyse_batch(batch: _Batch) -> dict[str, dict[str, Any]]:
|
|
|
623
687
|
registry = load_plugins(batch.plugin_roots, next(iter(managers.values())))
|
|
624
688
|
all_plugins: tuple[Plugin, ...] = (*(loaded.plugin for loaded in registry), *batch.plugins)
|
|
625
689
|
dependencies = resolve_dependencies(batch.root, sources)
|
|
626
|
-
file_advisories: list[Advisory] = []
|
|
690
|
+
file_advisories: list[tuple[Path, tuple[Advisory, ...]]] = []
|
|
627
691
|
for path in batch.advisory_paths:
|
|
628
692
|
try:
|
|
629
|
-
file_advisories.
|
|
693
|
+
file_advisories.append((path, load_advisories(path)))
|
|
630
694
|
except AdvisoryFileError:
|
|
631
695
|
continue
|
|
632
|
-
advisories = _merge_advisories(
|
|
633
|
-
(a for plugin in all_plugins for a in plugin.advisories), file_advisories
|
|
634
|
-
)
|
|
696
|
+
advisories, _ = _merge_advisories(_contributions(registry, batch.plugins, batch.root, file_advisories))
|
|
635
697
|
affected = affected_symbols(dependencies, advisories)
|
|
636
698
|
models = plugin_models(all_plugins, batch.root).extended(*advisory_sinks(affected))
|
|
637
699
|
routes = _decode_routes(batch.routes)
|
|
@@ -663,7 +725,7 @@ def _decode_routes(data: tuple[tuple[str, str, str, int], ...]) -> dict[SymbolId
|
|
|
663
725
|
|
|
664
726
|
|
|
665
727
|
def _configuration_key(
|
|
666
|
-
|
|
728
|
+
components: Sequence[Component],
|
|
667
729
|
plugins: Sequence[Plugin],
|
|
668
730
|
models: ModelTable,
|
|
669
731
|
advisories: tuple[Advisory, ...],
|
|
@@ -679,10 +741,7 @@ def _configuration_key(
|
|
|
679
741
|
str(PYIR_SCHEMA_VERSION),
|
|
680
742
|
str(FINDING_SCHEMA_VERSION),
|
|
681
743
|
str(PLUGIN_API_VERSION),
|
|
682
|
-
*(
|
|
683
|
-
f"{loaded.manifest.name}={loaded.manifest.version}:{directory_fingerprint(loaded.directory)}"
|
|
684
|
-
for loaded in registry
|
|
685
|
-
),
|
|
744
|
+
*(f"{c.name}={c.version}:{c.digest}" for c in components if c.kind == PLUGIN),
|
|
686
745
|
*(f"{type(p).__module__}.{type(p).__qualname__}" for p in plugins),
|
|
687
746
|
repr(models),
|
|
688
747
|
repr(advisories),
|
|
@@ -776,6 +835,7 @@ def report(
|
|
|
776
835
|
root: Path | None = None,
|
|
777
836
|
suppressed: Sequence[Finding] = (),
|
|
778
837
|
baselined: Sequence[Finding] | None = None,
|
|
838
|
+
components: Sequence[Component] = (),
|
|
779
839
|
) -> Report:
|
|
780
840
|
"""The report of a check; paths under ``root`` are rendered relative to it.
|
|
781
841
|
``baselined`` is the findings a baseline accounts for, ``None`` when none applied."""
|
|
@@ -789,4 +849,5 @@ def report(
|
|
|
789
849
|
tuple(suppressed),
|
|
790
850
|
tuple(baselined or ()),
|
|
791
851
|
baselined is not None,
|
|
852
|
+
tuple(components),
|
|
792
853
|
)
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from coretrace_python.findings.coverage import Coverage, FileCoverage
|
|
4
4
|
from coretrace_python.findings.model import FINDING_SCHEMA_VERSION, Confidence, Finding, Severity
|
|
5
|
+
from coretrace_python.findings.provenance import ADVISORIES, PLUGIN, Component
|
|
5
6
|
|
|
6
7
|
__all__ = [
|
|
8
|
+
"ADVISORIES",
|
|
7
9
|
"FINDING_SCHEMA_VERSION",
|
|
10
|
+
"PLUGIN",
|
|
11
|
+
"Component",
|
|
8
12
|
"Confidence",
|
|
9
13
|
"Coverage",
|
|
10
14
|
"FileCoverage",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""What a result was produced with, besides the engine and the analysed sources.
|
|
2
|
+
|
|
3
|
+
Advisories decide the dependency findings and the VEX statements, and they come from
|
|
4
|
+
plugins and advisory files that change on their own schedule. A report names each of
|
|
5
|
+
them with the digest of its content, so a result can be traced to its data and
|
|
6
|
+
reproduced.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
|
|
13
|
+
PLUGIN = "plugin"
|
|
14
|
+
ADVISORIES = "advisories"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class Component:
|
|
19
|
+
"""A loaded plugin, by its manifest ``name`` and ``version``, or an advisory file, by
|
|
20
|
+
its path as ``name``. ``digest`` is ``sha256:`` and the hex digest of its content:
|
|
21
|
+
the plugin directory as the cache fingerprints it, or the file's bytes."""
|
|
22
|
+
|
|
23
|
+
kind: str
|
|
24
|
+
name: str
|
|
25
|
+
digest: str
|
|
26
|
+
version: str | None = None
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
6
|
|
|
7
|
-
from coretrace_python.findings import FINDING_SCHEMA_VERSION, Finding
|
|
7
|
+
from coretrace_python.findings import FINDING_SCHEMA_VERSION, Component, Finding
|
|
8
8
|
from coretrace_python.reporters.report import Report
|
|
9
9
|
|
|
10
10
|
|
|
@@ -28,11 +28,21 @@ def finding_record(finding: Finding, report: Report | None = None) -> dict[str,
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
def component_record(component: Component) -> dict[str, str]:
|
|
32
|
+
"""A plugin or advisory file the result was produced with; a file has no version."""
|
|
33
|
+
|
|
34
|
+
record = {"kind": component.kind, "name": component.name}
|
|
35
|
+
if component.version is not None:
|
|
36
|
+
record["version"] = component.version
|
|
37
|
+
record["digest"] = component.digest
|
|
38
|
+
return record
|
|
39
|
+
|
|
40
|
+
|
|
31
41
|
def render_json(report: Report) -> str:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
42
|
+
tool: dict[str, object] = {"name": report.tool_name, "version": report.tool_version}
|
|
43
|
+
if report.components:
|
|
44
|
+
tool["components"] = [component_record(component) for component in report.components]
|
|
45
|
+
document: dict[str, object] = {"schema_version": FINDING_SCHEMA_VERSION, "tool": tool}
|
|
36
46
|
if report.root is not None:
|
|
37
47
|
document["root"] = str(report.root)
|
|
38
48
|
document["findings"] = [finding_record(finding, report) for finding in report.findings]
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from pathlib import Path, PurePosixPath
|
|
7
7
|
|
|
8
|
-
from coretrace_python.findings import Coverage, Finding
|
|
8
|
+
from coretrace_python.findings import Component, Coverage, Finding
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def _order(finding: Finding) -> tuple[str, int, int, str]:
|
|
@@ -27,6 +27,8 @@ class Report:
|
|
|
27
27
|
baselined: tuple[Finding, ...] = ()
|
|
28
28
|
# Whether a baseline was applied, so new findings can be marked as such.
|
|
29
29
|
with_baseline: bool = False
|
|
30
|
+
# The plugins and advisory files the result was produced with.
|
|
31
|
+
components: tuple[Component, ...] = ()
|
|
30
32
|
|
|
31
33
|
def __post_init__(self) -> None:
|
|
32
34
|
for name in ("findings", "suppressed", "baselined"):
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
6
|
|
|
7
|
-
from coretrace_python.findings import Finding, Severity
|
|
7
|
+
from coretrace_python.findings import Component, Finding, Severity
|
|
8
8
|
from coretrace_python.reporters.report import Report
|
|
9
9
|
|
|
10
10
|
SARIF_VERSION = "2.1.0"
|
|
@@ -59,6 +59,16 @@ def _result(
|
|
|
59
59
|
return result
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
def _extension(component: Component) -> dict[str, object]:
|
|
63
|
+
"""A plugin or advisory file as a SARIF tool extension, its kind and digest as properties."""
|
|
64
|
+
|
|
65
|
+
extension: dict[str, object] = {"name": component.name}
|
|
66
|
+
if component.version is not None:
|
|
67
|
+
extension["version"] = component.version
|
|
68
|
+
extension["properties"] = {"kind": component.kind, "digest": component.digest}
|
|
69
|
+
return extension
|
|
70
|
+
|
|
71
|
+
|
|
62
72
|
def render_sarif(report: Report) -> str:
|
|
63
73
|
rule_ids: list[str] = []
|
|
64
74
|
for finding in (*report.findings, *report.suppressed, *report.baselined):
|
|
@@ -78,7 +88,8 @@ def render_sarif(report: Report) -> str:
|
|
|
78
88
|
{"id": rule_id, "shortDescription": {"text": rule_id}}
|
|
79
89
|
for rule_id in rule_ids
|
|
80
90
|
],
|
|
81
|
-
}
|
|
91
|
+
},
|
|
92
|
+
**({"extensions": [_extension(c) for c in report.components]} if report.components else {}),
|
|
82
93
|
},
|
|
83
94
|
"results": [
|
|
84
95
|
*(_result(report, f, rule_ids.index(f.rule_id), False, new) for f in report.findings),
|