Skip to content

fix(rules): env-var reads and call expressions are reported as hardcoded secrets #616

Closed

Description

@ajianaz

False positives: process.env.X, process.env.X || fallback, os.environ["X"], os.getenv("X"), get_password_from_vault(), std::env::var("X")?, String::new(), Java/Kotlin System.getenv("X") on the right-hand side are flagged. Cause: the scanner regex only needs \S{8,} after = and the post-filter only suppresses bare identifiers after a ':'. Direction: require a string literal after '=' (or recognise env/call RHS) for the generic rule.

Found by the table-driven secret heuristics tests (src/engine/secret_heuristics_tests.rs, KNOWN_GAPS row group; PR #615, refs #610). Current behaviour is pinned by the table; fix by moving the rows to CASES.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions