codeaudit 1.4.1__tar.gz → 1.5.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 (175) hide show
  1. {codeaudit-1.4.1 → codeaudit-1.5.0}/CHANGELOG.md +39 -1
  2. {codeaudit-1.4.1 → codeaudit-1.5.0}/CONTRIBUTE.md +16 -15
  3. {codeaudit-1.4.1 → codeaudit-1.5.0}/PKG-INFO +10 -6
  4. {codeaudit-1.4.1 → codeaudit-1.5.0}/README.md +9 -5
  5. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/CONTRIBUTE.md +15 -1
  6. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/_toc.yml +17 -12
  7. codeaudit-1.5.0/docs/apidocs/api_intro.md +26 -0
  8. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checksinformation.md +1 -1
  9. codeaudit-1.5.0/docs/codeauditcommands.md +240 -0
  10. codeaudit-1.5.0/docs/examples/ca_api_example_basic.ipynb +707 -0
  11. codeaudit-1.5.0/docs/examples/ca_api_example_checks.ipynb +395 -0
  12. codeaudit-1.5.0/docs/examples/ca_api_example_scanning.ipynb +195 -0
  13. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/demoscan.json +2 -2
  14. codeaudit-1.5.0/docs/features.md +88 -0
  15. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/filescan.md +3 -3
  16. codeaudit-1.5.0/docs/howtoscan.md +173 -0
  17. codeaudit-1.5.0/docs/images/filescan_screenshot_16012026.png +0 -0
  18. codeaudit-1.5.0/docs/images/modulescan_screenshot_16012026.png +0 -0
  19. codeaudit-1.5.0/docs/images/overview_screenshot_16012026.png +0 -0
  20. codeaudit-1.5.0/docs/installation.md +24 -0
  21. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/intro.md +75 -3
  22. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/makeitbetter.md +2 -0
  23. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/modulescan.md +32 -9
  24. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/userguide.md +21 -17
  25. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/__about__.py +1 -1
  26. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/api_interfaces.py +143 -37
  27. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/codeaudit.py +11 -8
  28. codeaudit-1.5.0/src/codeaudit/data/secretslist.txt +135 -0
  29. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/filehelpfunctions.py +1 -1
  30. codeaudit-1.5.0/src/codeaudit/privacy_lint.py +292 -0
  31. codeaudit-1.5.0/src/codeaudit/reporting.py +783 -0
  32. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/simple.css +31 -5
  33. codeaudit-1.5.0/tests/test_secretfinding.py +20 -0
  34. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/allshit.py +7 -0
  35. codeaudit-1.5.0/tests/validationfiles/apivalidations.py +54 -0
  36. codeaudit-1.4.1/docs/apidocs/api_intro.md +0 -19
  37. codeaudit-1.4.1/docs/codeauditcommands.md +0 -130
  38. codeaudit-1.4.1/docs/examples/ca_api_example_basic.ipynb +0 -191
  39. codeaudit-1.4.1/docs/features.md +0 -53
  40. codeaudit-1.4.1/docs/howtoscan.md +0 -120
  41. codeaudit-1.4.1/src/codeaudit/reporting.py +0 -504
  42. {codeaudit-1.4.1 → codeaudit-1.5.0}/.gitignore +0 -0
  43. {codeaudit-1.4.1 → codeaudit-1.5.0}/LICENSE.txt +0 -0
  44. {codeaudit-1.4.1 → codeaudit-1.5.0}/SECURITY.md +0 -0
  45. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/CLIcommands.ipynb +0 -0
  46. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/_config.yml +0 -0
  47. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/_static/nocxstyle.css +0 -0
  48. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/about.md +0 -0
  49. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/apidocs/codeaudit.rst +0 -0
  50. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/apidocs/modules.rst +0 -0
  51. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/astlines.md +0 -0
  52. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/astlines2.md +0 -0
  53. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/changelog.md +0 -0
  54. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/assert_check.md +0 -0
  55. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/base64_check.md +0 -0
  56. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/binding_check.md +0 -0
  57. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/builtinfunctions_check.md +0 -0
  58. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/chmod_check.md +0 -0
  59. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/directorycreation_check.md +0 -0
  60. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/dynamicimport_check.md +0 -0
  61. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/exception_check.md +0 -0
  62. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/hash_check.md +0 -0
  63. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/httpserver_check.md +0 -0
  64. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/input_check.md +0 -0
  65. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/loggingconf_check.md +0 -0
  66. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/marshal_check.md +0 -0
  67. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/mktemp_check.md +0 -0
  68. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/multiprocessing_check.md +0 -0
  69. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/pickle_check.md +0 -0
  70. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/random_check.md +0 -0
  71. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/shelve_check.md +0 -0
  72. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/shutil_check.md +0 -0
  73. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/subprocess_check.md +0 -0
  74. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/syscalls_check.md +0 -0
  75. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/systemcalls_check.md +0 -0
  76. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/tarfile_extract_check.md +0 -0
  77. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/xml_check.md +0 -0
  78. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/checks/zipfile_check.md +0 -0
  79. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/codeauditchecks.md +0 -0
  80. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/codeauditoverview.md +0 -0
  81. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/complexitycheck.md +0 -0
  82. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/ca_api_example_json.ipynb +0 -0
  83. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/ca_api_example_overview.ipynb +0 -0
  84. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/checks.html +0 -0
  85. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/demofile.py +0 -0
  86. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/directoryscan.html +0 -0
  87. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/filescan.html +0 -0
  88. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/modulescan.html +0 -0
  89. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/examples/overview.html +0 -0
  90. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/filescan.png +0 -0
  91. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/handling_errors.md +0 -0
  92. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/help.md +0 -0
  93. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/images/OO.png +0 -0
  94. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/images/ROI_logo.png +0 -0
  95. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/images/YourLogoHere.png +0 -0
  96. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/images/codeauditlogo.png +0 -0
  97. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/images/nocxbanner.png +0 -0
  98. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/images/overview_linkaudit.png +0 -0
  99. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/implementedvalidations.md +0 -0
  100. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/issues.md +0 -0
  101. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/license.md +0 -0
  102. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/overviewplot.png +0 -0
  103. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/pca_overview.png +0 -0
  104. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/project_philosophy.md +0 -0
  105. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/securecoding.md +0 -0
  106. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/sponsors.md +0 -0
  107. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/warnings.md +0 -0
  108. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/whatissast.md +0 -0
  109. {codeaudit-1.4.1 → codeaudit-1.5.0}/docs/whysast.md +0 -0
  110. {codeaudit-1.4.1 → codeaudit-1.5.0}/filescan.png +0 -0
  111. {codeaudit-1.4.1 → codeaudit-1.5.0}/pyproject.toml +0 -0
  112. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/__init__.py +0 -0
  113. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/altairplots.py +0 -0
  114. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/api_reporting.py +0 -0
  115. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/checkmodules.py +0 -0
  116. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/complexitycheck.py +0 -0
  117. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/data/sastchecks.csv +0 -0
  118. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/htmlhelpfunctions.py +0 -0
  119. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/issuevalidations.py +0 -0
  120. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/pypi_package_scan.py +0 -0
  121. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/security_checks.py +0 -0
  122. {codeaudit-1.4.1 → codeaudit-1.5.0}/src/codeaudit/totals.py +0 -0
  123. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/__init__.py +0 -0
  124. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/count_lines_file1.py +0 -0
  125. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_apicalls.py +0 -0
  126. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_basicpatterns.py +0 -0
  127. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_chmod.py +0 -0
  128. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_constructspart2.py +0 -0
  129. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_correctexceptionuse.py +0 -0
  130. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_count_commentlines.py +0 -0
  131. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_directorycreation.py +0 -0
  132. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_directorycreation2.py +0 -0
  133. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_hashstrenght.py +0 -0
  134. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_modulecheck.py +0 -0
  135. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_obfuscatingbuiltins.py +0 -0
  136. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_oschecks.py +0 -0
  137. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_pypiscan.py +0 -0
  138. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_random.py +0 -0
  139. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_standardlibconstructs.py +0 -0
  140. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_totalscheck.py +0 -0
  141. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/test_zstd.py +0 -0
  142. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/assert.py +0 -0
  143. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/base64.py +0 -0
  144. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/chmod_things.py +0 -0
  145. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/complexitycheck.py +0 -0
  146. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/correctcounts.py +0 -0
  147. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/directorycreation.py +0 -0
  148. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/directorycreation2.py +0 -0
  149. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/dunderexec_with_parsing_error.py +0 -0
  150. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/exception.py +0 -0
  151. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/file3.py +0 -0
  152. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/file_with_warnings.py +0 -0
  153. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/gzip.py +0 -0
  154. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/hashcheck.py +0 -0
  155. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/httpserver.py +0 -0
  156. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/inputstatement.py +0 -0
  157. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/marshal.py +0 -0
  158. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/modulecheck.py +0 -0
  159. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/multiprocessing.py +0 -0
  160. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/obfuscating.py +0 -0
  161. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/oschecks.py +0 -0
  162. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/pickle.py +0 -0
  163. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/python2_file_willnotwork.py +0 -0
  164. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/random.py +0 -0
  165. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/shelve.py +0 -0
  166. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/shutil.py +0 -0
  167. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/subprocess.py +0 -0
  168. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/syslibrary.py +0 -0
  169. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/tarfilevalidation.py +0 -0
  170. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/tempcheck.py +0 -0
  171. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/validation1.py +0 -0
  172. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/validation2.py +0 -0
  173. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/xml.py +0 -0
  174. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/zipfile.py +0 -0
  175. {codeaudit-1.4.1 → codeaudit-1.5.0}/tests/validationfiles/zstd.py +0 -0
