Skip to content

ci: mark deliberate secret-shaped test fixtures for rust-secrets#81

Merged
hyperpolymath merged 1 commit into
mainfrom
ci/rust-secrets-pragma
Jul 21, 2026
Merged

ci: mark deliberate secret-shaped test fixtures for rust-secrets#81
hyperpolymath merged 1 commit into
mainfrom
ci/rust-secrets-pragma

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

standards' rust-secrets job becomes blocking outside ./src on 2026-08-21 (warn-first window from standards#518).

The lines tagged here are genuine matches on genuine secret-shaped literals — they are test data, not credentials. So they take an explicit, auditable per-line pragma rather than a pattern loophole that would weaken the gate for every repo in the estate.

// scanner-allow: rust-secrets

Why a pragma and not a pattern change

standards#523 already tightens the patterns to require an assignment directly to a string literal of length ≥ 8, which removes the real false positives estate-wide (lookups, path joins, prose). What remains here genuinely is an assignment of a secret-shaped literal — it just happens to be fixture data. Loosening the pattern to hide it would blind the gate everywhere.

Fixture integrity

Where the pragma sits outside the r#"…"# raw string (after the closing quote/comma) it is an ordinary Rust comment and the fixture content is byte-identical — the tests exercise exactly the same data.

Where it sits inside a multi-line fixture, it is a JS-style comment within fake content and does not change what the test asserts.

Verified

rust-secrets, extracted from standards' shipping YAML, exits 0 on this tree with RUST_TODAY=2026-09-01 — i.e. after the cutoff, when the check is blocking.

Scope

Only Rust sources. The secret-scanner re-pin is deliberately not bundled: this repo is one of the 22 the estate sweep flagged, where gitleaks findings survive the shared baseline, and moving it onto the real gate needs its own triage.

🤖 Generated with Claude Code

standards' `rust-secrets` job becomes blocking outside `./src` on
2026-08-21. The lines tagged here are genuine matches on genuine
secret-shaped literals — they are test data, not credentials — so they take
the explicit per-line pragma rather than a pattern loophole that would weaken
the gate for every repo.

These are this repo's OWN secret-detection fixtures. Every pragma sits
OUTSIDE the r#"…"# raw string (after the closing quote / comma), so it is an
ordinary Rust comment and the fixture content is byte-identical — the tests
exercise exactly the same data as before.

Verified: `rust-secrets` (extracted from standards' shipping YAML) exits 0 on
this tree with RUST_TODAY=2026-09-01, i.e. after the cutoff.

Scope: this commit touches ONLY Rust sources. The secret-scanner re-pin is
deliberately NOT bundled — this repo is one of the 22 the sweep flagged, where
gitleaks findings survive the estate baseline, and switching it to the real
gate needs its own triage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
// Test secret patterns
let secret_patterns = vec![
r#"password = "thisisasecret123456""#,
r#"password = "thisisasecret123456""#, // scanner-allow: rust-secrets

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 2641199.
If this secret is a true positive, please rotate the secret ASAP.

If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.

echo 2641199e6d4d6eb56e00176901baf82244b97beb:tests/security_aspect_test.rs:generic-api-key:312 >> .gitleaksignore

Comment thread src/oracle/src/lib.rs
path: "config.rs".to_string(),
},
content: r#"const API_KEY = "abcdef1234567890abcdef""#.to_string(), // test fixture
content: r#"const API_KEY = "abcdef1234567890abcdef""#.to_string(), // test fixture — scanner-allow: rust-secrets

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 2641199.
If this secret is a true positive, please rotate the secret ASAP.

If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.

echo 2641199e6d4d6eb56e00176901baf82244b97beb:src/oracle/src/lib.rs:generic-api-key:1051 >> .gitleaksignore

@hyperpolymath
hyperpolymath merged commit e173dd4 into main Jul 21, 2026
23 of 32 checks passed
@hyperpolymath
hyperpolymath deleted the ci/rust-secrets-pragma branch July 21, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant