attackmap-analyzer-rust
Rust ecosystem analyzer for AttackMap.
This analyzer extracts structured signals from Rust crates and Cargo workspaces:
- Web frameworks — axum, actix-web, rocket, poem, salvo, loco, warp, tide (routes with their full mounted path; entrypoints)
- Databases — sqlx (Postgres / MySQL / SQLite), diesel, sea-orm, tokio-postgres, rusqlite, mongodb, redis, deadpool, AWS SDK (S3 / DynamoDB)
- Auth crates — jsonwebtoken, argon2 / bcrypt / scrypt / password-hash, oauth2, axum-login, actix-identity, tower-sessions, tower-http auth
- HTTP clients (external calls) — reqwest, isahc, surf, ureq
- Secrets —
std::env::var,dotenv/dotenvy,env!macro,secrecy::SecretString - Service hints — Cargo
[package].nameand[workspace].members
All emissions populate AttackMap's Signal v2 fields (line numbers, evidence snippets, confidence scores) so downstream insights can cite path/to/file.rs:NN.
Install
uv tool install attackmap --with attackmap-analyzer-rust # from PyPI
# or: pip install attackmap-analyzer-rust (installs attackmap too)
# or from source:
pip install git+https://github.com/mlaify/attackmap-analyzer-rust.git
The analyzer is auto-discovered by AttackMap via the attackmap.analyzers entry-point group.
Usage with AttackMap
# Auto-discovered when installed:
attackmap analyze /path/to/rust/repo
# Or invoke explicitly:
attackmap analyze /path/to/rust/repo --module rust
Detection
detect() returns true when any of the following are present, ignoring target/, .git/, node_modules/, .cargo/, and vendor/:
- A
Cargo.tomlorCargo.lockat the repository root, or anywhere in the tree - One or more
.rsfiles in the tree
Coverage notes
- Route prefixes: a route's path includes the prefixes of every router that mounts it.
- axum:
.nest("/p", x)/.merge(x)wherexis an inlineRouter::new()..., alet x = Router::new()...binding (same file, nearest earlier one) orx()/module::x()returning a router (any file; severalfn routes()are told apart by module path or by being in the caller's file). A router nested at two prefixes yields a route under each. - actix-web:
web::scope("/p")andweb::resource("/p")(also barescope(..)/resource(..)when imported fromactix_web), nested scopes,.configure(module::config), and#[get]handlers mounted with.service(handler). - rocket:
.mount("/base", routes![a, m::b])and.mount("/base", m::routes())wherefn routes()returnsroutes![..]. - poem
Route::new().at(..).nest(..), salvoRouter::with_path(..).get(h).push(..), locoRoutes::new().prefix(..).add(..)underAppRoutes::..().prefix(..).add_route(..). - warp: each
warp::path!("users" / u32)is a route (/users/{u32}); its method is thewarp::get()-style filter combined with it.path!(".." / ..)prefix filters andpath!used under another filter (x.and(warp::path!(..))) aren't emitted, since their prefix isn't visible. - tide:
app.at("/x").at("/y").get(h), including receivers bound withlet api = app.at("/api"). - A non-literal prefix (
.nest(&format!(..), x)) or an ambiguous mount leaves the route at its own path.letbindings resolve only within their own fn, andlet api = api.route(..)continues the earlier router. - A named router that nothing visible mounts counts as a fully-seen root (for
anonymous) only when it is handed to a server (axum::serve(l, app), poem.run(app), salvo.serve(router)).
- axum:
- Multi-method axum chains like
.route("/x", get(h).post(h2))produce oneRouteper HTTP verb in the chain, all sharing the sameline. - The actix-web attribute regex (
#[get(...)]) and rocket attribute regex are intentionally identical; rocket emissions only fire when the file also mentionsrocketsomewhere, to avoid double-counting actix routes. - Route auth (AttackMap#256): each route carries
auth(required/anonymous/unknown),guardsandguard_evidence.- axum: a
Router::new()chain is read in order..layer/.route_layerwrap only the routes added before them. Routers bound withletor returned fromfn name() -> Routerare followed through.merge(name)/.nest("/x", name), across files. - actix-web:
.wrap(...)onApp::new()/web::scope(...)/web::resource(...)covers every service in it, nested and configured scopes included..service(handler)links attribute-macro handlers to their scope. - poem / salvo / loco: poem
.with(..)wraps the routes before it; salvo.hoop(..)and loco.layer(..)cover the whole router. - Each mount path is resolved on its own, so a router nested under an auth layer at
/adminand outside it at/previewgetsrequiredonly under/admin. - Auth layers:
middleware::from_fn(require_auth),from_extractor::<RequireAuth>,RequireAuthorizationLayer/ValidateRequestHeaderLayer::bearer,login_required!,HttpAuthentication::bearer. - Handler extractors: a type like
Claims,AuthUser,CurrentUserorLoggedUsermakes a routerequiredonly when itsFromRequestParts/FromRequestimpl is in the repo, can reject (nottype Rejection = Infallible) checks credentials (reads an auth header / cookie / session / token) and rejects when they're missing (ok_or(..)?, an earlyreturn Err,Err(Unauthorized), a requiredTypedHeader<Authorization<..>>).Maybe*/Optional*extractors, and ones that only parse a token when present, don't count; the same goes for Rocket request guards. Library extractors that reject anonymous callers count without a visible impl: actix-web-httpauthBearerAuth/BasicAuth, actix-identityIdentity, locoJWT/JWTWithUser.Option<AuthUser>makes itanonymous, but only when no auth layer applies and every layer on the way up is a known non-auth one (tracing, CORS, compression, ...). axum-login'sAuthManagerLayer/AuthSessiononly load the user and don't count. - Stays
unknown: routers re-layered or merged outside their own chain, handler names defined in more than one module that can't be told apart, extractors without a visible impl, Rocket path/data params, and warp / tide routes.
- axum: a
License
MIT
Metadata
Release files for attackmap-analyzer-rust 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| attackmap_analyzer_rust-0.2.1.tar.gz | 49.1 kB | With provenance | Details for attackmap_analyzer_rust-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| attackmap_analyzer_rust-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for attackmap_analyzer_rust-0.2.1-py3-none-any.whl |
Total release size: 85.4 kB
Release files / attackmap_analyzer_rust-0.2.1.tar.gz
| Download URL | attackmap_analyzer_rust-0.2.1.tar.gz |
|---|---|
| Size | 49.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03c0dfddc7b75ee8e1cf5c5eeddfa8838700497249da99fc73e9a5ab174ee3c6
|
|
BLAKE2b-256 checksum How to use checksums |
3f99b0edb2fa8fd9e869d7f145afeb008f05640688eae0daf6a1a9339ee4f06d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / attackmap_analyzer_rust-0.2.1-py3-none-any.whl
| Download URL | attackmap_analyzer_rust-0.2.1-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73a7fab9958906334fd688268f21bf5458ad7cd4829eda09e69c59947b0811ce
|
|
BLAKE2b-256 checksum How to use checksums |
00c717eeba2f9fb192808af942c61de5480ee36619634472d64b225a84d4af5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logSecurity for attackmap-analyzer-rust 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for attackmap_analyzer_rust-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.