@@ -1,9 +1,47 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 1.5.0:
4
+ Added:
5
+
6
+ * External Egress Risk Detection: New functionality to identify potential API keys or logic used for connecting to remote services. Reports now include the specific line and "keyword" associated with the identified risk.
7
+ *Note: External Egress Risk Detection is still experimental and in beta status! [Help improve it!](CONTRIBUTE).*
8
+
9
+ Changed:
10
+
11
+ * CLI HTML Reporting: Refined the reporting output for single file scans. Users will now see a clear, dedicated line when no security weaknesses are found.
12
+
13
+ * UI/UX Enhancements: Applied "Look & Feel" improvements across all HTML report templates for better readability and aesthetics.
14
+
15
+ * General CLI Polish: Improved various text strings throughout the Command Line Interface for better clarity.
16
+
17
+ Fixed:
18
+
19
+ * Error Messaging: Improved the descriptiveness and clarity of CLI error messages to assist in troubleshooting.
20
+
21
+ Documentation:
22
+
23
+ * Report Naming Conventions: Improved the titles of HTML reports. This ensures that when a user saves a report as a PDF via a browser, the default filename is more descriptive and professional.
24
+
25
+
26
+ ## Version 1.4.2: API updates and fixes
27
+
28
+ Added:
29
+ * Remote Package Scanning: The codeaudit.api_interfaces.filescan(input_path) function now supports PyPI.org packages directly. Users can scan packages by name without needing to clone the repository locally first.
30
+
31
+ Changed:
32
+ * CLI Improvements: Refined the command-line interface (CLI) help text for better clarity and updated information.
33
+
34
+ Fixed:
35
+ * Help Command Shortcut: Fixed an issue where the -? flag did not correctly trigger the help text. Running codeaudit [command] -? now displays the expected documentation.
36
+
37
+ Documentation:
38
+ * Performed a manual updates to improve readability and technical accuracy.
39
+
40
+
3
41
  ## Version 1.4.1: Bug fixes
