codeaudit 1.4.0__tar.gz → 1.4.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.
- {codeaudit-1.4.0 → codeaudit-1.4.2}/CHANGELOG.md +30 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/CONTRIBUTE.md +16 -15
- {codeaudit-1.4.0 → codeaudit-1.4.2}/PKG-INFO +12 -19
- {codeaudit-1.4.0 → codeaudit-1.4.2}/README.md +11 -18
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/CLIcommands.ipynb +2 -2
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/CONTRIBUTE.md +15 -1
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/_toc.yml +2 -0
- codeaudit-1.4.2/docs/apidocs/api_intro.md +26 -0
- codeaudit-1.4.2/docs/codeauditcommands.md +230 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/codeauditoverview.md +15 -4
- codeaudit-1.4.2/docs/examples/ca_api_example_basic.ipynb +707 -0
- codeaudit-1.4.2/docs/examples/ca_api_example_checks.ipynb +395 -0
- codeaudit-1.4.2/docs/examples/ca_api_example_scanning.ipynb +195 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/demoscan.json +2 -2
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/intro.md +71 -4
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/whysast.md +2 -2
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/__about__.py +1 -1
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/api_interfaces.py +143 -37
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/codeaudit.py +13 -10
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/pypi_package_scan.py +25 -26
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/reporting.py +169 -40
- codeaudit-1.4.2/tests/test_pypiscan.py +69 -0
- codeaudit-1.4.0/docs/apidocs/api_intro.md +0 -19
- codeaudit-1.4.0/docs/codeauditcommands.md +0 -130
- codeaudit-1.4.0/docs/examples/ca_api_example_basic.ipynb +0 -191
- codeaudit-1.4.0/tests/test_pypiscan.py +0 -624
- {codeaudit-1.4.0 → codeaudit-1.4.2}/.gitignore +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/LICENSE.txt +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/SECURITY.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/_config.yml +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/_static/nocxstyle.css +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/about.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/apidocs/codeaudit.rst +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/apidocs/modules.rst +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/astlines.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/astlines2.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/changelog.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/assert_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/base64_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/binding_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/builtinfunctions_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/chmod_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/directorycreation_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/dynamicimport_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/exception_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/hash_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/httpserver_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/input_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/loggingconf_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/marshal_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/mktemp_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/multiprocessing_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/pickle_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/random_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/shelve_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/shutil_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/subprocess_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/syscalls_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/systemcalls_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/tarfile_extract_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/xml_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checks/zipfile_check.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/checksinformation.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/codeauditchecks.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/complexitycheck.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/ca_api_example_json.ipynb +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/ca_api_example_overview.ipynb +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/checks.html +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/demofile.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/directoryscan.html +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/filescan.html +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/modulescan.html +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/examples/overview.html +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/features.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/filescan.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/filescan.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/handling_errors.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/help.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/howtoscan.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/images/OO.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/images/ROI_logo.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/images/YourLogoHere.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/images/codeauditlogo.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/images/nocxbanner.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/images/overview_linkaudit.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/implementedvalidations.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/issues.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/license.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/makeitbetter.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/modulescan.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/overviewplot.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/pca_overview.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/project_philosophy.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/securecoding.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/sponsors.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/userguide.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/warnings.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/docs/whatissast.md +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/filescan.png +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/pyproject.toml +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/__init__.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/altairplots.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/api_reporting.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/checkmodules.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/complexitycheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/data/sastchecks.csv +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/filehelpfunctions.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/htmlhelpfunctions.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/issuevalidations.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/security_checks.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/simple.css +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/src/codeaudit/totals.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/__init__.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/count_lines_file1.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_apicalls.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_basicpatterns.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_chmod.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_constructspart2.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_correctexceptionuse.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_count_commentlines.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_directorycreation.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_directorycreation2.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_hashstrenght.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_modulecheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_obfuscatingbuiltins.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_oschecks.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_random.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_standardlibconstructs.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_totalscheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/test_zstd.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/allshit.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/assert.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/base64.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/chmod_things.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/complexitycheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/correctcounts.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/directorycreation.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/directorycreation2.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/dunderexec_with_parsing_error.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/exception.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/file3.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/file_with_warnings.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/gzip.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/hashcheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/httpserver.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/inputstatement.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/marshal.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/modulecheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/multiprocessing.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/obfuscating.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/oschecks.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/pickle.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/python2_file_willnotwork.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/random.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/shelve.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/shutil.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/subprocess.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/syslibrary.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/tarfilevalidation.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/tempcheck.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/validation1.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/validation2.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/xml.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/zipfile.py +0 -0
- {codeaudit-1.4.0 → codeaudit-1.4.2}/tests/validationfiles/zstd.py +0 -0
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## Version 1.4.2: API updates and fixes
|
|
4
|
+
|
|
5
|
+
Added:
|
|
6
|
+
* 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.
|
|
7
|
+
|
|
8
|
+
Changed:
|
|
9
|
+
* CLI Improvements: Refined the command-line interface (CLI) help text for better clarity and updated information.
|
|
10
|
+
|
|
11
|
+
Fixed:
|
|
12
|
+
* Help Command Shortcut: Fixed an issue where the -? flag did not correctly trigger the help text. Running codeaudit [command] -? now displays the expected documentation.
|
|
13
|
+
|
|
14
|
+
Documentation:
|
|
15
|
+
* Performed a manual updates to improve readability and technical accuracy.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Version 1.4.1: Bug fixes
|
|
19
|
+
|
|
20
|
+
🚀 New Features & Enhancements
|
|
21
|
+
* 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!
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
🛠 Bug Fixes
|
|
25
|
+
* Improved sdist Resilience: Enhanced error handling for scenarios where a package exists on PyPI but a source distribution (sdist) is unavailable.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
📝 Documentation & UI Updates
|
|
29
|
+
* CLI Improvements: Refined terminal text and messaging for better clarity during operation.
|
|
30
|
+
* Manual Update: The user manual has been updated to reflect new command capabilities and workflows.
|
|
31
|
+
|
|
32
|
+
|
|
3
33
|
## Version 1.4: Changes and Updates
|
|
4
34
|
|
|
5
35
|
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Great that you see this page and want to contribute!
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
3
|
+
Version: 1.4.2
|
|
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
|
|
@@ -74,17 +74,12 @@ Python Code Audit has the following features:
|
|
|
74
74
|
|
|
75
75
|
## Installation
|
|
76
76
|
|
|
77
|
-
```console
|
|
78
|
-
pip install codeaudit
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
or use:
|
|
82
|
-
|
|
83
77
|
```console
|
|
84
78
|
pip install -U codeaudit
|
|
85
79
|
```
|
|
86
80
|
|
|
87
|
-
If you have installed Python
|
|
81
|
+
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.
|
|
82
|
+
|
|
88
83
|
|
|
89
84
|
## Usage
|
|
90
85
|
|
|
@@ -106,34 +101,32 @@ This will show all commands:
|
|
|
106
101
|
Python Code Audit - A modern Python security source code analyzer based on distrust.
|
|
107
102
|
|
|
108
103
|
Commands to evaluate Python source code:
|
|
109
|
-
Usage: codeaudit COMMAND
|
|
104
|
+
Usage: codeaudit COMMAND <directory|package> [report.html]
|
|
110
105
|
|
|
111
|
-
Depending on the command, a directory
|
|
106
|
+
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.
|
|
112
107
|
|
|
113
108
|
Commands:
|
|
114
|
-
overview
|
|
115
|
-
filescan Scans Python
|
|
116
|
-
modulescan
|
|
109
|
+
overview Generates an overview report of code complexity and security indicators.
|
|
110
|
+
filescan Scans Python source code or PyPI packages for security weaknesses.
|
|
111
|
+
modulescan Generates a vulnerability report for imported Python modules.
|
|
117
112
|
checks Creates an HTML report of all implemented security checks.
|
|
118
113
|
version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
|
|
119
114
|
|
|
120
|
-
Use the
|
|
121
|
-
Check https://simplifysecurity.nocomplexity.com/
|
|
122
|
-
|
|
115
|
+
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/
|
|
123
116
|
```
|
|
124
117
|
|
|
125
118
|
## Example
|
|
126
119
|
|
|
127
|
-
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **
|
|
120
|
+
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **80 validations** implemented.
|
|
128
121
|
|
|
129
122
|
The `codeaudit filescan` command shows all **potential** security issues that are detected in the source file in a HTML-report.
|
|
130
123
|
|
|
131
124
|
Per line a the in construct that can cause a security risks is shown, along with the relevant code lines where the issue is detected.
|
|
132
125
|
|
|
133
|
-
To scan a Python
|
|
126
|
+
To scan a Python package on PyPI.org on possible security issues, do:
|
|
134
127
|
|
|
135
128
|
```bash
|
|
136
|
-
codeaudit filescan
|
|
129
|
+
codeaudit filescan <package-name> [reportname.html]
|
|
137
130
|
|
|
138
131
|
=====================================================================
|
|
139
132
|
Codeaudit report file created!
|
|
@@ -46,17 +46,12 @@ Python Code Audit has the following features:
|
|
|
46
46
|
|
|
47
47
|
## Installation
|
|
48
48
|
|
|
49
|
-
```console
|
|
50
|
-
pip install codeaudit
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
or use:
|
|
54
|
-
|
|
55
49
|
```console
|
|
56
50
|
pip install -U codeaudit
|
|
57
51
|
```
|
|
58
52
|
|
|
59
|
-
If you have installed Python
|
|
53
|
+
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.
|
|
54
|
+
|
|
60
55
|
|
|
61
56
|
## Usage
|
|
62
57
|
|
|
@@ -78,34 +73,32 @@ This will show all commands:
|
|
|
78
73
|
Python Code Audit - A modern Python security source code analyzer based on distrust.
|
|
79
74
|
|
|
80
75
|
Commands to evaluate Python source code:
|
|
81
|
-
Usage: codeaudit COMMAND
|
|
76
|
+
Usage: codeaudit COMMAND <directory|package> [report.html]
|
|
82
77
|
|
|
83
|
-
Depending on the command, a directory
|
|
78
|
+
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.
|
|
84
79
|
|
|
85
80
|
Commands:
|
|
86
|
-
overview
|
|
87
|
-
filescan Scans Python
|
|
88
|
-
modulescan
|
|
81
|
+
overview Generates an overview report of code complexity and security indicators.
|
|
82
|
+
filescan Scans Python source code or PyPI packages for security weaknesses.
|
|
83
|
+
modulescan Generates a vulnerability report for imported Python modules.
|
|
89
84
|
checks Creates an HTML report of all implemented security checks.
|
|
90
85
|
version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
|
|
91
86
|
|
|
92
|
-
Use the
|
|
93
|
-
Check https://simplifysecurity.nocomplexity.com/
|
|
94
|
-
|
|
87
|
+
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/
|
|
95
88
|
```
|
|
96
89
|
|
|
97
90
|
## Example
|
|
98
91
|
|
|
99
|
-
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **
|
|
92
|
+
By running the `codeaudit filescan` command, detailed security information is determined for a Python file based on more than **80 validations** implemented.
|
|
100
93
|
|
|
101
94
|
The `codeaudit filescan` command shows all **potential** security issues that are detected in the source file in a HTML-report.
|
|
102
95
|
|
|
103
96
|
Per line a the in construct that can cause a security risks is shown, along with the relevant code lines where the issue is detected.
|
|
104
97
|
|
|
105
|
-
To scan a Python
|
|
98
|
+
To scan a Python package on PyPI.org on possible security issues, do:
|
|
106
99
|
|
|
107
100
|
```bash
|
|
108
|
-
codeaudit filescan
|
|
101
|
+
codeaudit filescan <package-name> [reportname.html]
|
|
109
102
|
|
|
110
103
|
=====================================================================
|
|
111
104
|
Codeaudit report file created!
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"cell_type": "code",
|
|
93
|
-
"execution_count":
|
|
93
|
+
"execution_count": null,
|
|
94
94
|
"id": "bf6afe56-e0f7-4fa2-a3a5-968bad11bf9c",
|
|
95
95
|
"metadata": {},
|
|
96
96
|
"outputs": [],
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
" \"checks\" : 'report_implemented_tests',\n",
|
|
102
102
|
" \"version\" : 'display_version'} \n",
|
|
103
103
|
"for key, value in commands.items(): \n",
|
|
104
|
-
" output += f'##
|
|
104
|
+
" output += f'## codeaudit {key}\\n' # newlines matter when creating markdown\n",
|
|
105
105
|
" output += '```text\\n' # raw display \n",
|
|
106
106
|
" func_name = value\n",
|
|
107
107
|
" output += getattr(codeaudit, func_name).__doc__\n",
|
|
@@ -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).
|
|
@@ -67,6 +67,8 @@ parts:
|
|
|
67
67
|
- file: apidocs/api_intro
|
|
68
68
|
sections:
|
|
69
69
|
- file: examples/ca_api_example_overview
|
|
70
|
+
- file: examples/ca_api_example_checks
|
|
71
|
+
- file: examples/ca_api_example_scanning
|
|
70
72
|
- file: examples/ca_api_example_json
|
|
71
73
|
- file: examples/ca_api_example_basic
|
|
72
74
|
- 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
|
+
```
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
% THIS FILE IS GENERATED! - Use CLIcommands.ipynb to make it better!
|
|
2
|
+
# Commands Overview
|
|
3
|
+
Python Code Audit commands for: version: 1.4.2
|
|
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 Generates a vulnerability report for imported Python modules.
|
|
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
|
+
For PyPI packages, the source distribution (sdist) is downloaded,
|
|
39
|
+
extracted to a temporary directory, scanned, and removed after the report
|
|
40
|
+
is generated.
|
|
41
|
+
|
|
42
|
+
The report includes summary statistics, security risk indicators based on
|
|
43
|
+
complexity and total lines of code, a list of discovered modules, per-file
|
|
44
|
+
metrics, and a visual overview. Results are written to a static HTML file.
|
|
45
|
+
|
|
46
|
+
Examples:
|
|
47
|
+
Generate an overview report for a local project directory::
|
|
48
|
+
|
|
49
|
+
codeaudit overview /projects/mycolleaguesproject
|
|
50
|
+
|
|
51
|
+
Generate an overview report for a PyPI package::
|
|
52
|
+
|
|
53
|
+
codeaudit overview linkaudit #A nice project on PyPI.org
|
|
54
|
+
|
|
55
|
+
codeaudit overview pydantic #A complex project on PyPI.org from a security perspective?
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
directory (str): Path to a local directory containing Python source files
|
|
59
|
+
or the name of a package available on PyPI.org.
|
|
60
|
+
filename (str, optional): Name (and optional path) of the HTML file to
|
|
61
|
+
write the overview report to. The filename should use the ``.html``
|
|
62
|
+
extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
None. The function writes a static HTML overview report to disk.
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
SystemExit: If the provided path is not a directory, contains no Python
|
|
69
|
+
files, or is neither a valid local directory nor a valid PyPI
|
|
70
|
+
package name.
|
|
71
|
+
str(object='') -> str
|
|
72
|
+
str(bytes_or_buffer[, encoding[, errors]]) -> str
|
|
73
|
+
|
|
74
|
+
Create a new string object from the given object. If encoding or
|
|
75
|
+
errors is specified, then the object must expose a data buffer
|
|
76
|
+
that will be decoded using the given encoding and error handler.
|
|
77
|
+
Otherwise, returns the result of object.__str__() (if defined)
|
|
78
|
+
or repr(object).
|
|
79
|
+
encoding defaults to 'utf-8'.
|
|
80
|
+
errors defaults to 'strict'.
|
|
81
|
+
```
|
|
82
|
+
## codeaudit modulescan
|
|
83
|
+
```text
|
|
84
|
+
Generates a vulnerability report for imported Python modules.
|
|
85
|
+
|
|
86
|
+
This function analyzes a single Python source file to identify imported
|
|
87
|
+
modules and checks externally imported modules against the OSV vulnerability
|
|
88
|
+
database. The results are compiled into a static HTML report.
|
|
89
|
+
|
|
90
|
+
For each detected external module, the report indicates whether known
|
|
91
|
+
vulnerability information exists and, if available, includes detailed
|
|
92
|
+
vulnerability data.
|
|
93
|
+
|
|
94
|
+
Progress information is printed to stdout while processing modules.
|
|
95
|
+
|
|
96
|
+
Example:
|
|
97
|
+
Generate a module vulnerability report for a Python file::
|
|
98
|
+
|
|
99
|
+
codeaudit modulescan mypythonfile.py
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
inputfile (str): Path to the Python source file to analyze.
|
|
103
|
+
reportname (str, optional): Name (and optional path) of the HTML file
|
|
104
|
+
to write the module vulnerability report to. The filename should
|
|
105
|
+
use the ``.html`` extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
None. The function writes a static HTML report to disk.
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
None explicitly. File reading errors or invalid input are reported
|
|
112
|
+
via standard output.
|
|
113
|
+
|
|
114
|
+
str(object='') -> str
|
|
115
|
+
str(bytes_or_buffer[, encoding[, errors]]) -> str
|
|
116
|
+
|
|
117
|
+
Create a new string object from the given object. If encoding or
|
|
118
|
+
errors is specified, then the object must expose a data buffer
|
|
119
|
+
that will be decoded using the given encoding and error handler.
|
|
120
|
+
Otherwise, returns the result of object.__str__() (if defined)
|
|
121
|
+
or repr(object).
|
|
122
|
+
encoding defaults to 'utf-8'.
|
|
123
|
+
errors defaults to 'strict'.
|
|
124
|
+
```
|
|
125
|
+
## codeaudit filescan
|
|
126
|
+
```text
|
|
127
|
+
Scans Python source code or PyPI packages for security weaknesses.
|
|
128
|
+
|
|
129
|
+
This function performs static application security testing (SAST) on a
|
|
130
|
+
given input, which can be:
|
|
131
|
+
|
|
132
|
+
- A local directory containing Python source code
|
|
133
|
+
- A single local Python file
|
|
134
|
+
- A package name hosted on PyPI.org
|
|
135
|
+
|
|
136
|
+
Depending on the input type, the function analyzes the source code for
|
|
137
|
+
potential security issues, generates an HTML report summarizing the
|
|
138
|
+
findings, and writes the report to a static HTML file.
|
|
139
|
+
|
|
140
|
+
If a PyPI package name is provided, the function downloads the source
|
|
141
|
+
distribution (sdist), scans the extracted source code, and removes all
|
|
142
|
+
temporary files after the scan completes.
|
|
143
|
+
|
|
144
|
+
Example:
|
|
145
|
+
Scan a local directory and write the report to ``report.html``::
|
|
146
|
+
|
|
147
|
+
codeaudit filescan_/shitwork/custompythonmodule/
|
|
148
|
+
|
|
149
|
+
Scan a single Python file::
|
|
150
|
+
|
|
151
|
+
codeaudit filescan myexample.py
|
|
152
|
+
|
|
153
|
+
Scan a package hosted on PyPI::
|
|
154
|
+
|
|
155
|
+
codeaudit filescan linkaudit #A nice project to check broken links in markdown files
|
|
156
|
+
|
|
157
|
+
codeaudit filescan requests
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
input_path (str): Path to a local Python file or directory, or the name
|
|
161
|
+
of a package available on PyPI.org.
|
|
162
|
+
filename (str, optional): Name (and optional path) of the HTML file to
|
|
163
|
+
write the scan report to. The filename should use the ``.html``
|
|
164
|
+
extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
None. The function writes a static HTML security report to disk.
|
|
168
|
+
|
|
169
|
+
Raises:
|
|
170
|
+
None explicitly. Errors and invalid inputs are reported to stdout.
|
|
171
|
+
str(object='') -> str
|
|
172
|
+
str(bytes_or_buffer[, encoding[, errors]]) -> str
|
|
173
|
+
|
|
174
|
+
Create a new string object from the given object. If encoding or
|
|
175
|
+
errors is specified, then the object must expose a data buffer
|
|
176
|
+
that will be decoded using the given encoding and error handler.
|
|
177
|
+
Otherwise, returns the result of object.__str__() (if defined)
|
|
178
|
+
or repr(object).
|
|
179
|
+
encoding defaults to 'utf-8'.
|
|
180
|
+
errors defaults to 'strict'.
|
|
181
|
+
```
|
|
182
|
+
## codeaudit checks
|
|
183
|
+
```text
|
|
184
|
+
|
|
185
|
+
Creates an HTML report of all implemented security checks.
|
|
186
|
+
|
|
187
|
+
This report provides a user-friendly overview of the static security checks
|
|
188
|
+
currently supported by Python Code Audit. It is intended to make it easier to review
|
|
189
|
+
the available validations without digging through the codebase.
|
|
190
|
+
|
|
191
|
+
The generated HTML includes:
|
|
192
|
+
- A table of all implemented checks
|
|
193
|
+
- The number of validations
|
|
194
|
+
- The version of Python Code Audit (codeaudit) used
|
|
195
|
+
- A disclaimer about version-specific reporting
|
|
196
|
+
|
|
197
|
+
The report is saved to the specified filename and is formatted to be
|
|
198
|
+
embeddable in larger multi-report documents.
|
|
199
|
+
|
|
200
|
+
Help me continue developing Python Code Audit as free and open-source software.
|
|
201
|
+
Join the community to contribute to the most complete, local first , Python Security Static scanner.
|
|
202
|
+
Help!! Join the journey, check: https://github.com/nocomplexity/codeaudit#contributing
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
Parameters:
|
|
206
|
+
filename (str): The output HTML filename. Defaults to 'codeaudit_checks.html'.
|
|
207
|
+
str(object='') -> str
|
|
208
|
+
str(bytes_or_buffer[, encoding[, errors]]) -> str
|
|
209
|
+
|
|
210
|
+
Create a new string object from the given object. If encoding or
|
|
211
|
+
errors is specified, then the object must expose a data buffer
|
|
212
|
+
that will be decoded using the given encoding and error handler.
|
|
213
|
+
Otherwise, returns the result of object.__str__() (if defined)
|
|
214
|
+
or repr(object).
|
|
215
|
+
encoding defaults to 'utf-8'.
|
|
216
|
+
errors defaults to 'strict'.
|
|
217
|
+
```
|
|
218
|
+
## codeaudit version
|
|
219
|
+
```text
|
|
220
|
+
Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].str(object='') -> str
|
|
221
|
+
str(bytes_or_buffer[, encoding[, errors]]) -> str
|
|
222
|
+
|
|
223
|
+
Create a new string object from the given object. If encoding or
|
|
224
|
+
errors is specified, then the object must expose a data buffer
|
|
225
|
+
that will be decoded using the given encoding and error handler.
|
|
226
|
+
Otherwise, returns the result of object.__str__() (if defined)
|
|
227
|
+
or repr(object).
|
|
228
|
+
encoding defaults to 'utf-8'.
|
|
229
|
+
errors defaults to 'strict'.
|
|
230
|
+
```
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
# Command `codeaudit overview`
|
|
3
3
|
|
|
4
|
-
The command:
|
|
5
4
|
|
|
5
|
+
|
|
6
|
+
Use this command to generate a quick security relevant assessment of a Python project or package. It provides an overview of important security metrics for the project.
|
|
7
|
+
|
|
8
|
+
Usage
|
|
9
|
+
```Bash
|
|
10
|
+
codeaudit overview <package-path|package-name> [report-name.html]
|
|
6
11
|
```
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
|
|
13
|
+
Arguments:
|
|
14
|
+
* `<package-path|package-name>` (Required)
|
|
15
|
+
Specify either a local directory containing Python files or the name of a Python package hosted on PyPI.org.
|
|
16
|
+
|
|
17
|
+
* `[report-name.html]` (Optional)
|
|
18
|
+
The filename for the generated security report. If omitted, the tool will use a default filename. If you provide a custom name, ensure it ends with the `.html` extension.
|
|
19
|
+
|
|
20
|
+
|
|
10
21
|
|
|
11
22
|
For every Python file the following **security** relevant statistics are determined:
|
|
12
23
|
|