codeaudit 1.6.0__tar.gz → 1.6.2__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 (201) hide show
  1. {codeaudit-1.6.0 → codeaudit-1.6.2}/CHANGELOG.md +44 -0
  2. {codeaudit-1.6.0 → codeaudit-1.6.2}/PKG-INFO +2 -2
  3. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/_toc.yml +7 -0
  4. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/codeauditcommands.md +8 -8
  5. codeaudit-1.6.2/docs/data_egress_implementation.md +91 -0
  6. codeaudit-1.6.2/docs/data_exfiltration_detection.md +157 -0
  7. codeaudit-1.6.2/docs/examples/ca_api_example_overview.ipynb +160 -0
  8. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/codeauditchecks.html +1 -1
  9. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/demoscan.json +2 -2
  10. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/filescan.md +4 -3
  11. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/help.md +15 -29
  12. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/howtoscan.md +5 -2
  13. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/intro.md +6 -11
  14. codeaudit-1.6.2/docs/issues.md +56 -0
  15. codeaudit-1.6.0/docs/issues.md → codeaudit-1.6.2/docs/markingissues.md +9 -57
  16. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/modulescan.md +4 -4
  17. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/sponsors.md +13 -2
  18. {codeaudit-1.6.0 → codeaudit-1.6.2}/pyproject.toml +5 -1
  19. codeaudit-1.6.2/src/codeaudit/__about__.py +4 -0
  20. codeaudit-1.6.2/src/codeaudit/__init__.py +4 -0
  21. codeaudit-1.6.2/src/codeaudit/altairplots.py +1001 -0
  22. codeaudit-1.6.2/src/codeaudit/api_helpers.py +285 -0
  23. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/api_interfaces.py +272 -99
  24. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/api_reporting.py +15 -8
  25. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/checkmodules.py +14 -10
  26. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/codeaudit.py +45 -23
  27. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/complexitycheck.py +23 -11
  28. codeaudit-1.6.2/src/codeaudit/dashboard_reports.py +417 -0
  29. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/data/secretslist.txt +1 -2
  30. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/filehelpfunctions.py +13 -13
  31. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/htmlhelpfunctions.py +1 -0
  32. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/issuevalidations.py +33 -21
  33. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/privacy_lint.py +166 -97
  34. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/pypi_package_scan.py +26 -25
  35. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/reporting.py +402 -300
  36. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/security_checks.py +20 -18
  37. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/suppression.py +30 -25
  38. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/totals.py +18 -19
  39. codeaudit-1.6.2/tests/spytestdir/clean.py +1 -0
  40. codeaudit-1.6.2/tests/spytestdir/elastic.py +23 -0
  41. codeaudit-1.6.2/tests/spytestdir/example1.py +6 -0
  42. codeaudit-1.6.2/tests/spytestdir/klyne.py +7 -0
  43. codeaudit-1.6.2/tests/spytestdir/mixed.py +4 -0
  44. codeaudit-1.6.2/tests/spytestdir/telemetry.py +31 -0
  45. codeaudit-1.6.2/tests/spytestdir/telemetryfile2.py +31 -0
  46. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/suppression/sastsuppression_1.py +0 -1
  47. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_apicalls.py +4 -0
  48. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_constructspart2.py +2 -3
  49. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_edgecases.py +13 -0
  50. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_obfuscatingbuiltins.py +2 -1
  51. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_oschecks.py +3 -0
  52. codeaudit-1.6.2/tests/test_pylintreport.py +136 -0
  53. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_secretfinding.py +3 -3
  54. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_subprocess.py +1 -1
  55. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_suppression.py +10 -5
  56. codeaudit-1.6.2/tests/validationfiles/apivalidations.py +54 -0
  57. codeaudit-1.6.0/docs/examples/ca_api_example_overview.ipynb +0 -160
  58. codeaudit-1.6.0/src/codeaudit/__about__.py +0 -4
  59. codeaudit-1.6.0/src/codeaudit/__init__.py +0 -4
  60. codeaudit-1.6.0/src/codeaudit/altairplots.py +0 -145
  61. codeaudit-1.6.0/tests/validationfiles/apivalidations.py +0 -54
  62. {codeaudit-1.6.0 → codeaudit-1.6.2}/.gitignore +0 -0
  63. {codeaudit-1.6.0 → codeaudit-1.6.2}/CONTRIBUTE.md +0 -0
  64. {codeaudit-1.6.0 → codeaudit-1.6.2}/LICENSE.txt +0 -0
  65. {codeaudit-1.6.0 → codeaudit-1.6.2}/README.md +0 -0
  66. {codeaudit-1.6.0 → codeaudit-1.6.2}/SECURITY.md +0 -0
  67. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/CLIcommands.ipynb +0 -0
  68. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/CONTRIBUTE.md +0 -0
  69. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/_config.yml +0 -0
  70. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/_static/nocxstyle.css +0 -0
  71. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/about.md +0 -0
  72. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/apidocs/api_intro.md +0 -0
  73. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/apidocs/codeaudit.rst +0 -0
  74. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/apidocs/modules.rst +0 -0
  75. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/architecture.md +0 -0
  76. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/astlines.md +0 -0
  77. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/astlines2.md +0 -0
  78. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/changelog.md +0 -0
  79. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/assert_check.md +0 -0
  80. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/base64_check.md +0 -0
  81. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/binding_check.md +0 -0
  82. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/builtinfunctions_check.md +0 -0
  83. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/chmod_check.md +0 -0
  84. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/directorycreation_check.md +0 -0
  85. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/dynamicimport_check.md +0 -0
  86. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/exception_check.md +0 -0
  87. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/hash_check.md +0 -0
  88. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/httpserver_check.md +0 -0
  89. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/input_check.md +0 -0
  90. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/loggingconf_check.md +0 -0
  91. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/marshal_check.md +0 -0
  92. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/mktemp_check.md +0 -0
  93. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/multiprocessing_check.md +0 -0
  94. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/pickle_check.md +0 -0
  95. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/random_check.md +0 -0
  96. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/shelve_check.md +0 -0
  97. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/shutil_check.md +0 -0
  98. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/subprocess_check.md +0 -0
  99. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/syscalls_check.md +0 -0
  100. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/systemcalls_check.md +0 -0
  101. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/tarfile_extract_check.md +0 -0
  102. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/xml_check.md +0 -0
  103. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checks/zipfile_check.md +0 -0
  104. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/checksinformation.md +0 -0
  105. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/codeauditchecks.md +0 -0
  106. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/codeauditoverview.md +0 -0
  107. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/complexitycheck.md +0 -0
  108. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/ca_api_example_basic.ipynb +0 -0
  109. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/ca_api_example_checks.ipynb +0 -0
  110. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/ca_api_example_json.ipynb +0 -0
  111. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/ca_api_example_scanning.ipynb +0 -0
  112. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/ca_checks.ipynb +0 -0
  113. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/demofile.py +0 -0
  114. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/directoryscan.html +0 -0
  115. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/filescan.html +0 -0
  116. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/modulescan.html +0 -0
  117. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/examples/overview.html +0 -0
  118. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/features.md +0 -0
  119. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/filescan.png +0 -0
  120. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/handling_errors.md +0 -0
  121. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/OO.png +0 -0
  122. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/ROI_logo.png +0 -0
  123. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/YourLogoHere.png +0 -0
  124. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/ai_use.png +0 -0
  125. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/architecture_overview.png +0 -0
  126. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/codeauditlogo.png +0 -0
  127. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/filescan_screenshot_16012026.png +0 -0
  128. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/modulescan_screenshot_16012026.png +0 -0
  129. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/nocxbanner.png +0 -0
  130. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/overview_linkaudit.png +0 -0
  131. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/images/overview_screenshot_16012026.png +0 -0
  132. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/implementedvalidations.md +0 -0
  133. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/installation.md +0 -0
  134. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/license.md +0 -0
  135. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/makeitbetter.md +0 -0
  136. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/overviewplot.png +0 -0
  137. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/pca_overview.png +0 -0
  138. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/project_philosophy.md +0 -0
  139. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/securecoding.md +0 -0
  140. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/userguide.md +0 -0
  141. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/warnings.md +0 -0
  142. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/whatissast.md +0 -0
  143. {codeaudit-1.6.0 → codeaudit-1.6.2}/docs/whysast.md +0 -0
  144. {codeaudit-1.6.0 → codeaudit-1.6.2}/filescan.png +0 -0
  145. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/data/sastchecks.csv +0 -0
  146. {codeaudit-1.6.0 → codeaudit-1.6.2}/src/codeaudit/simple.css +0 -0
  147. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/__init__.py +0 -0
  148. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/count_lines_file1.py +0 -0
  149. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/suppression/sastsuppression_0.py +0 -0
  150. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/suppression/sastsuppression_2.py +0 -0
  151. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_basicpatterns.py +0 -0
  152. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_chmod.py +0 -0
  153. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_correctexceptionuse.py +0 -0
  154. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_count_commentlines.py +0 -0
  155. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_directorycreation.py +0 -0
  156. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_directorycreation2.py +0 -0
  157. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_hashstrenght.py +0 -0
  158. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_modulecheck.py +0 -0
  159. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_pypiscan.py +0 -0
  160. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_random.py +0 -0
  161. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_standardlibconstructs.py +0 -0
  162. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_suppressionlogic.py +0 -0
  163. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_totalscheck.py +0 -0
  164. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/test_zstd.py +0 -0
  165. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/allshit.py +0 -0
  166. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/assert.py +0 -0
  167. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/base64.py +0 -0
  168. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/chmod_things.py +0 -0
  169. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/complexitycheck.py +0 -0
  170. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/correctcounts.py +0 -0
  171. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/directorycreation.py +0 -0
  172. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/directorycreation2.py +0 -0
  173. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/dunderexec_with_parsing_error.py +0 -0
  174. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/eval.py +0 -0
  175. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/eval2.py +0 -0
  176. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/exception.py +0 -0
  177. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/file3.py +0 -0
  178. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/file_with_warnings.py +0 -0
  179. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/gzip.py +0 -0
  180. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/hashcheck.py +0 -0
  181. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/httpserver.py +0 -0
  182. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/inputstatement.py +0 -0
  183. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/marshal.py +0 -0
  184. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/modulecheck.py +0 -0
  185. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/multiprocessing.py +0 -0
  186. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/obfuscating.py +0 -0
  187. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/oschecks.py +0 -0
  188. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/pickle.py +0 -0
  189. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/python2_file_willnotwork.py +0 -0
  190. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/random.py +0 -0
  191. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/shelve.py +0 -0
  192. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/shutil.py +0 -0
  193. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/subprocess.py +0 -0
  194. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/syslibrary.py +0 -0
  195. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/tarfilevalidation.py +0 -0
  196. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/tempcheck.py +0 -0
  197. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/validation1.py +0 -0
  198. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/validation2.py +0 -0
  199. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/xml.py +0 -0
  200. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/zipfile.py +0 -0
  201. {codeaudit-1.6.0 → codeaudit-1.6.2}/tests/validationfiles/zstd.py +0 -0
