Rust Security Checklist to Run Before Shipping a Service
A review checklist for a Rust service before it faces the internet: dependencies, unsafe, input limits, authentication, secrets, transport, containers and monitoring, each with a pass condition.

A checklist is useful when it is specific enough to fail. "Use strong crypto" cannot fail; "passwords hashed with Argon2id at 19 MiB or more" can. This one lists the controls for a Rust service that faces the internet, each with the condition that shows it is in place and a link to the post that explains it. It is the checklist form of security for Rust developers.
Rust 1.90.
Dependencies and build
- [ ]
Cargo.lockis committed, and CI builds with--locked. *Pass: build fails when the lock is stale.* - [ ]
cargo auditorcargo deny check advisoriesruns on every pull request and daily. *Pass: CI job exists and is required.* See dependency risk. - [ ]
deny.tomlrestricts licenses, sources and banned crates. *Pass:cargo deny checkexits 0.* See cargo deny. - [ ] Toolchain is pinned in
rust-toolchain.toml. - [ ] Release profile has
overflow-checks = true, or all input arithmetic is checked. See integer overflow bugs.
Code
- [ ] Every
unsafeblock has a// SAFETY:comment and the module is tested under Miri. *Pass:clippy::undocumented_unsafe_blocksis denied.* See safety comments. - [ ]
unwrap,expectand indexing on input-derived values are reviewed. *Pass:clippy::unwrap_usedwarns in non-test code.* - [ ] SQL uses bind parameters only. *Pass: no
format!building queries.* See SQL injection. - [ ] File paths from users go through a safe join. See path traversal.
Input
- [ ] Body size, nesting depth, decompressed size, concurrency and time are all bounded. *Pass: each has a number in the code or config.* See parsers and limits.
- [ ] Parsers of untrusted formats are fuzzed.
Authentication and secrets
- [ ] Passwords use Argon2id with tuned parameters. See password hashing.
- [ ] Tokens are validated with a fixed algorithm, and
exp,audandisschecked. See JWT validation. - [ ] Secret comparisons are constant time. See constant time comparisons.
- [ ] Secrets are not in the repository, image or logs; they are wrapped in a redacting type. See secrets management and zeroize and secrecy.
- [ ] Login and password reset endpoints are rate limited.
Transport and headers
- [ ] TLS terminates with a current configuration; HSTS is set. See security headers.
- [ ] CORS lists exact origins. See CORS.
- [ ] Cookies have
Secure,HttpOnlyandSameSite.
Runtime
- [ ] The container runs as non-root with a read-only root file system. See non-root containers.
- [ ] The image contains only the binary and what it needs. See a small Docker image.
- [ ] Health endpoints do not leak internals, and shutdown is graceful.
- [ ] Logs include request ids and exclude credentials, tokens and personal data. See structured logging.
- [ ] Alerts exist for error rate, latency and authentication failures.
Process
- [ ] There is a way to rotate every secret without a rebuild, and it has been tried.
- [ ] Someone owns responding to advisories, with a target time.
- [ ] A security contact and disclosure policy are published (
security.txt).
Limits
A checklist verifies known controls. It misses design flaws, business logic abuse and anything specific to your product. Pair it with a threat model and, for sensitive systems, an external review. The French national cybersecurity agency ANSSI publishes a longer guide to secure Rust development.


