codeaudit 1.7.1__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.
Files changed (262) hide show
  1. {codeaudit-1.7.1 → codeaudit-1.8.0}/CHANGELOG.md +21 -0
  2. {codeaudit-1.7.1 → codeaudit-1.8.0}/PKG-INFO +21 -31
  3. {codeaudit-1.7.1 → codeaudit-1.8.0}/README.md +19 -30
  4. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/_config.yml +1 -2
  5. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/dynamicimport_check.md +12 -2
  6. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/exception_check.md +13 -3
  7. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/cimode.md +45 -37
  8. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/codeauditcommands.md +3 -2
  9. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/codeauditchecks.html +221 -209
  10. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/demoscan.json +2 -2
  11. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/intro.md +1 -1
  12. {codeaudit-1.7.1 → codeaudit-1.8.0}/pyproject.toml +11 -0
  13. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/__about__.py +1 -1
  14. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/corecli.py +4 -3
  15. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/data/sastchecks.csv +2 -0
  16. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/data/secretslist.txt +1 -0
  17. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/reporting.py +1 -1
  18. codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp.html +295 -0
  19. codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp.js +91 -0
  20. codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp_171.html +295 -0
  21. codeaudit-1.8.0/src/dashboard/pyodide/dashboardapp_171.js +91 -0
  22. codeaudit-1.8.0/src/dashboard/pyodide/deployed/dashboardapp_171.html +295 -0
  23. codeaudit-1.8.0/src/dashboard/pyodide/deployed/dashboardapp_171.js +91 -0
  24. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_correctexceptionuse.py +2 -1
  25. codeaudit-1.8.0/tests/test_importlib_util.py +29 -0
  26. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/exception.py +29 -4
  27. codeaudit-1.8.0/tests/validationfiles/malwareAI.py +48 -0
  28. {codeaudit-1.7.1 → codeaudit-1.8.0}/.github/workflows/python-test.yml +0 -0
  29. {codeaudit-1.7.1 → codeaudit-1.8.0}/.gitignore +0 -0
  30. {codeaudit-1.7.1 → codeaudit-1.8.0}/CONTRIBUTE.md +0 -0
  31. {codeaudit-1.7.1 → codeaudit-1.8.0}/LICENSE.txt +0 -0
  32. {codeaudit-1.7.1 → codeaudit-1.8.0}/SECURITY.md +0 -0
  33. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/.gitignore +0 -0
  34. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/class_index.html +0 -0
  35. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/coverage_html_cb_dd2e7eb5.js +0 -0
  36. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/favicon_32_cb_c827f16f.png +0 -0
  37. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/function_index.html +0 -0
  38. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/index.html +0 -0
  39. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/keybd_closed_cb_900cfef5.png +0 -0
  40. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/status.json +0 -0
  41. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/style_cb_9ff733b0.css +0 -0
  42. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8___about___py.html +0 -0
  43. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8___init___py.html +0 -0
  44. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_altairplots_py.html +0 -0
  45. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_api_helpers_py.html +0 -0
  46. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_api_interfaces_py.html +0 -0
  47. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_api_reporting_py.html +0 -0
  48. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_checkmodules_py.html +0 -0
  49. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_codeaudit_dashboard_py.html +0 -0
  50. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_codeaudit_py.html +0 -0
  51. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_complexitycheck_py.html +0 -0
  52. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_dashboard_reports_py.html +0 -0
  53. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_filehelpfunctions_py.html +0 -0
  54. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_htmlhelpfunctions_py.html +0 -0
  55. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_issuevalidations_py.html +0 -0
  56. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_privacy_lint_py.html +0 -0
  57. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_pypi_package_scan_py.html +0 -0
  58. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_reporting_py.html +0 -0
  59. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_security_checks_py.html +0 -0
  60. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_suppression_py.html +0 -0
  61. {codeaudit-1.7.1 → codeaudit-1.8.0}/cov_html/z_15dab3f49bf85fa8_totals_py.html +0 -0
  62. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/CLIcommands.ipynb +0 -0
  63. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/CONTRIBUTE.md +0 -0
  64. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/_static/nocxstyle.css +0 -0
  65. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/_toc.yml +0 -0
  66. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/about.md +0 -0
  67. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/apidocs/api_intro.md +0 -0
  68. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/apidocs/codeaudit.rst +0 -0
  69. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/apidocs/modules.rst +0 -0
  70. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/architecture.md +0 -0
  71. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/changelog.md +0 -0
  72. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/assert_check.md +0 -0
  73. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/base64_check.md +0 -0
  74. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/binding_check.md +0 -0
  75. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/builtinfunctions_check.md +0 -0
  76. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/chmod_check.md +0 -0
  77. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/directorycreation_check.md +0 -0
  78. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/ftp_check.md +0 -0
  79. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/hash_check.md +0 -0
  80. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/httpserver_check.md +0 -0
  81. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/input_check.md +0 -0
  82. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/loggingconf_check.md +0 -0
  83. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/marshal_check.md +0 -0
  84. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/mktemp_check.md +0 -0
  85. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/multiprocessing_check.md +0 -0
  86. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/pickle_check.md +0 -0
  87. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/random_check.md +0 -0
  88. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/shelve_check.md +0 -0
  89. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/shutil_check.md +0 -0
  90. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/subprocess_check.md +0 -0
  91. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/syscalls_check.md +0 -0
  92. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/systemcalls_check.md +0 -0
  93. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/tarfile_extract_check.md +0 -0
  94. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/xml_check.md +0 -0
  95. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checks/zipfile_check.md +0 -0
  96. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/checksinformation.md +0 -0
  97. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/codeauditchecks.md +0 -0
  98. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/codeauditoverview.md +0 -0
  99. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/complexitycheck.md +0 -0
  100. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/data_egress_implementation.md +0 -0
  101. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/data_exfiltration_detection.md +0 -0
  102. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/ca_api_example_basic.ipynb +0 -0
  103. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/ca_api_example_checks.ipynb +0 -0
  104. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/ca_api_example_json.ipynb +0 -0
  105. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/ca_api_example_overview.ipynb +0 -0
  106. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/ca_api_example_scanning.ipynb +0 -0
  107. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/ca_checks.ipynb +0 -0
  108. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/demofile.py +0 -0
  109. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/directoryscan.html +0 -0
  110. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/example_risk_heatmap.ipynb +0 -0
  111. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/example_weakness_perfile_view.ipynb +0 -0
  112. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/filescan.html +0 -0
  113. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/modulescan.html +0 -0
  114. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/examples/overview.html +0 -0
  115. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/features.md +0 -0
  116. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/filescan.md +0 -0
  117. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/filescan.png +0 -0
  118. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/handling_errors.md +0 -0
  119. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/help.md +0 -0
  120. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/howtoscan.md +0 -0
  121. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/OO.png +0 -0
  122. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/ROI_logo.png +0 -0
  123. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/YourLogoHere.png +0 -0
  124. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/ai_use.png +0 -0
  125. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/architecture_overview.png +0 -0
  126. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/codeauditlogo.png +0 -0
  127. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/filescan_screenshot_16012026.png +0 -0
  128. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/modulescan_screenshot_16012026.png +0 -0
  129. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/nocxbanner.png +0 -0
  130. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/overview_linkaudit.png +0 -0
  131. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/images/overview_screenshot_16012026.png +0 -0
  132. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/implementedvalidations.md +0 -0
  133. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/installation.md +0 -0
  134. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/issues.md +0 -0
  135. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/license.md +0 -0
  136. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/makeitbetter.md +0 -0
  137. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/markingissues.md +0 -0
  138. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/modulescan.md +0 -0
  139. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/overviewplot.png +0 -0
  140. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/pca_overview.png +0 -0
  141. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/project_philosophy.md +0 -0
  142. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/sponsors.md +0 -0
  143. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/userguide.md +0 -0
  144. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/warnings.md +0 -0
  145. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/whatissast.md +0 -0
  146. {codeaudit-1.7.1 → codeaudit-1.8.0}/docs/whysast.md +0 -0
  147. {codeaudit-1.7.1 → codeaudit-1.8.0}/filescan.png +0 -0
  148. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/__init__.py +0 -0
  149. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/altairplots.py +0 -0
  150. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/api_helpers.py +0 -0
  151. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/api_interfaces.py +0 -0
  152. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/api_reporting.py +0 -0
  153. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/checkmodules.py +0 -0
  154. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/ci_workflowscan.py +0 -0
  155. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/complexitycheck.py +0 -0
  156. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/dashboard_reports.py +0 -0
  157. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/filehelpfunctions.py +0 -0
  158. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/htmlhelpfunctions.py +0 -0
  159. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/issuevalidations.py +0 -0
  160. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/privacy_lint.py +0 -0
  161. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/pypi_package_scan.py +0 -0
  162. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/security_checks.py +0 -0
  163. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/simple.css +0 -0
  164. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/suppression.py +0 -0
  165. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/codeaudit/totals.py +0 -0
  166. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/__init__.py +0 -0
  167. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/dashboardapp.py +0 -0
  168. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/module_load_validation.html +0 -0
  169. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/module_load_validation2.html +0 -0
  170. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/dashboardapp_version166.html +0 -0
  171. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/dashboardapp_version166.js +0 -0
  172. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp.js +0 -0
  173. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version162.html +0 -0
  174. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version162.js +0 -0
  175. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version166.html +0 -0
  176. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/pyodide/deployed/dashboardapp_version166.js +0 -0
  177. {codeaudit-1.7.1 → codeaudit-1.8.0}/src/dashboard/requirements.txt +0 -0
  178. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/__init__.py +0 -0
  179. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/count_lines_file1.py +0 -0
  180. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/clean.py +0 -0
  181. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/elastic.py +0 -0
  182. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/example1.py +0 -0
  183. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/klyne.py +0 -0
  184. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/mixed.py +0 -0
  185. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/telemetry.py +0 -0
  186. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/spytestdir/telemetryfile2.py +0 -0
  187. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/suppression/sastsuppression_0.py +0 -0
  188. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/suppression/sastsuppression_1.py +0 -0
  189. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/suppression/sastsuppression_2.py +0 -0
  190. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_apicalls.py +0 -0
  191. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_apicalls2.py +0 -0
  192. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_base64.py +0 -0
  193. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_basicpatterns.py +0 -0
  194. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_chmod.py +0 -0
  195. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_constructspart2.py +0 -0
  196. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_count_commentlines.py +0 -0
  197. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_directorycreation.py +0 -0
  198. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_directorycreation2.py +0 -0
  199. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_dynamic_import.py +0 -0
  200. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_edgecases.py +0 -0
  201. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_ftp.py +0 -0
  202. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_hashstrenght.py +0 -0
  203. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_modulecheck.py +0 -0
  204. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_obfuscatingbuiltins.py +0 -0
  205. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_oschecks.py +0 -0
  206. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_pylintreport.py +0 -0
  207. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_pypiscan.py +0 -0
  208. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_random.py +0 -0
  209. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_secretfinding.py +0 -0
  210. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_standardlibconstructs.py +0 -0
  211. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_subprocess.py +0 -0
  212. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_suppression.py +0 -0
  213. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_suppressionlogic.py +0 -0
  214. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_totalscheck.py +0 -0
  215. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_wasmsafe_funtions.py +0 -0
  216. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/test_zstd.py +0 -0
  217. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/unit_tests/__init__.py +0 -0
  218. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/unit_tests/test_collectsourcefiles.py +0 -0
  219. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/unit_tests/test_count_weaknesses.py +0 -0
  220. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/unit_tests/test_filehelpfunctions.py +0 -0
  221. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/unit_tests/test_readinsourcefile.py +0 -0
  222. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/allshit.py +0 -0
  223. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/apivalidations.py +0 -0
  224. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/assert.py +0 -0
  225. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/base64.py +0 -0
  226. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/chmod_things.py +0 -0
  227. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/codeaudit_scan.json +0 -0
  228. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/complexitycheck.py +0 -0
  229. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/correctcounts.py +0 -0
  230. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/danger_imports.py +0 -0
  231. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/directorycreation.py +0 -0
  232. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/directorycreation2.py +0 -0
  233. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/dunderexec_with_parsing_error.py +0 -0
  234. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/eval.py +0 -0
  235. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/eval2.py +0 -0
  236. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/file3.py +0 -0
  237. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/file_with_warnings.py +0 -0
  238. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/ftp.py +0 -0
  239. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/gzip.py +0 -0
  240. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/hashcheck.py +0 -0
  241. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/httpserver.py +0 -0
  242. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/inputstatement.py +0 -0
  243. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/malware.py +0 -0
  244. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/marshal.py +0 -0
  245. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/modulecheck.py +0 -0
  246. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/multiprocessing.py +0 -0
  247. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/obfuscating.py +0 -0
  248. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/oschecks.py +0 -0
  249. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/pickle.py +0 -0
  250. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/python2_file_willnotwork.py +0 -0
  251. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/random.py +0 -0
  252. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/shelve.py +0 -0
  253. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/shutil.py +0 -0
  254. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/subprocess.py +0 -0
  255. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/syslibrary.py +0 -0
  256. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/tarfilevalidation.py +0 -0
  257. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/tempcheck.py +0 -0
  258. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/validation1.py +0 -0
  259. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/validation2.py +0 -0
  260. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/xml.py +0 -0
  261. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/zipfile.py +0 -0
  262. {codeaudit-1.7.1 → codeaudit-1.8.0}/tests/validationfiles/zstd.py +0 -0
@@ -1,5 +1,26 @@
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
+
3
24
  ## Version 1.7.1:
4
25
 
5
26
 
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeaudit
3
- Version: 1.7.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
@@ -51,9 +52,10 @@ Python Code Audit is a static application security testing (SAST) tool designed
51
52
  This tool is designed for anyone who uses or creates Python programs and wants to understand and mitigate potential security risks.
52
53
 
53
54
  This tool is created for:
54
- * Python Users who want to assess the security risks in the Python code they use.
55
- * Python Developers: Anyone, from professionals to hobbyists, who wants to deliver secure Python code.
56
- * Security-Conscious Users: People seeking a simple, fast way to gain insight into potential security vulnerabilities within Python packages or files.
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.
57
59
 
58
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.
59
61
 
@@ -61,32 +63,28 @@ Creating secure software can be challenging. This tool, with its comprehensive [
61
63
 
62
64
  Python Code Audit has the following features:
63
65
 
64
- * **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
65
-
66
- * **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
67
-
68
- * **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
69
-
70
- * **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
66
+ - **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
71
67
 
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
 
73
- * **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
70
+ - **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
74
71
 
75
- * **CI/CD Ready:** Integrates seamlessly into any CI/CD workflow.
72
+ - **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
76
73
 
77
- * **HTML Reports**: All output is saved in simple, static HTML reports viewable in any browser.
74
+ - **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
78
75
 
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
85
  > [!TIP]
88
86
  > Try it instantly—no installs, no setup, no excuses.
89
- >
87
+ >
90
88
  > 👉 Launch the browser version [here](https://nocomplexity.com/codeauditapp/dashboardapp.html)
91
89
 
92
90
  It runs 100% locally in your browser using WebAssembly (WASM). See the power of the tool in under 60 seconds.
@@ -98,12 +96,8 @@ Loved the browser version? Unlock the full power. For advanced security code ins
98
96
  pip install -U codeaudit
99
97
  ```
100
98
 
101
-
102
-
103
-
104
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.
105
100
 
106
-
107
101
  ## Usage
108
102
 
109
103
  After installation you can get an overview of all implemented commands. Just type in your terminal:
@@ -116,7 +110,7 @@ This will show all commands:
116
110
 
117
111
  ```text
118
112
  ----------------------------------------------------
119
- _ __ _
113
+ _ __ _
120
114
  |_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
121
115
  | / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
122
116
  ----------------------------------------------------
@@ -125,13 +119,14 @@ Python Code Audit - A modern Python security source code analyzer based on distr
125
119
 
126
120
 
127
121
  Commands to evaluate Python source code:
128
- Usage: codeaudit COMMAND <directory|package> [report.html]
122
+ Usage: codeaudit COMMAND <directory|package> [report.html]
129
123
 
130
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.
131
125
 
132
126
  Commands:
133
127
  overview Generates an overview report of code complexity and security indicators.
134
128
  filescan Scans Python source code or PyPI packages for security weaknesses.
129
+ cimode Run a SAST scan for CI workflows.
135
130
  modulescan Generate a report on known vulnerabilities in Python modules and packages.
136
131
  checks Creates an HTML report of all implemented security checks.
137
132
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
@@ -141,7 +136,7 @@ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to
141
136
 
142
137
  ## Example
143
138
 
144
- By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **80 validations** implemented.
139
+ By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **89 validations** implemented.
145
140
 
146
141
  The `codeaudit filescan` command shows all **potential** security issues that are detected in the source file in a HTML-report.
147
142
 
@@ -163,19 +158,17 @@ Paste the line below directly into your browser bar:
163
158
 
164
159
  ![Example view of filescan report](filescan.png)
165
160
 
166
-
167
161
  ## Contributing
168
162
 
169
163
  All contributions are welcome! Think of corrections on the documentation, code or more and better tests.
170
164
 
171
165
  Simple Guidelines:
172
166
 
173
- * Questions, Feature Requests, Bug Reports please use on the Github Issue Tracker.
174
-
175
- **Pull Requests are welcome!**
167
+ - Questions, Feature Requests, Bug Reports please use on the Github Issue Tracker.
176
168
 
177
- 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!**
178
170
 
171
+ When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
179
172
 
180
173
  > [!NOTE]
181
174
  > This is an open community driven project. Contributors will be mentioned in the [documentation](https://nocomplexity.com/documents/codeaudit/intro.html).
@@ -184,7 +177,4 @@ We adopt the [Collective Code Construction Contract(C4)](https://rfc.zeromq.org/
184
177
 
185
178
  ## License
186
179
 
187
-
188
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.
189
-
190
-
@@ -17,9 +17,10 @@ Python Code Audit is a static application security testing (SAST) tool designed
17
17
  This tool is designed for anyone who uses or creates Python programs and wants to understand and mitigate potential security risks.
18
18
 
19
19
  This tool is created for:
20
- * Python Users who want to assess the security risks in the Python code they use.
21
- * Python Developers: Anyone, from professionals to hobbyists, who wants to deliver secure Python code.
22
- * Security-Conscious Users: People seeking a simple, fast way to gain insight into potential security vulnerabilities within Python packages or files.
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.
23
24
 
24
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.
25
26
 
@@ -27,32 +28,28 @@ Creating secure software can be challenging. This tool, with its comprehensive [
27
28
 
28
29
  Python Code Audit has the following features:
29
30
 
30
- * **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
31
-
32
- * **Complexity & Statistics**: Reports security-relevant complexity using a fast, lightweight [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) count via Python's AST.
33
-
34
- * **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
35
-
36
- * **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
31
+ - **Vulnerability Detection**: Identifies security vulnerabilities in Python files, essential for package security research.
37
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.
38
34
 
39
- * **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
35
+ - **Module Usage & External Vulnerabilities**: Detects used modules and reports known vulnerabilities for used external modules.
40
36
 
41
- * **CI/CD Ready:** Integrates seamlessly into any CI/CD workflow.
37
+ - **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
42
38
 
43
- * **HTML Reports**: All output is saved in simple, static HTML reports viewable in any browser.
39
+ - **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
44
40
 
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
50
  > [!TIP]
54
51
  > Try it instantly—no installs, no setup, no excuses.
55
- >
52
+ >
56
53
  > 👉 Launch the browser version [here](https://nocomplexity.com/codeauditapp/dashboardapp.html)
57
54
 
58
55
  It runs 100% locally in your browser using WebAssembly (WASM). See the power of the tool in under 60 seconds.
@@ -64,12 +61,8 @@ Loved the browser version? Unlock the full power. For advanced security code ins
64
61
  pip install -U codeaudit
65
62
  ```
66
63
 
67
-
68
-
69
-
70
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.
71
65
 
72
-
73
66
  ## Usage
74
67
 
75
68
  After installation you can get an overview of all implemented commands. Just type in your terminal:
@@ -82,7 +75,7 @@ This will show all commands:
82
75
 
83
76
  ```text
84
77
  ----------------------------------------------------
85
- _ __ _
78
+ _ __ _
86
79
  |_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
87
80
  | / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
88
81
  ----------------------------------------------------
@@ -91,13 +84,14 @@ Python Code Audit - A modern Python security source code analyzer based on distr
91
84
 
92
85
 
93
86
  Commands to evaluate Python source code:
94
- Usage: codeaudit COMMAND <directory|package> [report.html]
87
+ Usage: codeaudit COMMAND <directory|package> [report.html]
95
88
 
96
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.
97
90
 
98
91
  Commands:
99
92
  overview Generates an overview report of code complexity and security indicators.
100
93
  filescan Scans Python source code or PyPI packages for security weaknesses.
94
+ cimode Run a SAST scan for CI workflows.
101
95
  modulescan Generate a report on known vulnerabilities in Python modules and packages.
102
96
  checks Creates an HTML report of all implemented security checks.
103
97
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
@@ -107,7 +101,7 @@ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to
107
101
 
108
102
  ## Example
109
103
 
110
- By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **80 validations** implemented.
104
+ By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **89 validations** implemented.
111
105
 
112
106
  The `codeaudit filescan` command shows all **potential** security issues that are detected in the source file in a HTML-report.
113
107
 
@@ -129,19 +123,17 @@ Paste the line below directly into your browser bar:
129
123
 
130
124
  ![Example view of filescan report](filescan.png)
131
125
 
132
-
133
126
  ## Contributing
134
127
 
135
128
  All contributions are welcome! Think of corrections on the documentation, code or more and better tests.
136
129
 
137
130
  Simple Guidelines:
138
131
 
139
- * Questions, Feature Requests, Bug Reports please use on the Github Issue Tracker.
140
-
141
- **Pull Requests are welcome!**
132
+ - Questions, Feature Requests, Bug Reports please use on the Github Issue Tracker.
142
133
 
143
- 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!**
144
135
 
136
+ When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
145
137
 
146
138
  > [!NOTE]
147
139
  > This is an open community driven project. Contributors will be mentioned in the [documentation](https://nocomplexity.com/documents/codeaudit/intro.html).
@@ -150,7 +142,4 @@ We adopt the [Collective Code Construction Contract(C4)](https://rfc.zeromq.org/
150
142
 
151
143
  ## License
152
144
 
153
-
154
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.
155
-
156
-
@@ -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.' # The author of the book
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")
@@ -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
- Codeaudit detects the use of `pass` within an `except` block.
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
- presents potential security risks due to:
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/)
@@ -10,16 +10,14 @@ If you have improvements or CI configuration tips, contributions via pull reques
10
10
  [Data Exfiltration Detection functionality](data_exfiltration_detection) is not yet available in CI pipelines.
11
11
  :::
12
12
 
13
-
14
13
  :::{admonition} By default, CI scan mode uses the same analysis engine as the CLI version
15
14
  :class: important
16
15
 
17
16
  So Keep in mind:
18
17
 
19
- * [Some directories are excluded from SAST scanning](excluded_directories)
20
- * Findings marked with [markissues-label](markissues-label) are ignored by default in CI mode
21
- :::
22
-
18
+ - [Some directories are excluded from SAST scanning](excluded_directories)
19
+ - Findings marked with [markissues-label](markissues-label) are ignored by default in CI mode
20
+ :::
23
21
 
24
22
  ## CI Mode Command
25
23
 
@@ -31,10 +29,8 @@ codeaudit cimode [file|directory] [--output text|html|json] [--nosec True|False]
31
29
 
32
30
  ### Default behaviour
33
31
 
34
- * Output format: `text`
35
- * `nosec=True` (ignores lines marked with `# nosec`)
36
-
37
-
32
+ - Output format: `text`
33
+ - `nosec=True` (ignores lines marked with `# nosec`)
38
34
 
39
35
  ### Quick Test Run
40
36
 
@@ -46,30 +42,22 @@ codeaudit cimode .
46
42
 
47
43
  Here, `.` represents the current working directory.
48
44
 
49
-
50
45
  ### Command Options
51
46
 
52
-
53
47
  | Option | Description |
54
- | -------------- | ---------------------------------------------------------- |
48
+ | :------------- | :--------------------------------------------------------- |
55
49
  | `-o, --output` | Output format: `text`, `html`, or `json` (default: `text`) |
56
50
  | `-n, --nosec` | Ignore findings marked with `# nosec` (default: `True`) |
57
51
 
58
-
59
-
60
-
61
52
  ## GitLab CI Integration
62
53
 
63
-
64
54
  Integrating Python Code Audit with [GitLab.com](https://gitlab.com) is straightforward and can be completed in just a few minutes.
65
55
 
66
56
  For GitLab CI jobs, it is recommended to always save **artifacts**, even when the job fails. This ensures that scan results are available for review in all cases. It is especially useful when using the HTML report format, as it allows you to quickly view findings directly in the browser via the CI artifacts interface.
67
57
 
68
58
  If needed, you can also export the `json` output for further processing in a separate secure environment, for example to integrate results into dashboards, ticketing systems, or additional analysis pipelines.
69
59
 
70
-
71
- ### HTML report example
72
-
60
+ ### HTML report example
73
61
 
74
62
  ```yaml
75
63
  # SAST scan with Python Code Audit on GitLab.com
@@ -88,7 +76,7 @@ codeaudit-scan:
88
76
  - pip install codeaudit
89
77
  - codeaudit --version
90
78
  - codeaudit cimode . --output html > codeaudit-output.html
91
-
79
+
92
80
  allow_failure: true
93
81
 
94
82
  artifacts:
@@ -102,8 +90,7 @@ codeaudit-scan:
102
90
 
103
91
  If a scan detects security weaknesses, the job will fail by default. In many workflows, it is common to allow CI failures so that issues are visible without blocking all development activity.
104
92
 
105
- After the job completes, results are available in the CI **artifacts**. Use *Browse artifacts* to open the HTML report directly in your browser.
106
-
93
+ After the job completes, results are available in the CI **artifacts**. Use _Browse artifacts_ to open the HTML report directly in your browser.
107
94
 
108
95
  ### Plain Text Output Example
109
96
 
@@ -132,7 +119,6 @@ codeaudit-scan:
132
119
  expose_as: "Python Code Audit Report"
133
120
  ```
134
121
 
135
-
136
122
  ### JSON Output Example
137
123
 
138
124
  For structured processing or integration with other tools:
@@ -160,6 +146,36 @@ codeaudit-scan:
160
146
  expose_as: "Python Code Audit Report"
161
147
  ```
162
148
 
149
+ ### GitLab CI Component Example
150
+
151
+ `codeaudit` can be easily fitted as a GitLab CI component for easy integration into the GitLab pipelines.
152
+ Example code for a `codeaudit-scan` component:
153
+
154
+ ```yaml
155
+ spec:
156
+ inputs:
157
+ python_version:
158
+ default: "3.14"
159
+ description: "Python version to use for the scan"
160
+ stage:
161
+ default: "scan"
162
+ description: "Stage to run the scan in"
163
+ src_dir:
164
+ default: "."
165
+ description: "Directory to scan"
166
+ ---
167
+ codeaudit-scan:
168
+ image: python:$[[ inputs.python_version ]]-alpine
169
+ stage: $[[ inputs.stage ]]
170
+ before_script:
171
+ - python -m venv venv
172
+ - source venv/bin/activate
173
+ - pip install --upgrade pip codeaudit
174
+ script:
175
+ - codeaudit cimode $[[ inputs.src_dir ]]
176
+ ```
177
+
178
+ Example above enforces projects to react on found issues. Intentionally results are not redirected to the file to not cover found issues.
163
179
 
164
180
  ## GitHub.com CI Integration
165
181
 
@@ -200,20 +216,17 @@ jobs:
200
216
 
201
217
  - name: Run SAST scan
202
218
  run: |
203
- codeaudit cimode . --output text | tee codeaudit-output.text
204
- exit ${PIPESTATUS[0]}
205
-
219
+ codeaudit cimode . --output text | tee codeaudit-output.text
220
+ exit ${PIPESTATUS[0]}
221
+
206
222
  - name: Upload scan artifact
207
223
  uses: actions/upload-artifact@v4
208
224
  with:
209
225
  name: codeaudit-${{ github.ref_name }}
210
226
  path: codeaudit-output.text
211
-
212
227
  ```
213
228
 
214
-
215
- ### HTML output
216
-
229
+ ### HTML output
217
230
 
218
231
  ```yaml
219
232
  # SAST scan with Python Code Audit on GitHub Actions
@@ -242,7 +255,7 @@ jobs:
242
255
 
243
256
  - name: Install Python Code Audit
244
257
  run: pip install codeaudit
245
-
258
+
246
259
  - name: Show version
247
260
  run: codeaudit --version
248
261
 
@@ -254,11 +267,9 @@ jobs:
254
267
  with:
255
268
  name: codeaudit-${{ github.ref_name }}
256
269
  path: codeaudit-output.html
257
-
258
270
  ```
259
271
 
260
- On GitHub Actions, HTML reports are **not rendered directly in the browser** like a live page. They are stored as **workflow artifacts**.
261
-
272
+ On GitHub Actions, HTML reports are **not rendered directly in the browser** like a live page. They are stored as **workflow artifacts**.
262
273
 
263
274
  To download SAST result artifacts from the workflow run:
264
275
 
@@ -271,6 +282,3 @@ After the job finishes:
271
282
  5. Download the artifact (usually a `.zip` file)
272
283
  6. Extract it locally
273
284
  7. Open `codeaudit-output.html` in your browser
274
-
275
-
276
-
@@ -1,9 +1,9 @@
1
1
  % THIS FILE IS GENERATED! - Use CLIcommands.ipynb to make it better!
2
2
  # Commands Overview
3
- Python Code Audit commands for: version: 1.7.1
3
+ Python Code Audit commands for: version: 1.8.0
4
4
  ```
5
5
  ----------------------------------------------------
6
- _ __ _
6
+ _ __ _
7
7
  |_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
8
8
  | / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
9
9
  ----------------------------------------------------
@@ -18,6 +18,7 @@ Depending on the command, you must specify a local directory, a Python file, or
18
18
  Commands:
19
19
  overview Generates an overview report of code complexity and security indicators.
20
20
  filescan Scans Python source code or PyPI packages for security weaknesses.
21
+ cimode Run a SAST scan for CI workflows.
21
22
  modulescan Generate a report on known vulnerabilities in Python modules and packages.
22
23
  checks Creates an HTML report of all implemented security checks.
23
24
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].