@@ -1,5 +1,49 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 1.6.2:
4
+
5
+ ## Changelog
6
+
7
+ **Added**
8
+ * **Automated Python Testing:** Implemented automation for testing across various Python versions to ensure cross-version compatibility.
9
+
10
+ **Changed**
11
+
12
+ * **Internal Logic Improvements:** Enhanced the `count_privacy_check_results` function to provide more robust egress count testing.
13
+ * **CLI Reporting:** Updated the command-line interface to dynamically toggle between "issue" (singular) and "issues" (plural) based on the findings.
14
+ * **Architecture Refactoring:** Refined internal logic for increased stability and to ensure the codebase is **WASM ready**.
15
+ * **License Standardization:** Updated the **GPLv3** license banner across key Python files for stylistic consistency. (see also issue #4)
16
+
17
+ **Fixed**
18
+ * **Issue #6 (Defensive Coding):** Resolved `KeyError` and syntax error during code snippet creation through more defensive programming practices.
19
+
20
+ **Documentation**
21
+ * Typos fixed and various improvements.
22
+
23
+
24
+ ## Version 1.6.1:
25
+
26
+ **Added**
27
+ Data Exfiltration Logic: Introduced improved and refactored logic for data egress (data exfiltration) risk detection.
28
+
29
+ False Positive Prevention: Updated the secretlist to prevent false positives associated with common class definitions and NLP modules.
30
+
31
+ **Changed**
32
+ API Robustness: Performed minor code refactoring to ensure error handling is more robust when interacting with APIs.
33
+
34
+ Maintenance Refactor: Renamed several functions to ensure the codebase remains simple, intuitive, and easy to maintain.
35
+
36
+ Project Branding: Updated the PyPI.org description to more accurately reflect the tool’s core purpose and capabilities.
37
+
38
+ **Fixed**
39
+ Logic Refinement: Refined the data egress detection scripts to improve accuracy and performance.
40
+
41
+ **Documentation**
42
+ Report Clarity: Improved the HTML filescan report text to clarify that external egress detection is distinct from identifying secrets within Python code.
43
+
44
+ General Maintenance: Applied various fixes and improvements to the project documentation for better readability.
45
+
46
+
3
47
  ## Version 1.6.0:
4
48
 
5
49
  **Added**:
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeaudit
3
- Version: 1.6.0
4
- Summary: Simplified static security checks for Python
3
+ Version: 1.6.2
4
+ Summary: A modern Python security source code analyzer (SAST) based on distrust.
5
5
  Project-URL: Documentation, https://github.com/nocomplexity/codeaudit#readme
6
6
  Project-URL: Issues, https://github.com/nocomplexity/codeaudit/issues
7
7
  Project-URL: Source, https://github.com/nocomplexity/codeaudit
@@ -9,6 +9,9 @@ parts:
9
9
  - file: howtoscan
10
10
  - file: whatissast
11
11
  - file: whysast
12
+ - url: https://securitytesting.nocomplexity.com/
13
+ title: Mastering Security Testing for Python
14
+
12
15
 
13
16
 
14
17
 
@@ -20,7 +23,11 @@ parts:
20
23
  - file: filescan
21
24
  - file: modulescan
22
25
  - file: codeauditchecks
26
+ - file: data_exfiltration_detection
27
+ sections:
28
+ - file: data_egress_implementation
23
29
  - file: issues
30
+ - file: markingissues
24
31
  - file: securecoding
25
32
  - file: complexitycheck
26
33
  - file: warnings
@@ -1,6 +1,6 @@
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.5.0
3
+ Python Code Audit commands for: version: 1.6.2
4
4
  ```
5
5
  ----------------------------------------------------
6
6
  _ __ _
@@ -70,7 +70,7 @@ Returns:
70
70
  Raises:
71
71
  SystemExit: If the provided path is not a directory, contains no Python
72
72
  files, or is neither a valid local directory nor a valid PyPI
73
- package name.
73
+ package name.
74
74
  str(object='') -> str
75
75
  str(bytes_or_buffer[, encoding[, errors]]) -> str
76
76
 
@@ -191,7 +191,7 @@ FLAGS
191
191
  -n, --nosec=NOSEC
192
192
  Default: False
193
193
 
194
-
194
+
195
195
  Args:
196
196
 
197
197
  -f, --filename=FILENAME
@@ -213,7 +213,7 @@ Returns:
213
213
  None: The function writes a static HTML security report to disk.
214
214
 
215
215
  Raises:
216
- None: Errors and invalid inputs are reported to stdout.
216
+ None: Errors and invalid inputs are reported to stdout.
217
217
  str(object='') -> str
218
218
  str(bytes_or_buffer[, encoding[, errors]]) -> str
219
219
 
@@ -230,8 +230,8 @@ errors defaults to 'strict'.
230
230
 
231
231
  Creates an HTML report of all implemented security checks.
232
232
 
233
- This report provides a user-friendly overview of the static security checks
234
- currently supported by Python Code Audit. It is intended to make it easier to review
233
+ This report provides a user-friendly overview of the static security checks
234
+ currently supported by Python Code Audit. It is intended to make it easier to review
235
235
  the available validations without digging through the codebase.
236
236
 
237
237
  The generated HTML includes:
@@ -240,12 +240,12 @@ The generated HTML includes:
240
240
  - The version of Python Code Audit (codeaudit) used
241
241
  - A disclaimer about version-specific reporting
242
242
 
243
- The report is saved to the specified filename and is formatted to be
243
+ The report is saved to the specified filename and is formatted to be
244
244
  embeddable in larger multi-report documents.
245
245
 
246
246
  Help me continue developing Python Code Audit as free and open-source software.
247
247
  Join the community to contribute to the most complete, local first , Python Security Static scanner.
248
- Help!! Join the journey, check: https://github.com/nocomplexity/codeaudit#contributing
248
+ Help!! Join the journey, check: https://github.com/nocomplexity/codeaudit#contributing
249
249
 
250
250
 
251
251
  Parameters:
@@ -0,0 +1,91 @@
1
+ # How Egress Detection works
2
+
3
+
4
+ This section explains the design choices used to detect potential data exfiltration as implemented in Python Code Audit.
5
+
6
+ Python Code Audit analyses Python source code to determine whether data may be sent to external systems.
7
+
8
+ :::{important}
9
+ No single technique can detect telemetry or data exfiltration with 100% accuracy. All detection methods involve trade-offs between detection depth, complexity, and false-positive rates.
10
+ :::
11
+
12
+ ## Detection Approaches
13
+
14
+ Common techniques for detecting potential data exfiltration in Python code are:
15
+
16
+ * Entropy analysis – Detects high-entropy strings that may represent API keys or tokens.
17
+
18
+ * Regex pattern matching – Identifies known credential formats (e.g. AWS AKIA...).
19
+
20
+ * Import monitoring – Detects libraries such as boto3, google-cloud-storage, or requests.
21
+
22
+ * Machine learning – Analyses code and network behaviour patterns.
23
+
24
+ * Taint analysis – Tracks whether sensitive data flows to external network calls.
25
+
26
+ * Telemetry library detection – Identifies known analytics or telemetry SDKs.
27
+
28
+ * Network module inspection – Detects modules capable of external communication (requests, httpx, urllib, aiohttp, socket, etc.).
29
+
30
+ * Semantic pattern matching – Detects behavioural code patterns.
31
+
32
+ * Data flow mapping – Identifies where sensitive data may reach external “sink” points.
33
+
34
+ In practice these approaches often combine AST parsing, regex rules, and data-flow analysis, **but full accuracy is impossible due to edge cases such as aliasing, dynamic imports, and code obfuscation.**
35
+
36
+ **Example:** Using an external telemetry service can be as simple as:
37
+
38
+ ```python
39
+ import externalmonitoring as safereport
40
+
41
+ safereport.init(
42
+ api_key="your-api-key",
43
+ project="mycompanymodule"
44
+ )
45
+ ```
46
+
47
+ ## Design Philosophy
48
+
49
+ Detecting data exfiltration is always a trade-off. Following the Python Code Audit [project philosophy](project_philosophy), our implementation prioritises:
50
+
51
+ * Ease of use for quick audits of third-party Python code
52
+ * Low maintenance
53
+ * Clear and limited scope
54
+
55
+ ## Detection Strategy
56
+
57
+ Python Code Audit focuses primarily on secrets used in function calls, which **indicate** communication with external services.
58
+
59
+ Most telemetry platforms, SaaS services, and cloud APIs require API keys or tokens for authentication. Detecting these patterns is therefore an effective way to identify potential telemetry or data-exfiltration behaviour.
60
+
61
+ Python Code Audit parses Python files into an Abstract Syntax Tree (AST) to detect authentication parameters such as API keys, tokens, or JWTs used in calls to external services.
62
+
63
+ :::{note}
64
+ Python Code Audit is **not** a secret-scanning tool.
65
+
66
+ Detecting exposed secrets in repositories is a separate use case.
67
+
68
+ Dedicated tools exist for this purpose, such as TruffleHog or Gitleaks. But Check and use relevant security FOSS tools from our [FOSS security solution catalogue](https://nocomplexity.com/documents/securitysolutions/intro.html).
69
+ :::
70
+
71
+
72
+ Advantages of our approach:
73
+
74
+ - **Fast analysis** – Quickly identifies potential external service integrations.
75
+
76
+ - **No code execution required** – Python code is analysed **safely** without running it.
77
+
78
+ - No need to maintain large lists of network libraries or telemetry SDKs.
79
+
80
+ - **Simpler and more maintainable detection logic** – Avoids complex taint analysis and large regex rule sets.
81
+
82
+
83
+
84
+ The Python Code Audit design offers a **high-speed**, practical framework for detecting 'phone-home' behaviours and data exfiltration paths.
85
+
86
+ :::{admonition} Paranoid?
87
+ :class: hint, dropdown
88
+ If you want to prevent data exfiltration, you should **block all outgoing network traffic** from your applications to external systems, or only allow data flows that have been explicitly approved following a risk analysis.
89
+
90
+ Detection of data exfiltration in Python code does not guarantee that no data is transmitted through other components of the system. This is particularly important in environments where technologies other than Python are also used.
91
+ :::
@@ -0,0 +1,157 @@
1
+ # Data Exfiltration Detection
2
+
3
+ Python Code Audit has advanced functionality to detect External Egress Risk. This capability is essential when verifying security before using Python programs or when evaluating existing Python code.
4
+
5
+ This section explains why detecting potential data exfiltration in Python programs is important and how this functionality can be used within **Python Code Audit**.
6
+
7
+ :::{admonition} Detecting Data Exfiltration
8
+ :class: danger
9
+ Identifying data exfiltration in Python code—specifically within telemetry, remote analytics, and SaaS integrations—is a **critical step in mitigating security risks**.
10
+ :::
11
+
12
+
13
+ ## Why Python Data Exfiltration Detection matters
14
+
15
+ In the modern digital economy, data is an organization’s most valuable asset. When sensitive information falls into unauthorized hands, the consequences are often irreversible.
16
+
17
+ Within Static Application Security Testing (SAST), identifying interactions with remote services is more than a best practice; it is a necessity.
18
+
19
+ Detecting and validating potential data exfiltration paths in Python applications is essential to maintaining a secure, resilient, and trustworthy software ecosystem.
20
+
21
+
22
+ ### What is Data Egress?
23
+
24
+ Data egress occurs when information travels from your secure internal perimeter to an external destination. In a Python context, this includes the public internet, third-party cloud environments, partner networks, or SaaS integrations.
25
+
26
+ ### The Challenge: Legitimate vs. Malicious Intent
27
+ In Python development, outbound data flow is often a core functional requirement. Modern applications rely on authorized egress paths for:
28
+ - Communication: Sending automated emails or notifications.
29
+ - Integration: Delivering API responses to external consumers.
30
+ - Infrastructure: Syncing database backups to remote cloud storage.
31
+
32
+ However, Python’s flexibility makes it a prime candidate for advanced exfiltration techniques. Malicious actors or compromised dependencies can hide unauthorized data transfers within seemingly benign traffic, often bypassing standard network-level detection.
33
+
34
+ ### The Telemetry Trap: Remote Monitoring & Analytics
35
+
36
+ Developers naturally want to understand application performance. This leads to the integration of telemetry (remote analytics), which is the automated collection and transmission of data from distributed systems to a central location.
37
+
38
+ Common use cases include:
39
+ * Usage Analytics: Monitoring who uses a Python package and on what platforms.
40
+ * Health Checks: Remote updates and error monitoring.
41
+ * Behavioral Tracking: Analysing UI/UX interactions (e.g., Google Analytics).
42
+ * Vertical-Specific Monitoring: Patient data in healthcare or track-and-trace in logistics.
43
+
44
+
45
+ **The Fallacy of "Anonymous" Collection**
46
+
47
+ While many Python telemetry modules claim anonymity, **privacy risks** persist. If the backend systems are closed-source, they rely on **security by obscurity**, violating a core security principle.
48
+
49
+ :::{danger}
50
+ Telemetry and various Python analytics and remote monitoring modules often collect more metadata than documented, sending private data to unknown, potentially vulnerable services.
51
+ :::
52
+
53
+ ### The "Shift-Left" Advantage
54
+ Detecting exfiltration at the network level is reactive and expensive. It often fails when traffic is encrypted or blended with legitimate SaaS calls. Moving detection to the code level ([Shift-Left](https://nocomplexity.com/shift-left/)) is more cost-effective and provides:
55
+
56
+ 1. Supply Chain Integrity: Auditing third-party libraries before integration. If a library contains undocumented "phone home" logic, it can be blocked early.
57
+ 2. Defense in Depth: Perimeter tools (Firewalls, DLP, CASBs) are essential but not infallible. Source code detection adds a vital internal layer of defense.
58
+
59
+ Security Mandate: From a **Zero Trust** standpoint, organisations must verify if telemetry is present in their Python code and ensure all associated risks are mitigated through code, systems, and management processes.
60
+
61
+ ## Assessing the Security Risks
62
+
63
+ Telemetry represents a **deliberate hole** in your network perimeter. When Python applications implement advanced tracking without granular consent, they transition from a "utility" to a significant security liability.
64
+
65
+ **Sensitive Data Leakage**: Telemetry and other forms of external service (SaaS) interaction often captures more than just "events." Without rigorous sanitization, these streams can include:
66
+
67
+ - **PII (Personally Identifiable Information):** Usernames, IP addresses, and location data.
68
+ - **Secrets in Logs:** Authentication tokens or database strings caught in stack traces.
69
+ - **Business Logic:** Proprietary metadata revealing internal infrastructure.
70
+
71
+
72
+ **Expanded Attack Surface:** Every external API endpoint is a potential point of failure.
73
+
74
+ - **Unauthenticated Endpoints:** Many telemetry "sinks" lack robust auth, making them easy targets for interception.
75
+ - **Library Vulnerabilities:** The telemetry module itself may contain vulnerabilities (e.g., RCE or path traversal) that grant attackers a foothold.
76
+
77
+ **The "When, Not If" Data Breach:** Data sent to a third party is only as secure as their defenses.
78
+
79
+ - Loss of Custody: Once data leaves your perimeter, you lose the ability to protect it.
80
+ - **Transparency Gaps:** You are dependent on the provider to detect and report breaches—a process that often takes months.
81
+
82
+
83
+ ## How to Check for Data Exfiltration
84
+
85
+ **Python Code Audit** includes functionality to detect potential data exfiltration risks. This feature is available through:
86
+
87
+ - the [CLI interface](userguide), and
88
+
89
+ - the [API](apidocs/modules).
90
+
91
+ Using the Python Code Audit CLI interface:
92
+ The egress detection function can be activated with the following command:
93
+
94
+ ```bash
95
+ codeaudit filescan <pythonfile|package-name|directory> [OUTPUTFILE]
96
+ ```
97
+
98
+ **Report Output**
99
+
100
+ In the generated HTML report, each analysed file is evaluated for potential data exfiltration to external services.
101
+
102
+ If a potential risk is detected, the report will display:
103
+ > *&#9888;&#65039; External Egress Risk: Detected outbound connection logic or API keys that may facilitate data egress.*
104
+
105
+ The report also highlights the exact lines of code that triggered the detection.
106
+
107
+ :::{tip}
108
+ **Always review discovered modules carefully.**
109
+
110
+ In the report, under the section:
111
+
112
+ `> View used modules in this file.`
113
+
114
+ the HTML report lists all modules detected per file. Understanding each module is critical—some are strong indicators of possible data exchange with external systems. Review them to assess potential security or privacy risks.
115
+ :::
116
+
117
+ If no external egress risks are identified, the report will display:
118
+ > *&#x2705; No logic for connecting to remote services found. Risk of data exfiltration to external systems is low.*
119
+
120
+
121
+
122
+ :::{important}
123
+ No tool can provide 100% guarantees. This applies to Python Code Audit as well as to any other security analysis tool.
124
+ :::
125
+
126
+
127
+ :::{admonition} Scope and Intent of **Python Code Audit Egress Scanning**
128
+ :class: note
129
+
130
+ It is critical to distinguish between Data Egress Detection and Secret Scanning. While both are vital components of a secure development lifecycle, they address entirely different threat vectors.
131
+
132
+ The **Python Code Audit** egress detection functionality is **NOT** designed to identify secrets within your source code.
133
+
134
+ Understanding the Difference:
135
+ * Data Egress Detection: Focuses on the destination and mechanism of data leaving your environment (e.g., identifying telemetry hooks, hidden API calls, or SaaS integrations).
136
+
137
+ * Secret Scanning: Focuses on the credentials themselves (e.g., hardcoded API keys, passwords, or certificates), whether they are plaintext or obfuscated.
138
+ :::
139
+
140
+
141
+ :::{admonition} High-risk integrations are a key focus for Python Code Audit egress detection!
142
+ :class: danger, dropdown
143
+
144
+ The following categories represent common classes of external service integrations that may introduce data egress or external communication risks in Python applications.
145
+ Python Code Audit’s data egress capability is designed to detect these flows.
146
+
147
+
148
+ | Category | Risk Type | Typical Detection Indicators | Examples |
149
+ |----------|-----------|-----------------------------|----------|
150
+ | Telemetry & Observability | Data Leakage / Privacy | Telemetry SDK imports, metrics exporters, remote monitoring endpoints, automatic usage reporting | Datadog, New Relic, AppDynamics, Mixpanel, Segment |
151
+ | Logging & Analytics | Metadata Exposure | Remote log ingestion endpoints, log shipping agents, API tokens for log platforms | Splunk, ELK (Elastic), Loggly |
152
+ | Cloud Infrastructure | Lateral Movement | Cloud SDK usage, IAM credential usage, storage APIs, service account authentication | AWS (IAM/S3), Azure (Service Principals), GCP |
153
+ | AI & LLM Pipelines | Resource Abuse / IP Leak | LLM API calls, prompt transmission to external APIs, model inference endpoints | OpenAI, Anthropic, LangChain |
154
+ | Communication Gateways | Financial Risk / Phishing | Messaging APIs, webhook endpoints, outbound email/SMS integrations | Twilio, SendGrid, Slack Webhooks |
155
+
156
+ :::
157
+
@@ -0,0 +1,160 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "a7c7195e-93bf-40c3-88b1-61b7601fad2d",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Example:Security Weaknesses Overview\n",
9
+ "\n",
10
+ "This notebook demonstrates how to use the Python Code Audit APIs to generate a visual overview of all detected weaknesses in a file or package.\n",
11
+ "\n",
12
+ "The identified security weaknesses are displayed using an [Altair](https://altair-viz.github.io/index.html) radial chart.\n"
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 1,
18
+ "id": "09e351e8-5a8e-4365-b94a-8f61703ecd04",
19
+ "metadata": {},
20
+ "outputs": [],
21
+ "source": [
22
+ "from codeaudit.api_interfaces import filescan , get_construct_counts\n",
23
+ "from codeaudit.altairplots import issue_plot"
24
+ ]
25
+ },
26
+ {
27
+ "cell_type": "code",
28
+ "execution_count": 2,
29
+ "id": "b532b94a-c19c-4203-8eac-dfa04c0f52cf",
30
+ "metadata": {},
31
+ "outputs": [],
32
+ "source": [
33
+ "demo_file = 'demofile.py' #Instead of using a single file, you can also use a directory. The file or directory gets scanned on security weaknesses."
34
+ ]
35
+ },
36
+ {
37
+ "cell_type": "code",
38
+ "execution_count": 3,
39
+ "id": "44016841-cf88-4e72-82ed-b57f4cc79a04",
40
+ "metadata": {},
41
+ "outputs": [],
42
+ "source": [
43
+ "result = get_construct_counts(demo_file) #The `get_constructs_counts` API call, scans the file or directory and returns a Python dict."
44
+ ]
45
+ },
46
+ {
47
+ "cell_type": "code",
48
+ "execution_count": 4,
49
+ "id": "88bb7d58-b242-43a7-9e87-06d163302bee",
50
+ "metadata": {},
51
+ "outputs": [
52
+ {
53
+ "data": {
54
+ "text/html": [
55
+ "\n",
56
+ "<style>\n",
57
+ " #altair-viz-557237fd1f17422c9869f5fab1267afa.vega-embed {\n",
58
+ " width: 100%;\n",
59
+ " display: flex;\n",
60
+ " }\n",
61
+ "\n",
62
+ " #altair-viz-557237fd1f17422c9869f5fab1267afa.vega-embed details,\n",
63
+ " #altair-viz-557237fd1f17422c9869f5fab1267afa.vega-embed details summary {\n",
64
+ " position: relative;\n",
65
+ " }\n",
66
+ "</style>\n",
67
+ "<div id=\"altair-viz-557237fd1f17422c9869f5fab1267afa\"></div>\n",
68
+ "<script type=\"text/javascript\">\n",
69
+ " var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n",
70
+ " (function(spec, embedOpt){\n",
71
+ " let outputDiv = document.currentScript.previousElementSibling;\n",
72
+ " if (outputDiv.id !== \"altair-viz-557237fd1f17422c9869f5fab1267afa\") {\n",
73
+ " outputDiv = document.getElementById(\"altair-viz-557237fd1f17422c9869f5fab1267afa\");\n",
74
+ " }\n",
75
+ "\n",
76
+ " const paths = {\n",
77
+ " \"vega\": \"https://cdn.jsdelivr.net/npm/vega@6?noext\",\n",
78
+ " \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n",
79
+ " \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@6.1.0?noext\",\n",
80
+ " \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@7?noext\",\n",
81
+ " };\n",
82
+ "\n",
83
+ " function maybeLoadScript(lib, version) {\n",
84
+ " var key = `${lib.replace(\"-\", \"\")}_version`;\n",
85
+ " return (VEGA_DEBUG[key] == version) ?\n",
86
+ " Promise.resolve(paths[lib]) :\n",
87
+ " new Promise(function(resolve, reject) {\n",
88
+ " var s = document.createElement('script');\n",
89
+ " document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
90
+ " s.async = true;\n",
91
+ " s.onload = () => {\n",
92
+ " VEGA_DEBUG[key] = version;\n",
93
+ " return resolve(paths[lib]);\n",
94
+ " };\n",
95
+ " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
96
+ " s.src = paths[lib];\n",
97
+ " });\n",
98
+ " }\n",
99
+ "\n",
100
+ " function showError(err) {\n",
101
+ " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
102
+ " throw err;\n",
103
+ " }\n",
104
+ "\n",
105
+ " function displayChart(vegaEmbed) {\n",
106
+ " vegaEmbed(outputDiv, spec, embedOpt)\n",
107
+ " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
108
+ " }\n",
109
+ "\n",
110
+ " if(typeof define === \"function\" && define.amd) {\n",
111
+ " requirejs.config({paths});\n",
112
+ " let deps = [\"vega-embed\"];\n",
113
+ " require(deps, displayChart, err => showError(`Error loading script: ${err.message}`));\n",
114
+ " } else {\n",
115
+ " maybeLoadScript(\"vega\", \"6\")\n",
116
+ " .then(() => maybeLoadScript(\"vega-lite\", \"6.1.0\"))\n",
117
+ " .then(() => maybeLoadScript(\"vega-embed\", \"7\"))\n",
118
+ " .catch(showError)\n",
119
+ " .then(() => displayChart(vegaEmbed));\n",
120
+ " }\n",
121
+ " })({\"config\": {\"view\": {\"continuousWidth\": 300, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-4b0e95bbc5603fd13e7b50f912f80d74\"}, \"mark\": {\"type\": \"arc\", \"innerRadius\": 20}, \"encoding\": {\"color\": {\"field\": \"legend_label\", \"legend\": {\"title\": \"Weaknesses (Count)\"}, \"scale\": {\"scheme\": \"category20\"}, \"type\": \"nominal\"}, \"radius\": {\"field\": \"count\", \"scale\": {\"type\": \"sqrt\"}, \"type\": \"quantitative\"}, \"theta\": {\"field\": \"theta1\", \"stack\": null, \"title\": null, \"type\": \"quantitative\"}, \"theta2\": {\"field\": \"theta0\"}, \"tooltip\": [{\"field\": \"construct\", \"type\": \"nominal\"}, {\"field\": \"count\", \"type\": \"quantitative\"}]}, \"height\": 600, \"title\": \"Overview of Security Weaknesses\", \"width\": 600, \"$schema\": \"https://vega.github.io/schema/vega-lite/v6.1.0.json\", \"datasets\": {\"data-4b0e95bbc5603fd13e7b50f912f80d74\": [{\"construct\": \"assert\", \"count\": 2, \"legend_label\": \"assert (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.0, \"theta1\": 0.03076923076923077}, {\"construct\": \"base64\", \"count\": 2, \"legend_label\": \"base64 (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.03076923076923077, \"theta1\": 0.06153846153846154}, {\"construct\": \"bz2.BZ2File\", \"count\": 1, \"legend_label\": \"bz2.BZ2File (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.06153846153846154, \"theta1\": 0.07692307692307693}, {\"construct\": \"bz2.open\", \"count\": 1, \"legend_label\": \"bz2.open (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.07692307692307693, \"theta1\": 0.09230769230769231}, {\"construct\": \"compile\", \"count\": 1, \"legend_label\": \"compile (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.09230769230769231, \"theta1\": 0.1076923076923077}, {\"construct\": \"connection.recv\", \"count\": 1, \"legend_label\": \"connection.recv (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.1076923076923077, \"theta1\": 0.12307692307692308}, {\"construct\": \"continue\", \"count\": 1, \"legend_label\": \"continue (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.12307692307692308, \"theta1\": 0.13846153846153847}, {\"construct\": \"eval\", \"count\": 1, \"legend_label\": \"eval (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.13846153846153847, \"theta1\": 0.15384615384615385}, {\"construct\": \"exec\", \"count\": 2, \"legend_label\": \"exec (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.15384615384615385, \"theta1\": 0.18461538461538463}, {\"construct\": \"gzip.open\", \"count\": 1, \"legend_label\": \"gzip.open (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.18461538461538463, \"theta1\": 0.2}, {\"construct\": \"hashlib.md5\", \"count\": 1, \"legend_label\": \"hashlib.md5 (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.2, \"theta1\": 0.2153846153846154}, {\"construct\": \"hashlib.sha1\", \"count\": 2, \"legend_label\": \"hashlib.sha1 (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.2153846153846154, \"theta1\": 0.24615384615384617}, {\"construct\": \"http.server.BaseHTTPRequestHandler\", \"count\": 2, \"legend_label\": \"http.server.BaseHTTPRequestHandler (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.24615384615384617, \"theta1\": 0.27692307692307694}, {\"construct\": \"http.server.HTTPServer\", \"count\": 1, \"legend_label\": \"http.server.HTTPServer (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.27692307692307694, \"theta1\": 0.2923076923076923}, {\"construct\": \"logging.config\", \"count\": 2, \"legend_label\": \"logging.config (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.2923076923076923, \"theta1\": 0.3230769230769231}, {\"construct\": \"lzma.LZMAFile\", \"count\": 1, \"legend_label\": \"lzma.LZMAFile (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.3230769230769231, \"theta1\": 0.3384615384615385}, {\"construct\": \"lzma.open\", \"count\": 2, \"legend_label\": \"lzma.open (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.3384615384615385, \"theta1\": 0.36923076923076925}, {\"construct\": \"marshal.load\", \"count\": 1, \"legend_label\": \"marshal.load (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.36923076923076925, \"theta1\": 0.38461538461538464}, {\"construct\": \"marshal.loads\", \"count\": 1, \"legend_label\": \"marshal.loads (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.38461538461538464, \"theta1\": 0.4}, {\"construct\": \"os.access\", \"count\": 2, \"legend_label\": \"os.access (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.4, \"theta1\": 0.4307692307692308}, {\"construct\": \"os.chmod\", \"count\": 1, \"legend_label\": \"os.chmod (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.4307692307692308, \"theta1\": 0.4461538461538462}, {\"construct\": \"os.fork\", \"count\": 3, \"legend_label\": \"os.fork (3)\", \"fraction\": 0.046153846153846156, \"theta0\": 0.4461538461538462, \"theta1\": 0.49230769230769234}, {\"construct\": \"os.forkpty\", \"count\": 1, \"legend_label\": \"os.forkpty (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.4923076923076923, \"theta1\": 0.5076923076923077}, {\"construct\": \"os.makedirs\", \"count\": 1, \"legend_label\": \"os.makedirs (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.5076923076923077, \"theta1\": 0.523076923076923}, {\"construct\": \"os.popen\", \"count\": 1, \"legend_label\": \"os.popen (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.523076923076923, \"theta1\": 0.5384615384615383}, {\"construct\": \"os.system\", \"count\": 1, \"legend_label\": \"os.system (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.5384615384615383, \"theta1\": 0.5538461538461537}, {\"construct\": \"os.write\", \"count\": 1, \"legend_label\": \"os.write (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.5538461538461537, \"theta1\": 0.569230769230769}, {\"construct\": \"os.writev\", \"count\": 1, \"legend_label\": \"os.writev (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.569230769230769, \"theta1\": 0.5846153846153843}, {\"construct\": \"pass\", \"count\": 2, \"legend_label\": \"pass (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.5846153846153843, \"theta1\": 0.6153846153846151}, {\"construct\": \"pickle.load\", \"count\": 1, \"legend_label\": \"pickle.load (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.6153846153846152, \"theta1\": 0.6307692307692305}, {\"construct\": \"pickle.loads\", \"count\": 2, \"legend_label\": \"pickle.loads (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.6307692307692305, \"theta1\": 0.6615384615384613}, {\"construct\": \"random.random\", \"count\": 1, \"legend_label\": \"random.random (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.6615384615384614, \"theta1\": 0.6769230769230767}, {\"construct\": \"random.seed\", \"count\": 1, \"legend_label\": \"random.seed (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.6769230769230767, \"theta1\": 0.6923076923076921}, {\"construct\": \"s.bind\", \"count\": 2, \"legend_label\": \"s.bind (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.6923076923076921, \"theta1\": 0.7230769230769228}, {\"construct\": \"shelve.open\", \"count\": 1, \"legend_label\": \"shelve.open (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.723076923076923, \"theta1\": 0.7384615384615383}, {\"construct\": \"shutil.copy\", \"count\": 1, \"legend_label\": \"shutil.copy (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.7384615384615383, \"theta1\": 0.7538461538461536}, {\"construct\": \"shutil.rmtree\", \"count\": 1, \"legend_label\": \"shutil.rmtree (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.7538461538461536, \"theta1\": 0.7692307692307689}, {\"construct\": \"shutil.unpack_archive\", \"count\": 1, \"legend_label\": \"shutil.unpack_archive (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.7692307692307689, \"theta1\": 0.7846153846153843}, {\"construct\": \"sys.setprofile\", \"count\": 2, \"legend_label\": \"sys.setprofile (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.7846153846153843, \"theta1\": 0.815384615384615}, {\"construct\": \"sys.settrace\", \"count\": 2, \"legend_label\": \"sys.settrace (2)\", \"fraction\": 0.03076923076923077, \"theta0\": 0.815384615384615, \"theta1\": 0.8461538461538458}, {\"construct\": \"tarfile.TarFile\", \"count\": 6, \"legend_label\": \"tarfile.TarFile (6)\", \"fraction\": 0.09230769230769231, \"theta0\": 0.8461538461538458, \"theta1\": 0.9384615384615381}, {\"construct\": \"tempfile.mktemp\", \"count\": 1, \"legend_label\": \"tempfile.mktemp (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.9384615384615382, \"theta1\": 0.9538461538461536}, {\"construct\": \"xmlrpc.client\", \"count\": 1, \"legend_label\": \"xmlrpc.client (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.9538461538461536, \"theta1\": 0.9692307692307689}, {\"construct\": \"xmlrpc.server.SimpleXMLRPCServer\", \"count\": 1, \"legend_label\": \"xmlrpc.server.SimpleXMLRPCServer (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.9692307692307689, \"theta1\": 0.9846153846153842}, {\"construct\": \"zipfile.ZipFile\", \"count\": 1, \"legend_label\": \"zipfile.ZipFile (1)\", \"fraction\": 0.015384615384615385, \"theta0\": 0.9846153846153842, \"theta1\": 0.9999999999999996}]}}, {\"mode\": \"vega-lite\"});\n",
122
+ "</script>"
123
+ ],
124
+ "text/plain": [
125
+ "alt.Chart(...)"
126
+ ]
127
+ },
128
+ "execution_count": 4,
129
+ "metadata": {},
130
+ "output_type": "execute_result"
131
+ }
132
+ ],
133
+ "source": [
134
+ "chart = issue_plot(result) \n",
135
+ "chart"
136
+ ]
137
+ }
138
+ ],
139
+ "metadata": {
140
+ "kernelspec": {
141
+ "display_name": "Python 3 (ipykernel)",
142
+ "language": "python",
143
+ "name": "python3"
144
+ },
145
+ "language_info": {
146
+ "codemirror_mode": {
147
+ "name": "ipython",
148
+ "version": 3
149
+ },
150
+ "file_extension": ".py",
151
+ "mimetype": "text/x-python",
152
+ "name": "python",
153
+ "nbconvert_exporter": "python",
154
+ "pygments_lexer": "ipython3",
155
+ "version": "3.13.11"
156
+ }
157
+ },
158
+ "nbformat": 4,
159
+ "nbformat_minor": 5
160
+ }
@@ -738,4 +738,4 @@ footer {
738
738
  <td>Vulnerable to path traversal attacks if used with untrusted archives.</td>
739
739
  </tr>
740
740
  </tbody>
741
- </table><br><p>Number of implemented security validations:<b>83</b></p><p>Version of codeaudit: <b>1.5.0</b><p>Because Python and cybersecurity are constantly changing, issue reports <b>SHOULD</b> specify the codeaudit version used.</p><p><b>Disclaimer:</b> <i>This SAST tool <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> provides a powerful, automatic security analysis for Python source code. However, it's not a substitute for human review in combination with business knowledge. Undetected vulnerabilities may still exist.</i></p><p>This Python security report was created on: <b>2026-02-06 15:52</b> with <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> version <b>1.5.0</b></p><hr><footer><div class="footer-links">Check the <a href="https://nocomplexity.com/documents/codeaudit/intro.html" target="_blank">documentation</a> for help on found issues.<br>Codeaudit is made with <span class="heart">&#10084;</span> by cyber security professionals who advocate for <a href="https://nocomplexity.com/simplify-security/" target="_blank">open simple security solutions</a>.<br><a href="https://nocomplexity.com/documents/codeaudit/CONTRIBUTE.html" target="_blank">Join the community</a> and contribute to make this tool better!</div></footer></div></body></html>
741
+ </table><br><p>Number of implemented security validations:<b>83</b></p><p>Version of codeaudit: <b>1.6.2</b><p>Because Python and cybersecurity are constantly changing, issue reports <b>SHOULD</b> specify the codeaudit version used.</p><p><b>Disclaimer:</b> <i>This SAST tool <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> provides a powerful, automatic security analysis for Python source code. However, it's not a substitute for human review in combination with business knowledge. Undetected vulnerabilities may still exist.</i></p><p>This Python security report was created on: <b>2026-04-08 10:10</b> with <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> version <b>1.6.2</b></p><hr><footer><div class="footer-links">Check the <a href="https://nocomplexity.com/documents/codeaudit/intro.html" target="_blank">documentation</a> for help on found issues.<br>Codeaudit is made with <span class="heart">&#10084;</span> by cyber security professionals who advocate for <a href="https://nocomplexity.com/simplify-security/" target="_blank">open simple security solutions</a>.<br><a href="https://nocomplexity.com/documents/codeaudit/CONTRIBUTE.html" target="_blank">Join the community</a> and contribute to make this tool better!</div></footer></div></body></html>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Python_Code_Audit",
3
- "version": "1.5.0",
4
- "generated_on": "2026-02-06 15:52",
3
+ "version": "1.6.2",
4
+ "generated_on": "2026-04-08 10:09",
5
5
  "file_security_info": {
6
6
  "0": {
7
7
  "FileName": "demofile.py",
@@ -1,9 +1,10 @@
1
1
  # Command `codeaudit filescan`
2
2
 
3
- The **Python Code Audit** `filescan` command efficiently scans Python files or directories (packages) to identify and report potential security weaknesses.
4
-
5
- It produces a report detailing the potential security issues discovered.
3
+ The **Python Code Audit** `filescan` command efficiently scans Python files or directories (packages) to:
4
+ 1. Identify and report potential security weaknesses and
5
+ 2. [Detect Data Exfiltration](data_exfiltration_detection)
6
6
 
7
+ The tool generates a report detailing discovered security issues and flagging any External Egress Risks identified within the Python code.
7
8
 
8
9
  See section [validations](checksinformation) for all security checks implemented!
9
10