codeaudit 1.7.0__tar.gz → 1.8.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.
- {codeaudit-1.7.0 → codeaudit-1.8.0}/CHANGELOG.md +45 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/PKG-INFO +32 -33
- {codeaudit-1.7.0 → codeaudit-1.8.0}/README.md +30 -32
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/CONTRIBUTE.md +2 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/_config.yml +1 -2
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/_toc.yml +1 -3
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/about.md +24 -14
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/architecture.md +7 -1
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/assert_check.md +4 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/dynamicimport_check.md +12 -2
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/exception_check.md +13 -3
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/cimode.md +47 -39
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/codeauditcommands.md +3 -2
- codeaudit-1.8.0/docs/examples/ca_api_example_basic.ipynb +352 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/codeauditchecks.html +222 -210
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/demoscan.json +2 -2
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/features.md +5 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/help.md +2 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/intro.md +11 -1
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/makeitbetter.md +73 -12
- {codeaudit-1.7.0 → codeaudit-1.8.0}/pyproject.toml +11 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/__about__.py +1 -1
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/altairplots.py +28 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/api_interfaces.py +17 -2
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/api_reporting.py +9 -17
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/corecli.py +4 -3
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/dashboard_reports.py +79 -1
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/data/sastchecks.csv +2 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/data/secretslist.txt +1 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/pypi_package_scan.py +55 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/reporting.py +34 -28
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/totals.py +2 -1
- codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp.html +295 -0
- codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp.js +91 -0
- codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp_171.html +295 -0
- codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp_171.js +91 -0
- codeaudit-1.8.0/src/dashboard/pyodide/deployed/dashboardapp_171.html +295 -0
- codeaudit-1.8.0/src/dashboard/pyodide/deployed/dashboardapp_171.js +91 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_correctexceptionuse.py +2 -1
- codeaudit-1.8.0/tests/test_importlib_util.py +29 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_modulecheck.py +16 -0
- codeaudit-1.8.0/tests/unit_tests/test_count_weaknesses.py +89 -0
- codeaudit-1.8.0/tests/validationfiles/codeaudit_scan.json +619 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/exception.py +29 -4
- codeaudit-1.8.0/tests/validationfiles/malware.py +13 -0
- codeaudit-1.8.0/tests/validationfiles/malwareAI.py +48 -0
- codeaudit-1.7.0/docs/astlines.md +0 -111
- codeaudit-1.7.0/docs/astlines2.md +0 -26
- codeaudit-1.7.0/docs/examples/ca_api_example_basic.ipynb +0 -725
- {codeaudit-1.7.0 → codeaudit-1.8.0}/.github/workflows/python-test.yml +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/.gitignore +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/CONTRIBUTE.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/LICENSE.txt +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/SECURITY.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/.gitignore +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/class_index.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/coverage_html_cb_dd2e7eb5.js +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/favicon_32_cb_c827f16f.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/function_index.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/index.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/keybd_closed_cb_900cfef5.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/status.json +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/style_cb_9ff733b0.css +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8___about___py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8___init___py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_altairplots_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_api_helpers_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_api_interfaces_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_api_reporting_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_checkmodules_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_codeaudit_dashboard_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_codeaudit_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_complexitycheck_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_dashboard_reports_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_filehelpfunctions_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_htmlhelpfunctions_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_issuevalidations_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_privacy_lint_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_pypi_package_scan_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_reporting_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_security_checks_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_suppression_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_totals_py.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/CLIcommands.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/_static/nocxstyle.css +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/apidocs/api_intro.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/apidocs/codeaudit.rst +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/apidocs/modules.rst +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/changelog.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/base64_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/binding_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/builtinfunctions_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/chmod_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/directorycreation_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/ftp_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/hash_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/httpserver_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/input_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/loggingconf_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/marshal_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/mktemp_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/multiprocessing_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/pickle_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/random_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/shelve_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/shutil_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/subprocess_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/syscalls_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/systemcalls_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/tarfile_extract_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/xml_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checks/zipfile_check.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/checksinformation.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/codeauditchecks.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/codeauditoverview.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/complexitycheck.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/data_egress_implementation.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/data_exfiltration_detection.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/ca_api_example_checks.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/ca_api_example_json.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/ca_api_example_overview.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/ca_api_example_scanning.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/ca_checks.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/demofile.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/directoryscan.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/example_risk_heatmap.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/example_weakness_perfile_view.ipynb +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/filescan.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/modulescan.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/examples/overview.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/filescan.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/filescan.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/handling_errors.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/howtoscan.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/OO.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/ROI_logo.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/YourLogoHere.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/ai_use.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/architecture_overview.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/codeauditlogo.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/filescan_screenshot_16012026.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/modulescan_screenshot_16012026.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/nocxbanner.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/overview_linkaudit.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/images/overview_screenshot_16012026.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/implementedvalidations.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/installation.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/issues.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/license.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/markingissues.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/modulescan.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/overviewplot.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/pca_overview.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/project_philosophy.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/sponsors.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/userguide.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/warnings.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/whatissast.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/docs/whysast.md +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/filescan.png +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/__init__.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/api_helpers.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/checkmodules.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/ci_workflowscan.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/complexitycheck.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/filehelpfunctions.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/htmlhelpfunctions.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/issuevalidations.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/privacy_lint.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/security_checks.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/simple.css +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/codeaudit/suppression.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/__init__.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/dashboardapp.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/module_load_validation.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/module_load_validation2.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/dashboardapp_version166.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/dashboardapp_version166.js +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp.js +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version162.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version162.js +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version166.html +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version166.js +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/src/dashboard/requirements.txt +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/__init__.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/count_lines_file1.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/clean.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/elastic.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/example1.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/klyne.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/mixed.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/telemetry.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/spytestdir/telemetryfile2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/suppression/sastsuppression_0.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/suppression/sastsuppression_1.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/suppression/sastsuppression_2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_apicalls.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_apicalls2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_base64.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_basicpatterns.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_chmod.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_constructspart2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_count_commentlines.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_directorycreation.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_directorycreation2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_dynamic_import.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_edgecases.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_ftp.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_hashstrenght.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_obfuscatingbuiltins.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_oschecks.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_pylintreport.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_pypiscan.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_random.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_secretfinding.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_standardlibconstructs.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_subprocess.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_suppression.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_suppressionlogic.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_totalscheck.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_wasmsafe_funtions.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/test_zstd.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/unit_tests/__init__.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/unit_tests/test_collectsourcefiles.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/unit_tests/test_filehelpfunctions.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/unit_tests/test_readinsourcefile.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/allshit.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/apivalidations.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/assert.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/base64.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/chmod_things.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/complexitycheck.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/correctcounts.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/danger_imports.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/directorycreation.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/directorycreation2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/dunderexec_with_parsing_error.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/eval.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/eval2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/file3.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/file_with_warnings.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/ftp.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/gzip.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/hashcheck.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/httpserver.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/inputstatement.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/marshal.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/modulecheck.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/multiprocessing.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/obfuscating.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/oschecks.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/pickle.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/python2_file_willnotwork.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/random.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/shelve.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/shutil.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/subprocess.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/syslibrary.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/tarfilevalidation.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/tempcheck.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/validation1.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/validation2.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/xml.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/zipfile.py +0 -0
- {codeaudit-1.7.0 → codeaudit-1.8.0}/tests/validationfiles/zstd.py +0 -0
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## Version 1.8.0:
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
**Added**
|
|
7
|
+
|
|
8
|
+
* **Security Checks:** Added checks for `importlib.util.spec_from_file_location` and `importlib.util.module_from_spec` to mitigate recent CVE-2026-40156 vulnerabilities.
|
|
9
|
+
* **Configuration:** Added `[tool.pytest]` section to `pyproject.toml`.
|
|
10
|
+
|
|
11
|
+
**Changed**
|
|
12
|
+
|
|
13
|
+
* **CLD Output for checks overview:** Sorted the `codeaudit` checks output now alphabetically by `Name`.
|
|
14
|
+
* **Security:** Updated the secret list used for egress detection.
|
|
15
|
+
|
|
16
|
+
**Fixed**
|
|
17
|
+
|
|
18
|
+
* **Configuration:** Added the missing `homepage` field under `[project.urls]` in `pyproject.toml`.
|
|
19
|
+
|
|
20
|
+
**Documentation**
|
|
21
|
+
|
|
22
|
+
* **CLI Help:** Added help documentation for the CI command (`cimode`). *Big thanks to @jurgenwigg for [pull request #25](https://github.com/nocomplexity/codeaudit/pull/25)!*
|
|
23
|
+
|
|
24
|
+
## Version 1.7.1:
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
**Added**
|
|
28
|
+
|
|
29
|
+
* **PyPI Update Indicator:** Added an indicator for the last update of PyPI packages, implemented for both the CLI version and the Dashboard version.
|
|
30
|
+
* **Test Coverage:** Added extra tests to improve codebase stability.
|
|
31
|
+
* **Dashboard Overview (WASM version):** The total number of weaknesses is now displayed directly in the overview tab.
|
|
32
|
+
|
|
33
|
+
**Changed**
|
|
34
|
+
|
|
35
|
+
* **CLI Report Optimization (Modules):** The CLI report now only displays modules when they are actually found.
|
|
36
|
+
* **CLI Report Optimization (Tips):** The CLI report now only displays the tip to check external modules for vulnerabilities if vulnerabilities are actually present in a file.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
**Fixed**
|
|
40
|
+
|
|
41
|
+
* **Windows 11 Compatibility:** Fixed an issue to ensure `codeaudit overview` works properly on Windows 11, specifically resolving a bug in the `count_lines_iterate` function.
|
|
42
|
+
* **Altair Visuals:** Fixed stability issues with the Altair Visual overview in the `codeaudit overview` section, making it stable again.
|
|
43
|
+
|
|
44
|
+
**Documentation**
|
|
45
|
+
|
|
46
|
+
* General documentation updates and minor fixes.
|
|
47
|
+
|
|
3
48
|
## Version 1.7.0:
|
|
4
49
|
|
|
5
50
|
**Added**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeaudit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
4
4
|
Summary: A modern Python security source code analyzer (SAST) based on distrust.
|
|
5
|
+
Project-URL: Homepage, https://codeaudit.nocomplexity.com
|
|
5
6
|
Project-URL: Documentation, https://github.com/nocomplexity/codeaudit#readme
|
|
6
7
|
Project-URL: Issues, https://github.com/nocomplexity/codeaudit/issues
|
|
7
8
|
Project-URL: Source, https://github.com/nocomplexity/codeaudit
|
|
@@ -44,17 +45,17 @@ Description-Content-Type: text/markdown
|
|
|
44
45
|
[](https://nocomplexity.com/documents/codeaudit/license.html)
|
|
45
46
|
[](https://pepy.tech/projects/codeaudit)
|
|
46
47
|
|
|
47
|
-
Python Code Audit - A modern Python source code analyzer based on distrust.
|
|
48
|
-
|
|
49
|
-
Python Code Audit is a tool to find **security weaknesses** in Python code. This static application security testing (SAST) tool has **great** features to simplify the necessary security tasks and make it fun and easy.
|
|
48
|
+
Python Code Audit - A modern Python security source code analyzer based on distrust.
|
|
50
49
|
|
|
50
|
+
Python Code Audit is a static application security testing (SAST) tool designed to identify **security weaknesses** in Python source code. It combines **powerful analysis features** with an intuitive workflow, making essential security audits both simple and engaging.
|
|
51
51
|
|
|
52
52
|
This tool is designed for anyone who uses or creates Python programs and wants to understand and mitigate potential security risks.
|
|
53
53
|
|
|
54
54
|
This tool is created for:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
|
|
56
|
+
- Python Users who want to assess the security risks in the Python code they use.
|
|
57
|
+
- Python Developers: Anyone, from professionals to hobbyists, who wants to deliver secure Python code.
|
|
58
|
+
- Security-Conscious Users: People seeking a simple, fast way to gain insight into potential security vulnerabilities within Python packages or files.
|
|
58
59
|
|
|
59
60
|
Creating secure software can be challenging. This tool, with its comprehensive [documentation](https://nocomplexity.com/documents/codeaudit/intro.html), acts as your helpful security colleague, making it easier to identify and address vulnerabilities.
|
|
60
61
|
|
|
@@ -62,39 +63,41 @@ Creating secure software can be challenging. This tool, with its comprehensive [
|
|
|
62
63
|
|
|
63
64
|
Python Code Audit has the following features:
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
|
|
68
|
-
|
|
69
|
-
* **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
|
|
66
|
+
- **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
- **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
|
|
72
69
|
|
|
70
|
+
- **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
- **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
|
|
75
73
|
|
|
74
|
+
- **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
- **CI/CD Ready:** Integrates seamlessly into any CI/CD workflow.
|
|
79
77
|
|
|
78
|
+
- **HTML Reports**: All output is saved in simple, static HTML reports viewable in any browser.
|
|
80
79
|
|
|
81
80
|
> [!NOTE]
|
|
82
81
|
> Python Code Audit uses the Python's Abstract Syntax Tree (AST) to get robust and reliable result. Using the Python AST makes contextual Vulnerability Detection possible and false positive are minimized.
|
|
83
82
|
|
|
84
|
-
|
|
85
83
|
## Installation
|
|
86
84
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
> [!TIP]
|
|
86
|
+
> Try it instantly—no installs, no setup, no excuses.
|
|
87
|
+
>
|
|
88
|
+
> 👉 Launch the browser version [here](https://nocomplexity.com/codeauditapp/dashboardapp.html)
|
|
90
89
|
|
|
91
|
-
|
|
90
|
+
It runs 100% locally in your browser using WebAssembly (WASM). See the power of the tool in under 60 seconds.
|
|
91
|
+
No downloads. No dependencies. Just click and do a security audit on Python Code.
|
|
92
92
|
|
|
93
|
+
Loved the browser version? Unlock the full power. For advanced security code inspections, CI/CD integration, and all professional features, install the complete Python package:
|
|
93
94
|
|
|
95
|
+
```console
|
|
96
|
+
pip install -U codeaudit
|
|
97
|
+
```
|
|
94
98
|
|
|
95
99
|
If you have installed **Python Code Audit** previously and want to ensure you are using the latest validations and features, simply run this command again. Python Code Audit is frequently updated with new checks.
|
|
96
100
|
|
|
97
|
-
|
|
98
101
|
## Usage
|
|
99
102
|
|
|
100
103
|
After installation you can get an overview of all implemented commands. Just type in your terminal:
|
|
@@ -107,7 +110,7 @@ This will show all commands:
|
|
|
107
110
|
|
|
108
111
|
```text
|
|
109
112
|
----------------------------------------------------
|
|
110
|
-
_ __ _
|
|
113
|
+
_ __ _
|
|
111
114
|
|_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
|
|
112
115
|
| / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
|
|
113
116
|
----------------------------------------------------
|
|
@@ -116,13 +119,14 @@ Python Code Audit - A modern Python security source code analyzer based on distr
|
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
Commands to evaluate Python source code:
|
|
119
|
-
Usage: codeaudit COMMAND <directory|package> [report.html]
|
|
122
|
+
Usage: codeaudit COMMAND <directory|package> [report.html]
|
|
120
123
|
|
|
121
124
|
Depending on the command, you must specify a local directory, a Python file, or a package name hosted on PyPI.org.Reporting: The results are generated as a static HTML report for viewing in a web browser.
|
|
122
125
|
|
|
123
126
|
Commands:
|
|
124
127
|
overview Generates an overview report of code complexity and security indicators.
|
|
125
128
|
filescan Scans Python source code or PyPI packages for security weaknesses.
|
|
129
|
+
cimode Run a SAST scan for CI workflows.
|
|
126
130
|
modulescan Generate a report on known vulnerabilities in Python modules and packages.
|
|
127
131
|
checks Creates an HTML report of all implemented security checks.
|
|
128
132
|
version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
|
|
@@ -132,7 +136,7 @@ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to
|
|
|
132
136
|
|
|
133
137
|
## Example
|
|
134
138
|
|
|
135
|
-
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **
|
|
139
|
+
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **89 validations** implemented.
|
|
136
140
|
|
|
137
141
|
The `codeaudit filescan` command shows all **potential** security issues that are detected in the source file in a HTML-report.
|
|
138
142
|
|
|
@@ -154,19 +158,17 @@ Paste the line below directly into your browser bar:
|
|
|
154
158
|
|
|
155
159
|

|
|
156
160
|
|
|
157
|
-
|
|
158
161
|
## Contributing
|
|
159
162
|
|
|
160
163
|
All contributions are welcome! Think of corrections on the documentation, code or more and better tests.
|
|
161
164
|
|
|
162
165
|
Simple Guidelines:
|
|
163
166
|
|
|
164
|
-
|
|
167
|
+
- Questions, Feature Requests, Bug Reports please use on the Github Issue Tracker.
|
|
165
168
|
|
|
166
|
-
**Pull Requests are welcome!**
|
|
167
|
-
|
|
168
|
-
When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
|
|
169
|
+
**Pull Requests are welcome!**
|
|
169
170
|
|
|
171
|
+
When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
|
|
170
172
|
|
|
171
173
|
> [!NOTE]
|
|
172
174
|
> This is an open community driven project. Contributors will be mentioned in the [documentation](https://nocomplexity.com/documents/codeaudit/intro.html).
|
|
@@ -175,7 +177,4 @@ We adopt the [Collective Code Construction Contract(C4)](https://rfc.zeromq.org/
|
|
|
175
177
|
|
|
176
178
|
## License
|
|
177
179
|
|
|
178
|
-
|
|
179
180
|
`codeaudit` is distributed under the terms of the [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) license.
|
|
180
|
-
|
|
181
|
-
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
[](https://nocomplexity.com/documents/codeaudit/license.html)
|
|
11
11
|
[](https://pepy.tech/projects/codeaudit)
|
|
12
12
|
|
|
13
|
-
Python Code Audit - A modern Python source code analyzer based on distrust.
|
|
14
|
-
|
|
15
|
-
Python Code Audit is a tool to find **security weaknesses** in Python code. This static application security testing (SAST) tool has **great** features to simplify the necessary security tasks and make it fun and easy.
|
|
13
|
+
Python Code Audit - A modern Python security source code analyzer based on distrust.
|
|
16
14
|
|
|
15
|
+
Python Code Audit is a static application security testing (SAST) tool designed to identify **security weaknesses** in Python source code. It combines **powerful analysis features** with an intuitive workflow, making essential security audits both simple and engaging.
|
|
17
16
|
|
|
18
17
|
This tool is designed for anyone who uses or creates Python programs and wants to understand and mitigate potential security risks.
|
|
19
18
|
|
|
20
19
|
This tool is created for:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
|
|
21
|
+
- Python Users who want to assess the security risks in the Python code they use.
|
|
22
|
+
- Python Developers: Anyone, from professionals to hobbyists, who wants to deliver secure Python code.
|
|
23
|
+
- Security-Conscious Users: People seeking a simple, fast way to gain insight into potential security vulnerabilities within Python packages or files.
|
|
24
24
|
|
|
25
25
|
Creating secure software can be challenging. This tool, with its comprehensive [documentation](https://nocomplexity.com/documents/codeaudit/intro.html), acts as your helpful security colleague, making it easier to identify and address vulnerabilities.
|
|
26
26
|
|
|
@@ -28,39 +28,41 @@ Creating secure software can be challenging. This tool, with its comprehensive [
|
|
|
28
28
|
|
|
29
29
|
Python Code Audit has the following features:
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
|
|
34
|
-
|
|
35
|
-
* **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
|
|
31
|
+
- **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
- **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
|
|
38
34
|
|
|
35
|
+
- **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
- **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
|
|
41
38
|
|
|
39
|
+
- **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
- **CI/CD Ready:** Integrates seamlessly into any CI/CD workflow.
|
|
45
42
|
|
|
43
|
+
- **HTML Reports**: All output is saved in simple, static HTML reports viewable in any browser.
|
|
46
44
|
|
|
47
45
|
> [!NOTE]
|
|
48
46
|
> Python Code Audit uses the Python's Abstract Syntax Tree (AST) to get robust and reliable result. Using the Python AST makes contextual Vulnerability Detection possible and false positive are minimized.
|
|
49
47
|
|
|
50
|
-
|
|
51
48
|
## Installation
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
> [!TIP]
|
|
51
|
+
> Try it instantly—no installs, no setup, no excuses.
|
|
52
|
+
>
|
|
53
|
+
> 👉 Launch the browser version [here](https://nocomplexity.com/codeauditapp/dashboardapp.html)
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
It runs 100% locally in your browser using WebAssembly (WASM). See the power of the tool in under 60 seconds.
|
|
56
|
+
No downloads. No dependencies. Just click and do a security audit on Python Code.
|
|
58
57
|
|
|
58
|
+
Loved the browser version? Unlock the full power. For advanced security code inspections, CI/CD integration, and all professional features, install the complete Python package:
|
|
59
59
|
|
|
60
|
+
```console
|
|
61
|
+
pip install -U codeaudit
|
|
62
|
+
```
|
|
60
63
|
|
|
61
64
|
If you have installed **Python Code Audit** previously and want to ensure you are using the latest validations and features, simply run this command again. Python Code Audit is frequently updated with new checks.
|
|
62
65
|
|
|
63
|
-
|
|
64
66
|
## Usage
|
|
65
67
|
|
|
66
68
|
After installation you can get an overview of all implemented commands. Just type in your terminal:
|
|
@@ -73,7 +75,7 @@ This will show all commands:
|
|
|
73
75
|
|
|
74
76
|
```text
|
|
75
77
|
----------------------------------------------------
|
|
76
|
-
_ __ _
|
|
78
|
+
_ __ _
|
|
77
79
|
|_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
|
|
78
80
|
| / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
|
|
79
81
|
----------------------------------------------------
|
|
@@ -82,13 +84,14 @@ Python Code Audit - A modern Python security source code analyzer based on distr
|
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
Commands to evaluate Python source code:
|
|
85
|
-
Usage: codeaudit COMMAND <directory|package> [report.html]
|
|
87
|
+
Usage: codeaudit COMMAND <directory|package> [report.html]
|
|
86
88
|
|
|
87
89
|
Depending on the command, you must specify a local directory, a Python file, or a package name hosted on PyPI.org.Reporting: The results are generated as a static HTML report for viewing in a web browser.
|
|
88
90
|
|
|
89
91
|
Commands:
|
|
90
92
|
overview Generates an overview report of code complexity and security indicators.
|
|
91
93
|
filescan Scans Python source code or PyPI packages for security weaknesses.
|
|
94
|
+
cimode Run a SAST scan for CI workflows.
|
|
92
95
|
modulescan Generate a report on known vulnerabilities in Python modules and packages.
|
|
93
96
|
checks Creates an HTML report of all implemented security checks.
|
|
94
97
|
version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
|
|
@@ -98,7 +101,7 @@ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to
|
|
|
98
101
|
|
|
99
102
|
## Example
|
|
100
103
|
|
|
101
|
-
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **
|
|
104
|
+
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **89 validations** implemented.
|
|
102
105
|
|
|
103
106
|
The `codeaudit filescan` command shows all **potential** security issues that are detected in the source file in a HTML-report.
|
|
104
107
|
|
|
@@ -120,19 +123,17 @@ Paste the line below directly into your browser bar:
|
|
|
120
123
|
|
|
121
124
|

|
|
122
125
|
|
|
123
|
-
|
|
124
126
|
## Contributing
|
|
125
127
|
|
|
126
128
|
All contributions are welcome! Think of corrections on the documentation, code or more and better tests.
|
|
127
129
|
|
|
128
130
|
Simple Guidelines:
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
- Questions, Feature Requests, Bug Reports please use on the Github Issue Tracker.
|
|
131
133
|
|
|
132
|
-
**Pull Requests are welcome!**
|
|
133
|
-
|
|
134
|
-
When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
|
|
134
|
+
**Pull Requests are welcome!**
|
|
135
135
|
|
|
136
|
+
When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
|
|
136
137
|
|
|
137
138
|
> [!NOTE]
|
|
138
139
|
> This is an open community driven project. Contributors will be mentioned in the [documentation](https://nocomplexity.com/documents/codeaudit/intro.html).
|
|
@@ -141,7 +142,4 @@ We adopt the [Collective Code Construction Contract(C4)](https://rfc.zeromq.org/
|
|
|
141
142
|
|
|
142
143
|
## License
|
|
143
144
|
|
|
144
|
-
|
|
145
145
|
`codeaudit` is distributed under the terms of the [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) license.
|
|
146
|
-
|
|
147
|
-
|
|
@@ -22,6 +22,8 @@ These are all activities we’d like to get help with :
|
|
|
22
22
|
- Website design and development
|
|
23
23
|
:::
|
|
24
24
|
|
|
25
|
+
Or just make a [donation](donate-label)!
|
|
26
|
+
|
|
25
27
|
The **Codeaudit** code repository is hosted at [Github](https://github.com/nocomplexity/codeaudit).
|
|
26
28
|
|
|
27
29
|
Simple Guidelines:
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
# Created by Maikel Mardjan (nocomplexity.com)
|
|
5
5
|
#######################################################################################
|
|
6
6
|
# Book settings
|
|
7
|
-
#title : SimplifiedNLP Documentation # The title of the book. Will be placed in the left navbar.
|
|
8
7
|
title : ""
|
|
9
|
-
author : '<a href="https://nocomplexity.com/">Maikel Mardjan (nocomplexity.com)</a> and all contributors.'
|
|
8
|
+
author : '<a href="https://nocomplexity.com/">Maikel Mardjan (nocomplexity.com)</a> and all contributors.'
|
|
10
9
|
copyright : '2025- Maikel Mardjan - Business Management Support Foundation' # Copyright year to be placed in the footer
|
|
11
10
|
logo : "images/nocxbanner.png" # A path to the book logo
|
|
12
11
|
# Patterns to skip when building the book. Can be glob-style (e.g. "*skip.ipynb")
|
|
@@ -19,14 +19,14 @@ Currently, I lead initiatives at NoComplexity.com, an innovative IT company focu
|
|
|
19
19
|
:gutter: 3
|
|
20
20
|
|
|
21
21
|
:::{grid-item-card}
|
|
22
|
-
:link: https://nocomplexity.com/
|
|
22
|
+
:link: https://securitytesting.nocomplexity.com/
|
|
23
23
|
:link-type: url
|
|
24
|
-
{octicon}`book;2em;caption-text` **
|
|
24
|
+
{octicon}`book;2em;caption-text` **Mastering Security Testing for Python**
|
|
25
25
|
^^^
|
|
26
|
-
|
|
27
|
-
Use this Playbook to create better and faster security solutions for your security use case.
|
|
26
|
+
Gain a deep understanding of the methodologies and specialised tools to conduct security validation for Python applications.
|
|
28
27
|
:::
|
|
29
28
|
|
|
29
|
+
|
|
30
30
|
:::{grid-item-card}
|
|
31
31
|
:link: http://securitybydesign.nocomplexity.com/
|
|
32
32
|
:link-type: url
|
|
@@ -37,31 +37,32 @@ Master the topic quickly with this eBook.
|
|
|
37
37
|
:::
|
|
38
38
|
|
|
39
39
|
:::{grid-item-card}
|
|
40
|
-
:link: https://nocomplexity.com/documents/
|
|
40
|
+
:link: https://nocomplexity.com/documents/reports/SimplifySecurity.pdf
|
|
41
41
|
:link-type: url
|
|
42
|
-
{octicon}`book;2em;caption-text` **
|
|
42
|
+
{octicon}`book;2em;caption-text` **Simplify Cyber Manifest**
|
|
43
43
|
^^^
|
|
44
|
-
|
|
44
|
+
A manifesto to revolutionize cybersecurity through simplification.
|
|
45
45
|
:::
|
|
46
46
|
|
|
47
|
+
|
|
47
48
|
:::{grid-item-card}
|
|
48
|
-
:link: https://nocomplexity.
|
|
49
|
+
:link: https://nocomplexity.github.io/pythonsecurity/
|
|
49
50
|
:link-type: url
|
|
50
|
-
{octicon}`book;2em;caption-text` **
|
|
51
|
+
{octicon}`book;2em;caption-text` **Python Security Handbook**
|
|
51
52
|
^^^
|
|
52
|
-
|
|
53
|
+
This book will give you a deep understanding of how to develop secure Python applications. It also equips you with the knowledge needed to assess the security of Python code written by others.
|
|
53
54
|
:::
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
:::{grid-item-card}
|
|
57
|
-
:link: https://nocomplexity.com/documents/
|
|
58
|
+
:link: https://nocomplexity.com/documents/securityarchitecture/introduction.html
|
|
58
59
|
:link-type: url
|
|
59
|
-
{octicon}`book;2em;caption-text` **
|
|
60
|
+
{octicon}`book;2em;caption-text` **Open Security Reference Architecture**
|
|
60
61
|
^^^
|
|
61
|
-
|
|
62
|
+
Cyber security can still be simple and effective.
|
|
63
|
+
Use this Playbook to create better and faster security solutions for your security use case.
|
|
62
64
|
:::
|
|
63
65
|
|
|
64
|
-
|
|
65
66
|
:::{grid-item-card}
|
|
66
67
|
:link: https://nocomplexity.com/documents/simplifyprivacy/intro.html
|
|
67
68
|
:link-type: url
|
|
@@ -71,6 +72,15 @@ This digital Playbook is all about protecting *your* digital privacy.
|
|
|
71
72
|
:::
|
|
72
73
|
|
|
73
74
|
|
|
75
|
+
:::{grid-item-card}
|
|
76
|
+
:link: https://nocomplexity.com/documents/securitysolutions/intro.html
|
|
77
|
+
:link-type: url
|
|
78
|
+
{octicon}`book;2em;caption-text` **Open Security Solutions**
|
|
79
|
+
^^^
|
|
80
|
+
Given the vast array of FOSS cybersecurity products available, this publication offers a handcrafted curated selection.
|
|
81
|
+
:::
|
|
82
|
+
|
|
83
|
+
|
|
74
84
|
::::
|
|
75
85
|
% End of Cards grid
|
|
76
86
|
|
|
@@ -56,13 +56,19 @@ We focus on delivering a simple, trustworthy security tool that performs its def
|
|
|
56
56
|
|
|
57
57
|
The following design choices have been made for Python Code Audit:
|
|
58
58
|
|
|
59
|
-
* **The Python AST library is used
|
|
59
|
+
* **The Python AST library is used to determine weaknesses and perform code validation.**
|
|
60
60
|
* **Rationale:** As we are creating a Python-specific security checker, using the `ast` module provides **significant** advantages:
|
|
61
61
|
1. Code is not executed during examination, which is a major benefit when validating potentially malicious code.
|
|
62
62
|
2. Implementing basic checks using complex regex patterns would make the code and its maintenance unnecessarily difficult.
|
|
63
63
|
3. Users can add extra validations in a simple, straightforward manner.
|
|
64
|
+
|
|
65
|
+
+++
|
|
66
|
+
|
|
64
67
|
* **Python Code Audit is not designed for identifying weaknesses in web applications.**
|
|
65
68
|
* **Rationale:** We check Python source code, but do not perform XSS or SQL injection checks. Every Python web application **should** use a battle-tested FOSS framework that prevents these vulnerabilities by design. Testing for these would require building a fuzzer rather than a static code scanner. There are other tools that **must** always be used for validating web applications.
|
|
69
|
+
|
|
70
|
+
+++
|
|
71
|
+
|
|
66
72
|
* **Postpone code performance optimisations until truly necessary.**
|
|
67
73
|
* **Rationale:** We aim for a loosely coupled architecture of key functions; performance optimisations can be introduced at a later stage if required. In practice, performance optimisations are rarely needed. Most time will be spent by humans analysing results before deciding whether to use a Python package, or making security improvements to their own code. The baseline performance for scanning a 10MB Python package should be the priority.
|
|
68
74
|
* **Implication:** Ensure that performance optimisations can be applied later to specific functional blocks if they are found to be causing bottlenecks for users.
|
|
@@ -129,3 +129,7 @@ For robust validation and error handling in production code, always use standard
|
|
|
129
129
|
* [The assert statement - Python Documentation](https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement)
|
|
130
130
|
* [The dangers of assert in Python](https://snyk.io/blog/the-dangers-of-assert-in-python/)
|
|
131
131
|
* [Feature: Python assert should be consider harmful](https://community.sonarsource.com/t/feature-python-assert-should-be-consider-harmful/38501) But note that Sonar did not implement this check.
|
|
132
|
+
* [CVE-2017-1000433](https://nvd.nist.gov/vuln/detail/CVE-2017-1000433) and see the related [issues/451](https://github.com/IdentityPython/pysaml2/issues/451)
|
|
133
|
+
* [Advisory: pysaml2 Improper Authentication vulnerability](https://github.com/advisories/GHSA-924m-4pmx-c67h)
|
|
134
|
+
|
|
135
|
+
* [Rethinking Python Asserts in SAST](https://nocomplexity.com/python-asserts/)
|
|
@@ -6,7 +6,8 @@ Especially if you can not validate upfront what is imported.
|
|
|
6
6
|
Python Code Audit checks on:
|
|
7
7
|
* `__import__`: This builtin function SHOULD never be used anymore. This is an advanced function that is not needed in everyday Python programming.
|
|
8
8
|
* `importlib.import_module` use. Using this function should be validated upfront.
|
|
9
|
-
|
|
9
|
+
* `importlib.util.spec_from_file_location`
|
|
10
|
+
* `importlib.util.module_from_spec`
|
|
10
11
|
|
|
11
12
|
Using the dynamic imports can be a potential security issue, especially when the module name comes from an untrusted source. Often modules are fetches from internet or are imported by cleaver user input constructs in the code. But an attacker could also import the `os` module and then find a way to call functions to run commands on the system.
|
|
12
13
|
|
|
@@ -26,6 +27,10 @@ This offers a better way to handle dynamic imports. Avoid using `__import__`.
|
|
|
26
27
|
|
|
27
28
|
* Using `importlib.import_module()` keeps dynamic import logic contained within the `importlib module`, which is maintained by the core Python developers. This is from a security point of view preferred over directly using the low-level built-in function `__import__`.
|
|
28
29
|
|
|
30
|
+
* Using `importlib.util.spec_from_file_location()` in combination with `importlib.util.module_from_spec` can bypass the normal Python import mechanism and allow arbitrary Python files to be executed.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
## Mitigation
|
|
30
35
|
|
|
31
36
|
There is always a security risk when `importlib.import_module()` is used.
|
|
@@ -37,6 +42,11 @@ Possible mitigations:
|
|
|
37
42
|
* If you do not trust it: Call a security expert to help you! See the [sponsor](../sponsors) page for companies that could help you!
|
|
38
43
|
|
|
39
44
|
|
|
45
|
+
While `importlib.util.spec_from_file_location` is frequently seen in legacy plugin systems, it carries substantial security risks. Modern Python plugin architectures provide much safer mechanisms to prevent the execution of arbitrary files from untrusted locations.
|
|
46
|
+
|
|
47
|
+
|
|
40
48
|
## References
|
|
41
49
|
|
|
42
|
-
* https://docs.python.org/3/library/functions.html#import__
|
|
50
|
+
* https://docs.python.org/3/library/functions.html#import__
|
|
51
|
+
* [CVE-2026-40156](https://nvd.nist.gov/vuln/detail/CVE-2026-40156) and see all [details](https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-2g3w-cpc4-chr4).
|
|
52
|
+
* [Python Security Handbook](https://nocomplexity.github.io/pythonsecurity/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Exception Statements
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Python Code Audit detects the use of `pass` within an `except` block.
|
|
4
4
|
|
|
5
5
|
The Python pattern:
|
|
6
6
|
```python
|
|
@@ -10,7 +10,7 @@ except Exception:
|
|
|
10
10
|
pass
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Presents potential security risks due to:
|
|
14
14
|
- **Overly broad exception handling** – catching `Exception` masks virtually all errors
|
|
15
15
|
- **Silent failure** – using `pass` suppresses all evidence that something went wrong
|
|
16
16
|
|
|
@@ -21,10 +21,16 @@ This security concern also applies when using `continue` inside an exception blo
|
|
|
21
21
|
- `pass` statements in exception clauses
|
|
22
22
|
- `continue` statements in exception clauses
|
|
23
23
|
|
|
24
|
+
:::{important}
|
|
25
|
+
Treat the detection of `pass` and `continue` in exception handlers as a **signal** rather than proof of a security issue. Always examine whether the exception handler catches exceptions that are too broad (for example, `except:` or `except Exception:`).
|
|
26
|
+
|
|
27
|
+
No static analysis tool can determine with 100% confidence whether a particular exception handler represents a security risk. Due to Python's dynamic nature. The intent of the code, the surrounding context, and the runtime behavior all influence whether suppressing an exception is appropriate.
|
|
28
|
+
:::
|
|
29
|
+
|
|
24
30
|
|
|
25
31
|
## Background
|
|
26
32
|
|
|
27
|
-
Checking exception statements in Python code for possible security issues should be done.
|
|
33
|
+
Checking exception statements in Python code for possible security issues should always be done.
|
|
28
34
|
Reasons are e.g.:
|
|
29
35
|
|
|
30
36
|
1. **Masking of Critical Errors and Vulnerabilities:**
|
|
@@ -66,8 +72,11 @@ Reasons are e.g.:
|
|
|
66
72
|
# Optionally, re-raise the exception if the program cannot continue meaningfully
|
|
67
73
|
# raise
|
|
68
74
|
```
|
|
75
|
+
|
|
69
76
|
* **Avoid `pass`:** Only use `pass` if the exception is truly expected and handling it means doing nothing, and you have documented why that's the case. Such scenarios are rare.
|
|
77
|
+
|
|
70
78
|
* **Use `finally` for Cleanup:** If resources need to be released regardless of whether an exception occurs, use a `finally` block or context managers (`with` statements).
|
|
79
|
+
|
|
71
80
|
```python
|
|
72
81
|
try:
|
|
73
82
|
f = open("my_file.txt", "r")
|
|
@@ -92,3 +101,4 @@ Reasons are e.g.:
|
|
|
92
101
|
## More info
|
|
93
102
|
|
|
94
103
|
* [CWE-703: Improper Check or Handling of Exceptional Conditions](https://cwe.mitre.org/data/definitions/703.html)
|
|
104
|
+
* [Python Security Handbook, Exception Statements](https://nocomplexity.github.io/pythonsecurity/constructs/exceptions/)
|