rust-audit 0.2.3__py3-none-any.whl

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.
@@ -0,0 +1,293 @@
1
+ # Baseline of well-known crates used for:
2
+ # R20 potential typosquat detection (edit distance <= 2 from a popular name)
3
+ # R18c near-miss suggestions ("serdee" -> "serde")
4
+ # Keep this list mainstream and well-known. Extend it with your org's stack.
5
+ serde
6
+ serde_json
7
+ serde_derive
8
+ serde_yaml
9
+ tokio
10
+ tokio-util
11
+ tokio-stream
12
+ async-trait
13
+ async-std
14
+ futures
15
+ futures-util
16
+ mio
17
+ rand
18
+ rand_core
19
+ clap
20
+ structopt
21
+ anyhow
22
+ thiserror
23
+ eyre
24
+ color-eyre
25
+ regex
26
+ log
27
+ env_logger
28
+ tracing
29
+ tracing-subscriber
30
+ tracing-core
31
+ axum
32
+ hyper
33
+ reqwest
34
+ tower
35
+ tower-http
36
+ tonic
37
+ prost
38
+ warp
39
+ actix-web
40
+ actix-rt
41
+ rocket
42
+ rocket_sync_db_pools
43
+ sqlx
44
+ diesel
45
+ rusqlite
46
+ sea-orm
47
+ chrono
48
+ time
49
+ uuid
50
+ once_cell
51
+ lazy_static
52
+ parking_lot
53
+ dashmap
54
+ indexmap
55
+ hashbrown
56
+ itertools
57
+ rayon
58
+ crossbeam
59
+ crossbeam-channel
60
+ bytes
61
+ smallvec
62
+ bitflags
63
+ libc
64
+ winapi
65
+ windows
66
+ socket2
67
+ rustls
68
+ native-tls
69
+ openssl
70
+ hyper-rustls
71
+ cookie
72
+ mime
73
+ url
74
+ percent-encoding
75
+ semver
76
+ toml
77
+ toml_edit
78
+ config
79
+ dotenv
80
+ dotenvy
81
+ tempfile
82
+ walkdir
83
+ glob
84
+ notify
85
+ zip
86
+ tar
87
+ flate2
88
+ brotli
89
+ zstd
90
+ sha2
91
+ sha1
92
+ md5
93
+ hmac
94
+ base64
95
+ hex
96
+ jsonwebtoken
97
+ secrecy
98
+ zeroize
99
+ num-traits
100
+ num-bigint
101
+ ordered-float
102
+ approx
103
+ statrs
104
+ nalgebra
105
+ ndarray
106
+ image
107
+ plotters
108
+ criterion
109
+ proptest
110
+ quickcheck
111
+ rstest
112
+ insta
113
+ trybuild
114
+ mockall
115
+ wiremock
116
+ httpmock
117
+ pretty_assertions
118
+ serial_test
119
+ claim
120
+ static_assertions
121
+ paste
122
+ proc-macro2
123
+ quote
124
+ syn
125
+ heck
126
+ derive_builder
127
+ derive_more
128
+ strum
129
+ enum_dispatch
130
+ inventory
131
+ linkme
132
+ ctor
133
+ pin-project
134
+ pin-project-lite
135
+ scopeguard
136
+ tap
137
+ either
138
+ unwrap_or
139
+ failure
140
+ error-chain
141
+ snafu
142
+ color-eyre-owo
143
+ backtrace
144
+ eyre-proptest
145
+ cc
146
+ cmake
147
+ bindgen
148
+ cxx
149
+ pyo3
150
+ neon
151
+ napi
152
+ wasm-bindgen
153
+ web-sys
154
+ js-sys
155
+ gloo
156
+ leptos
157
+ yew
158
+ dioxus
159
+ sycamore
160
+ maud
161
+ askama
162
+ tera
163
+ handlebars
164
+ maud-markup
165
+ handlebars_misc
166
+ rust-embed
167
+ include_dir
168
+ phf
169
+ fluent-bundle
170
+ unic-langid
171
+ sys-locale
172
+ console
173
+ indicatif
174
+ dialoguer
175
+ inquire
176
+ crossterm
177
+ termcolor
178
+ ansi_term
179
+ colored
180
+ comfy-table
181
+ tabled
182
+ prettytable-rust
183
+ textwrap
184
+ unicode-width
185
+ unicode-segmentation
186
+ petgraph
187
+ graph-crate
188
+ slotmap
189
+ slab
190
+ typed-arena
191
+ bumpalo
192
+ triomphe
193
+ elsa
194
+ multimap
195
+ bitvec
196
+ fixedbitset
197
+ roaring
198
+ rustc-hash
199
+ fxhash
200
+ ahash
201
+ seahash
202
+ twox-hash
203
+ crc32fast
204
+ adler
205
+ miniz_oxide
206
+ byteorder
207
+ bincode
208
+ postcard
209
+ rmp-serde
210
+ cbor4ii
211
+ flexbuffers
212
+ flatbuffers
213
+ capnp
214
+ protobuf
215
+ avro-rs
216
+ arrow
217
+ parquet
218
+ datafusion
219
+ polars
220
+ duckdb
221
+ rusoto_core
222
+ aws-config
223
+ aws-sdk-s3
224
+ azure_core
225
+ google-cloud-storage
226
+ object_store
227
+ s3-ext
228
+ reqwest-middleware
229
+ reqwest-retry
230
+ tower-http-cors
231
+ axum-extra
232
+ axum-login
233
+ axum-sessions
234
+ actix-session
235
+ actix-cors
236
+ actix-files
237
+ actix-multipart
238
+ sea-actix
239
+ rocket_cors
240
+ jsonwebtoken-aws
241
+ cookie_store
242
+ reqwest-cookie-store
243
+ hickory-resolver
244
+ trust-dns-resolver
245
+ trust-dns-proto
246
+ pnet
247
+ etherparse
248
+ dns-lookup
249
+ if-addrs
250
+ macaddr
251
+ serialport
252
+ hidapi
253
+ gilrs
254
+ rodio
255
+ cpal
256
+ sdl2
257
+ glutin
258
+ winit
259
+ wgpu
260
+ glium
261
+ gfx-hal
262
+ nalgebra-glm
263
+ glam
264
+ vegafusion
265
+ plotters-backend
266
+ plotters-svg
267
+ textplots
268
+ csv
269
+ calamine
270
+ rust_xlsxwriter
271
+ quick-xml
272
+ quick-xml-serde
273
+ roxmltree
274
+ xmltree
275
+ html5ever
276
+ scraper
277
+ select
278
+ soup
279
+ regex-lite
280
+ fancy-regex
281
+ onig
282
+ pest
283
+ nom
284
+ winnow
285
+ chumsky
286
+ lalrpop
287
+ logos
288
+ ariadne
289
+ codespan-reporting
290
+ annotate-snippets
291
+ miette
292
+ thiserror-impl
293
+ anyhow-proptest
@@ -0,0 +1,57 @@
1
+ # Seed corpus of crate names with the generic "too plausible to be real"
2
+ # patterns that LLMs invent (arxiv 2606.08444, USENIX Sec 2025 package
3
+ # hallucination study) and that attackers register (slopsquatting).
4
+ # Extend with your organization's private list via `corpus = "..."` in
5
+ # rust-audit.toml. Also matched by pattern in the engine:
6
+ # ^(rust|async|simple|easy|smart|fast)[-_].* and .*[-_](utils?|helpers?|extensions?|extra|lite|lib|core)$
7
+ rust-http-client
8
+ rust-database
9
+ rust-db
10
+ rust-utils
11
+ rust-helpers
12
+ rust-orm
13
+ rust-file-utils
14
+ rust-json-utils
15
+ rust-web-utils
16
+ rust-auth-utils
17
+ async-utils
18
+ async-helpers
19
+ async-utils-extra
20
+ async-database-pool
21
+ async-http-client
22
+ async-helpers-rs
23
+ file-utils
24
+ file-helpers
25
+ json-utils
26
+ string-utils
27
+ text-utils
28
+ io-utils
29
+ net-utils
30
+ db-utils
31
+ test-utils-extra
32
+ tokio-utils-extra
33
+ tokio-helpers
34
+ serde-helpers
35
+ serde-extensions
36
+ axum-extensions
37
+ axum-helpers
38
+ hyper-extensions
39
+ easy-utils
40
+ easy-crud
41
+ simple-crud
42
+ simple-cache
43
+ smart-cache
44
+ fast-json
45
+ fast-cache
46
+ smart-utils
47
+ universal-utils
48
+ common-utils
49
+ misc-utils
50
+ util-rs
51
+ helper-rs
52
+ extra-utils
53
+ pro-utils
54
+ plus-utils
55
+ mini-utils
56
+ light-utils
57
+ ultra-utils
@@ -0,0 +1,27 @@
1
+ # cargo-deny policy for AI-generated / third-party dependency control.
2
+ # Install: cargo install cargo-deny · Check: cargo deny check
3
+ [advisories]
4
+ vulnerability = "deny"
5
+ unmaintained = "warn"
6
+ yanked = "deny"
7
+
8
+ [licenses]
9
+ unlicensed = "deny"
10
+ allow = ["MIT", "Apache-2.0", "Apache-2.0 WITH LLVM-exception", "BSD-2-Clause",
11
+ "BSD-3-Clause", "ISC", "Unicode-DFS-2016", "Unicode-3.0", "Zlib", "MPL-2.0"]
12
+
13
+ [bans]
14
+ multiple-versions = "warn"
15
+ wildcards = "deny"
16
+
17
+ # Block names that appear in the slopsquatting corpus or that you removed after
18
+ # an audit. Example:
19
+ # [[bans.deny]]
20
+ # name = "rust-http-client"
21
+ # reason = "Generic name matching AI-hallucination patterns; verified nonexistent"
22
+
23
+ [sources]
24
+ # Only the official crates.io registry is allowed.
25
+ unknown-registry = "deny"
26
+ unknown-git = "deny"
27
+ allow-registry = ["https://github.com/rust-lang/crates.io-index"]
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: rust-audit
3
+ Version: 0.2.3
4
+ Summary: Static auditor and auto-fixer for AI-generated Rust traps — stubs, fake tests, swallowed errors, panic/unsafe misuse, hallucinated or typosquatted crates
5
+ Author-email: Antonio Cantallops Alba <contact@exyonq.org>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/Doken-Tokuyama/Rust-Audit
8
+ Project-URL: Source, https://github.com/Doken-Tokuyama/Rust-Audit
9
+ Project-URL: Issues, https://github.com/Doken-Tokuyama/Rust-Audit/issues
10
+ Project-URL: Documentation, https://github.com/Doken-Tokuyama/Rust-Audit/blob/main/SKILL.md
11
+ Keywords: rust,audit,linter,static-analysis,ai-generated-code,supply-chain,typosquatting,agent-skills
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # Rust Audit
32
+
33
+ Auditor and auto-fixer for **AI-generated Rust code**: stubs, demo code, fake
34
+ tests, fakes/mocks leaking into production, panic/unsafe misuse, swallowed
35
+ errors, async pitfalls, and fake / hallucinated / typosquatted dependencies
36
+ (slopsquatting).
37
+
38
+ Python 3.11+ stdlib only — no dependencies. English output.
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pipx install rust-audit # or: pip install rust-audit
44
+ rust-audit selftest # prints `selftest PASS`
45
+ ```
46
+
47
+ From PyPI as **`rust-audit`**; the one-word alias **`rustaudit`** is the same
48
+ package under a name that resolves to it, and both `rust-audit` and `rustaudit`
49
+ run from either install. Nothing is fetched or executed at install time, and
50
+ the wheel carries the same `rust_audit.py` as the signed release asset — so the
51
+ verify-before-use chain below still applies to the script you download.
52
+
53
+ ## Quick start
54
+
55
+ ```bash
56
+ # 0) verify before use — check the exact audited bytes before executing them
57
+ # (key pin -> SSH signature -> checksum -> tag identity) and proceed only
58
+ # on VERIFIED (exit 0); see SECURITY.md for the pinned key and the chain
59
+ scripts/verify_release.sh v0.2.3 ./rust_audit.py
60
+
61
+ python3 scripts/rust_audit.py selftest
62
+ python3 scripts/rust_audit.py scan <rust-project> --format terminal,md,json,sarif --fail-on high
63
+ python3 scripts/rust_audit.py fix <rust-project> --dry-run
64
+ python3 scripts/rust_audit.py cargo <rust-project> --deep --supply-chain
65
+ ```
66
+
67
+ Exit codes: `0` clean · `1` findings at/above `--fail-on` · `2` execution error.
68
+ Every run writes a **not-executed report** (`report/not-executed-<date>.md`)
69
+ listing the checks that could not run and how to enable them — read it before
70
+ calling an audit complete.
71
+
72
+ As a Freebuff agent skill: install `rust-audit` into Freebuff on any machine
73
+ by following [docs/freebuff-skill-install.md](docs/freebuff-skill-install.md).
74
+
75
+ ## Tests
76
+
77
+ Production E2E suite: the real CLI audited against real Rust workspaces
78
+ (`BurntSushi/ripgrep` and `tokio-rs/tokio`, each pinned by commit — no demo
79
+ fixtures), with per-project goldens. Needs network to fetch the pinned
80
+ workspaces, Python 3.11+ and pytest in a venv:
81
+
82
+ ```bash
83
+ python3 -m venv .venv && .venv/bin/pip install pytest
84
+ .venv/bin/python -m pytest tests/
85
+ ```
86
+
87
+ See [SKILL.md](SKILL.md) for the rule catalog (R01–R21), the auto-fix policy,
88
+ the CI templates and the honest limitations.
89
+
90
+ ## Security
91
+
92
+ The trust model is explicit: what executes (literal `cargo` argv, no shell),
93
+ what leaves the machine (opt-in `--online` registry/OSV lookups only) and
94
+ what writes to disk (transactional `fix`). See [SECURITY.md](SECURITY.md) —
95
+ including the notes for static skill auditors.
96
+
97
+ Release assets are **SSH-signed**: an install can verify it has the exact
98
+ audited `rust_audit.py` with preinstalled `ssh-keygen` alone — commands and
99
+ the pinned signing key live in [SECURITY.md](SECURITY.md#release-attestation-v020--verify-the-exact-audited-bytes).
100
+
101
+ Hardened scanners can enforce the static-only contract in code: every
102
+ subcommand accepts **`--no-exec`**, under which process creation is
103
+ impossible (one guarded entry point refuses every spawn) and each check that
104
+ would have executed is recorded as *skipped* in the not-executed report.
105
+
106
+ ## License
107
+
108
+ Apache License 2.0 — see [LICENSE](LICENSE).
109
+ Copyright (c) 2026 Antonio Cantallops Alba · contact@exyonq.org
@@ -0,0 +1,10 @@
1
+ rust_audit.py,sha256=uviqZOfFKxQM3_2UdhxRoRHr0_sJp3sdbhSSUoyZ22g,136659
2
+ rust_audit-0.2.3.data/data/share/rustaudit/resources/popular_crates.txt,sha256=sn4G4W4awe9JQX9SLLDwLIj-gRVo7fbY75r4B8h-8TE,2931
3
+ rust_audit-0.2.3.data/data/share/rustaudit/resources/suspicious_names.txt,sha256=2JQIMWlO4XSCaT9M0d9kHSazkpzP2w0dqS3X3MuFbOI,1117
4
+ rust_audit-0.2.3.data/data/share/rustaudit/templates/deny.toml,sha256=CIFgbr46NOEMDu0AtD9AN0Ijb9xqtD9DTze6bMpng0s,868
5
+ rust_audit-0.2.3.dist-info/licenses/LICENSE,sha256=22J8RMtJruc-H-1IL3Tn73oc1K9m9bbg7ULWcy9W4LE,11511
6
+ rust_audit-0.2.3.dist-info/METADATA,sha256=lW8mhxWFgicrw-6iU-3MAIbHc6Wl3daLeYFrEwkCPmA,4772
7
+ rust_audit-0.2.3.dist-info/WHEEL,sha256=a-udL2m4V_6Yn8b-uKzWb12RjRxwwMo6ohYFM24tpaY,91
8
+ rust_audit-0.2.3.dist-info/entry_points.txt,sha256=Em93nrEhOiF82Z7JgWPKjzKCnpbkdHij9lBxGSohWXI,75
9
+ rust_audit-0.2.3.dist-info/top_level.txt,sha256=j1zJbd8JcYlOufL7AMO0_Rjg2wLCOthWAAf2d9wqNzA,11
10
+ rust_audit-0.2.3.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ rust-audit = rust_audit:main
3
+ rustaudit = rust_audit:main