4
42
 
5
43
  🚀 New Features & Enhancements
6
- * Remote PyPI Auditing: The codeaudit overview command now supports packages hosted directly on PyPI.org.
44
+ * Remote PyPI Auditing: The `codeaudit overview <directory|package>` command now supports creating an overview from packages hosted on PyPI.org. Consequently, local cloning is no longer required!
7
45
 
8
46
 
9
47
  🛠 Bug Fixes
@@ -2,12 +2,13 @@
2
2
 
3
3
  Great that you see this page and want to contribute!
4
4
 
5
- :::{tip}
6
- All contributions are welcome!
7
- Think of corrections on the manual, code and more or better tests.
8
- :::
5
+ > [!TIP]
6
+ >
7
+ > All contributions are welcome!
8
+ > Think of corrections on the manual, code and more or better tests.
9
9
 
10
- The **Codeaudit** code repository is hosted at [Github](github.com/nocomplexity/codeaudit).
10
+
11
+ The **Python Code Audit** code repository is hosted at [Github](github.com/nocomplexity/codeaudit).
11
12
 
12
13
  Simple Guidelines:
13
14
 
@@ -16,25 +17,25 @@ Simple Guidelines:
16
17
 
17
18
  This codeaudit tool is designed by applying [Zero Complexity By Design principles](https://nocomplexity.com/documents/0complexity/abstract.html). So the goal is to keep the tool simple to use and the code simple to adjust or to extend.
18
19
 
19
- :::{warning}
20
- This simple tool is designed to be simple to use and maintain.
21
- :::
20
+
21
+ > [!IMPORTANT]
22
+ > This simple tool is designed to be simple to use and maintain.
23
+
22
24
 
23
25
  **Pull Requests are welcome!**
24
26
 
25
- When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
27
+ When you contribute to **Python Code Audit**, your contributions are made under the same license as the file you are working on.
26
28
 
27
29
 
28
30
  We adopt the [Collective Code Construction Contract(C4)](https://rfc.zeromq.org/spec/42/) to streamline collaboration. C4 is meant to provide a reusable optimal collaboration model for open source software projects.
29
31
 
30
- :::{attention}
31
- This project values respect and inclusiveness, and enforces a [Code of Conduct](CoC-label) in all interactions.
32
- :::
32
+ > [!IMPORTANT]
33
+ > This project values respect and inclusiveness, and enforces a [Code of Conduct](CoC-label) in all interactions.
34
+
33
35
 
36
+ > [!NOTE]
37
+ > This is an open community driven project. Contributors will be mentioned in the documentation.
34
38
 
35
- :::{note}
36
- This is an open community driven project. Contributors will be mentioned in the documentation.
37
- :::
38
39
 
39
40
  (CoC-label)=
40
41
  ## Code of Conduct
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeaudit
3
- Version: 1.4.1
3
+ Version: 1.5.0
4
4
  Summary: Simplified static security checks for Python
5
5
  Project-URL: Documentation, https://github.com/nocomplexity/codeaudit#readme
6
6
  Project-URL: Issues, https://github.com/nocomplexity/codeaudit/issues
@@ -64,6 +64,10 @@ Python Code Audit has the following features:
64
64
 
65
65
  * **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
66
66
 
67
+
68
+ * **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
69
+
70
+
67
71
  * **HTML Reports**: All output is saved in simple, static HTML reports viewable in any browser.
68
72
 
69
73
 
@@ -100,20 +104,20 @@ This will show all commands:
100
104
 
101
105
  Python Code Audit - A modern Python security source code analyzer based on distrust.
102
106
 
107
+
103
108
  Commands to evaluate Python source code:
104
109
  Usage: codeaudit COMMAND <directory|package> [report.html]
105
110
 
106
111
  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.
107
112
 
108
113
  Commands:
109
- overview Reports complexity and security statistics of a Python project or package on PyPI.org.
110
- filescan Scans Python code or packages on PyPI.org for security weaknesses.
111
- modulescan Reports module vulnerability information.
114
+ overview Generates an overview report of code complexity and security indicators.
115
+ filescan Scans Python source code or PyPI packages for security weaknesses.
116
+ modulescan Generate a report on known vulnerabilities in Python modules and packages.
112
117
  checks Creates an HTML report of all implemented security checks.
113
118
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
114
119
 
115
- Use the Codeaudit documentation to check the security of Python programs and make your Python programs more secure!
116
- Check https://simplifysecurity.nocomplexity.com/
120
+ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to audit and secure your Python programmes. Explore further essential open-source security tools at https://simplifysecurity.nocomplexity.com/
117
121
  ```
118
122
 
119
123
  ## Example
@@ -36,6 +36,10 @@ Python Code Audit has the following features:
36
36
 
37
37
  * **Inline Issue Reporting**: Shows potential security issues with line numbers and code snippets.
38
38
 
39
+
40
+ * **External Egress Detection**: Identifies embedded API keys and logic that enables communication with remote services, helping uncover hidden data exfiltration paths.
41
+
42
+
39
43
  * **HTML Reports**: All output is saved in simple, static HTML reports viewable in any browser.
40
44
 
41
45
 
@@ -72,20 +76,20 @@ This will show all commands:
72
76
 
73
77
  Python Code Audit - A modern Python security source code analyzer based on distrust.
74
78
 
79
+
75
80
  Commands to evaluate Python source code:
76
81
  Usage: codeaudit COMMAND <directory|package> [report.html]
77
82
 
78
83
  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.
79
84
 
80
85
  Commands:
81
- overview Reports complexity and security statistics of a Python project or package on PyPI.org.
82
- filescan Scans Python code or packages on PyPI.org for security weaknesses.
83
- modulescan Reports module vulnerability information.
86
+ overview Generates an overview report of code complexity and security indicators.
87
+ filescan Scans Python source code or PyPI packages for security weaknesses.
88
+ modulescan Generate a report on known vulnerabilities in Python modules and packages.
84
89
  checks Creates an HTML report of all implemented security checks.
85
90
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
86
91
 
87
- Use the Codeaudit documentation to check the security of Python programs and make your Python programs more secure!
88
- Check https://simplifysecurity.nocomplexity.com/
92
+ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to audit and secure your Python programmes. Explore further essential open-source security tools at https://simplifysecurity.nocomplexity.com/
89
93
  ```
90
94
 
91
95
  ## Example
@@ -4,8 +4,22 @@ Great that you want to contribute!
4
4
 
5
5
  :::{tip}
6
6
  All contributions are welcome!
7
-
8
7
  Think of corrections on the manual, code and more or better tests.
8
+
9
+ +++
10
+
11
+ Not a coder? Not a problem! **Python Code Audit** is multifaceted, so I always can use help.
12
+ These are all activities we’d like to get help with :
13
+ - Writing and improving the documentation
14
+ - Code maintenance and development
15
+ - Community coordination
16
+ - Advocating Python secure programming
17
+ - Developing educational content
18
+ - Fundraising
19
+ - Marketing
20
+ - Project management
21
+ - Translating content
22
+ - Website design and development
9
23
  :::
10
24
 
11
25
  The **Codeaudit** code repository is hosted at [Github](https://github.com/nocomplexity/codeaudit).
@@ -2,23 +2,29 @@ format: jb-book
2
2
  root: intro
3
3
 
4
4
  parts:
5
- - caption: Quick Start
5
+ - caption: Getting Started
6
6
  chapters:
7
7
  - file: features
8
+ - file: installation
8
9
  - file: howtoscan
10
+ - file: whatissast
11
+ - file: whysast
12
+
13
+
14
+
15
+ - caption: User Guide
16
+ chapters:
9
17
  - file: userguide
10
18
  sections:
11
19
  - file: codeauditoverview
12
20
  - file: filescan
13
21
  - file: modulescan
14
22
  - file: codeauditchecks
15
- - file: whatissast
16
- - file: whysast
17
23
  - file: issues
18
-
19
-
20
- - caption: Security Checks
21
- chapters:
24
+ - file: securecoding
25
+ - file: complexitycheck
26
+ - file: warnings
27
+ - file: handling_errors
22
28
  - file: implementedvalidations
23
29
  - file: checksinformation
24
30
  sections:
@@ -47,17 +53,14 @@ parts:
47
53
  - file: checks/xml_check
48
54
  - file: checks/zipfile_check
49
55
  - file: checks/shutil_check
50
- - file: securecoding
56
+
51
57
 
52
58
  - caption: Architecture
53
59
  chapters:
54
60
  #- file: astlines
55
61
  # - file: astlines2
56
62
  - file: makeitbetter
57
- - file: project_philosophy
58
- - file: complexitycheck
59
- - file: warnings
60
- - file: handling_errors
63
+ - file: project_philosophy
61
64
  - file: codeauditcommands
62
65
  - file: changelog
63
66
 
@@ -67,6 +70,8 @@ parts:
67
70
  - file: apidocs/api_intro
68
71
  sections:
69
72
  - file: examples/ca_api_example_overview
73
+ - file: examples/ca_api_example_checks
74
+ - file: examples/ca_api_example_scanning
70
75
  - file: examples/ca_api_example_json
71
76
  - file: examples/ca_api_example_basic
72
77
  - file: apidocs/modules
@@ -0,0 +1,26 @@
1
+ # APIs and Examples
2
+
3
+ The Python Code Audit APIs empower you to build your own Python security tools or create seamless integrations you need! Leverage our standardized JSON output to enhance your development workflow in the following ways:
4
+
5
+ * **Automated Scanning**: Perform deep security analysis on local files, directories, or PyPI.org packages. Use the structured JSON output to trigger custom logic or automated remediation.
6
+
7
+ +++
8
+
9
+ * **Custom Reporting & Dashboards**: Transform audit results into visual insights. The human-readable JSON export makes it easy to feed data into custom monitoring dashboards or BI tools.
10
+
11
+ +++
12
+
13
+
14
+ * **Security Statistical Analysis**: Identify trends and recurring vulnerabilities. Use the APIs to study security weaknesses across your organization’s entire Python ecosystem to improve coding standards.
15
+
16
+ +++
17
+
18
+
19
+ * **Seamless CI/CD Integration**: Embed security audits directly into your deployment pipelines. The APIs fully support remote source control systems, including GitHub, GitLab, [Codeberg](https://codeberg.org/), [NotABug](https://notabug.org/), and other Git-based platforms.
20
+
21
+ ## Getting Started
22
+ We have provided several practical examples to help you implement these APIs effectively and secure your codebase with minimal friction.
23
+
24
+
25
+ ```{tableofcontents}
26
+ ```
@@ -1,4 +1,4 @@
1
- # Information on checks
1
+ # Detections & Mitigations
2
2
 
3
3
  **Python Code Audit** has many implemented security checks based on possible security threats when using Python Standard Library (PSL) calls.
4
4
 
@@ -0,0 +1,240 @@
1
+ % THIS FILE IS GENERATED! - Use CLIcommands.ipynb to make it better!
2
+ # Commands Overview
3
+ Python Code Audit commands for: version: 1.5.0
4
+ ```
5
+ ----------------------------------------------------
6
+ _ __ _
7
+ |_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
8
+ | / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
9
+ ----------------------------------------------------
10
+
11
+ Python Code Audit - A modern Python security source code analyzer based on distrust.
12
+
13
+ Commands to evaluate Python source code:
14
+ Usage: codeaudit COMMAND <directory|package> [report.html]
15
+
16
+ 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.
17
+
18
+ Commands:
19
+ overview Generates an overview report of code complexity and security indicators.
20
+ filescan Scans Python source code or PyPI packages for security weaknesses.
21
+ modulescan Generate a report on known vulnerabilities in Python modules and packages.
22
+ checks Creates an HTML report of all implemented security checks.
23
+ version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
24
+
25
+ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to audit and secure your Python programmes. Explore further essential open-source security tools at https://simplifysecurity.nocomplexity.com/
26
+
27
+ ```
28
+ ## codeaudit overview
29
+ ```text
30
+ Generates an overview report of code complexity and security indicators.
31
+
32
+ This function analyzes a Python project to produce a high-level overview of
33
+ complexity and security-related metrics. The input may be either:
34
+
35
+ - A local directory containing Python source files
36
+ - The name of a package hosted on PyPI.org
37
+
38
+ So:
39
+ codeaudit overview <package-name|directory> [reportname.html]
40
+
41
+ For PyPI packages, the source distribution (sdist) is downloaded,
42
+ extracted to a temporary directory, scanned, and removed after the report
43
+ is generated.
44
+
45
+ The report includes summary statistics, security risk indicators based on
46
+ complexity and total lines of code, a list of discovered modules, per-file
47
+ metrics, and a visual overview. Results are written to a static HTML file.
48
+
49
+ Examples:
50
+ Generate an overview report for a local project directory::
51
+
52
+ codeaudit overview /projects/mycolleaguesproject
53
+
54
+ Generate an overview report for a PyPI package::
55
+
56
+ codeaudit overview linkaudit #A nice project on PyPI.org
57
+
58
+ codeaudit overview pydantic #A complex project on PyPI.org from a security perspective?
59
+
60
+ Args:
61
+ directory (str): Path to a local directory containing Python source files
62
+ or the name of a package available on PyPI.org.
63
+ filename (str, optional): Name (and optional path) of the HTML file to
64
+ write the overview report to. The filename should use the ``.html``
65
+ extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
66
+
67
+ Returns:
68
+ None. The function writes a static HTML overview report to disk.
69
+
70
+ Raises:
71
+ SystemExit: If the provided path is not a directory, contains no Python
72
+ files, or is neither a valid local directory nor a valid PyPI
73
+ package name.
74
+ str(object='') -> str
75
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
76
+
77
+ Create a new string object from the given object. If encoding or
78
+ errors is specified, then the object must expose a data buffer
79
+ that will be decoded using the given encoding and error handler.
80
+ Otherwise, returns the result of object.__str__() (if defined)
81
+ or repr(object).
82
+ encoding defaults to 'utf-8'.
83
+ errors defaults to 'strict'.
84
+ ```
85
+ ## codeaudit modulescan
86
+ ```text
87
+
88
+ Generate a report on known vulnerabilities in Python modules and packages.
89
+
90
+ This function analyzes a single Python file to identify imported
91
+ external modules and checks those modules against the OSV vulnerability
92
+ database. The collected results are written to a static HTML report.
93
+
94
+ If the input refers to a valid PyPI package name instead of a local Python
95
+ file, the function generates a vulnerability report directly for that
96
+ package.
97
+
98
+ While processing modules, progress information is printed to standard
99
+ output.
100
+
101
+ Example:
102
+ Generate a module vulnerability report for a Python file::
103
+
104
+ codeaudit modulescan <pythonfile>|<package> [yourreportname.html]
105
+
106
+ codeaudit modulescan mypythonfile.py
107
+
108
+ Args:
109
+ inputfile (str): Path to a Python source file (*.py) to analyze, or the
110
+ name of a package available on PyPI.
111
+ reportname (str, optional): Name (and optional path) of the HTML file to
112
+ write the vulnerability report to. The filename should use the
113
+ ``.html`` extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
114
+
115
+ Returns:
116
+ None: The function writes a static HTML report to disk.
117
+
118
+ Raises:
119
+ SystemExit: If the input is not a valid Python file or a valid PyPI
120
+ package. File parsing and I/O errors are reported via standard
121
+ output before exiting.
122
+ str(object='') -> str
123
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
124
+
125
+ Create a new string object from the given object. If encoding or
126
+ errors is specified, then the object must expose a data buffer
127
+ that will be decoded using the given encoding and error handler.
128
+ Otherwise, returns the result of object.__str__() (if defined)
129
+ or repr(object).
130
+ encoding defaults to 'utf-8'.
131
+ errors defaults to 'strict'.
132
+ ```
133
+ ## codeaudit filescan
134
+ ```text
135
+ Scans Python source code or PyPI packages for security weaknesses.
136
+
137
+ This function performs static application security testing (SAST) on a
138
+ given input, which can be:
139
+
140
+ - A local directory containing Python source code
141
+ - A single local Python file
142
+ - A package name hosted on PyPI.org
143
+
144
+ codeaudit filescan <pythonfile|package-name|directory> [reportname.html]
145
+
146
+ Depending on the input type, the function analyzes the source code for
147
+ potential security issues, generates an HTML report summarizing the
148
+ findings, and writes the report to a static HTML file.
149
+
150
+ If a PyPI package name is provided, the function downloads the source
151
+ distribution (sdist), scans the extracted source code, and removes all
152
+ temporary files after the scan completes.
153
+
154
+ Example:
155
+ Scan a local directory and write the report to ``report.html``::
156
+
157
+ codeaudit filescan_/shitwork/custompythonmodule/
158
+
159
+ Scan a single Python file::
160
+
161
+ codeaudit filescan myexample.py
162
+
163
+ Scan a package hosted on PyPI::
164
+
165
+ codeaudit filescan linkaudit #A nice project to check broken links in markdown files
166
+
167
+ codeaudit filescan requests
168
+
169
+ Args:
170
+ input_path (str): Path to a local Python file or directory, or the name
171
+ of a package available on PyPI.org.
172
+ filename (str, optional): Name (and optional path) of the HTML file to
173
+ write the scan report to. The filename should use the ``.html``
174
+ extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
175
+
176
+ Returns:
177
+ None. The function writes a static HTML security report to disk.
178
+
179
+ Raises:
180
+ None explicitly. Errors and invalid inputs are reported to stdout.
181
+ str(object='') -> str
182
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
183
+
184
+ Create a new string object from the given object. If encoding or
185
+ errors is specified, then the object must expose a data buffer
186
+ that will be decoded using the given encoding and error handler.
187
+ Otherwise, returns the result of object.__str__() (if defined)
188
+ or repr(object).
189
+ encoding defaults to 'utf-8'.
190
+ errors defaults to 'strict'.
191
+ ```
192
+ ## codeaudit checks
193
+ ```text
194
+
195
+ Creates an HTML report of all implemented security checks.
196
+
197
+ This report provides a user-friendly overview of the static security checks
198
+ currently supported by Python Code Audit. It is intended to make it easier to review
199
+ the available validations without digging through the codebase.
200
+
201
+ The generated HTML includes:
202
+ - A table of all implemented checks
203
+ - The number of validations
204
+ - The version of Python Code Audit (codeaudit) used
205
+ - A disclaimer about version-specific reporting
206
+
207
+ The report is saved to the specified filename and is formatted to be
208
+ embeddable in larger multi-report documents.
209
+
210
+ Help me continue developing Python Code Audit as free and open-source software.
211
+ Join the community to contribute to the most complete, local first , Python Security Static scanner.
212
+ Help!! Join the journey, check: https://github.com/nocomplexity/codeaudit#contributing
213
+
214
+
215
+ Parameters:
216
+ filename (str): The output HTML filename. Defaults to 'codeaudit_checks.html'.
217
+ str(object='') -> str
218
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
219
+
220
+ Create a new string object from the given object. If encoding or
221
+ errors is specified, then the object must expose a data buffer
222
+ that will be decoded using the given encoding and error handler.
223
+ Otherwise, returns the result of object.__str__() (if defined)
224
+ or repr(object).
225
+ encoding defaults to 'utf-8'.
226
+ errors defaults to 'strict'.
227
+ ```
228
+ ## codeaudit version
229
+ ```text
230
+ Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].str(object='') -> str
231
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
232
+
233
+ Create a new string object from the given object. If encoding or
234
+ errors is specified, then the object must expose a data buffer
235
+ that will be decoded using the given encoding and error handler.
236
+ Otherwise, returns the result of object.__str__() (if defined)
237
+ or repr(object).
238
+ encoding defaults to 'utf-8'.
239
+ errors defaults to 'strict'.
240
+ ```