← Rule catalog

Repository · Security

Credential-shaped literal in tracked source

rust_doctor::repo::hardcoded_credential

Remove the credential from the source and rotate it; the closed list judged here is AKIA, ghp_, github_pat_, sk-, xoxb-, BEGIN PRIVATE KEY blocks and the password of a postgres, mysql, mongodb or redis database URL, and the matched value is never republished by the report.

Category
Security
Default level
warn
Tier
P1
Producer
Repository
Diff scope
line

Not a defect when

The literal is a documented fake that grants access to nothing, such as a vendor's published example key or a throwaway key generated solely for a test fixture.

What it reads

What git tracks.

Tier

Serious: worth interrupting other work for.

The tier bounds how severe a rule may be; its category bounds the tier.

Diff scope

The changed line itself.

What --scope contextual looks at to decide whether a change caused the finding.

Change it

Turn it off, or make it blocking, without touching the code it flags:

rust-doctor --rule rust_doctor::repo::hardcoded_credential=off .
rust-doctor --rule rust_doctor::repo::hardcoded_credential=error .

Set it once in rust-doctor.toml

Other Security rules