ci(codeql): move config to a file and exclude rust/cleartext-logging - #139
Merged
Conversation
Code scanning had 145 open high alerts, all from rust/cleartext-logging.
The rule taints anything flowing out of a type or function whose name
contains "Secret", then flags every println!/eprintln! downstream. In this
codebase that is the entire secrets API by design, so every alert was on
metadata that is public by construction: file paths ("skipped (no key):
{path}"), secret names from the public registry, snapshot ids, and TLS
fingerprints. None printed plaintext.
Secret plaintext has one sanctioned egress, the child-process env injected
by `sc run` (ADR-0008). There is no `sc secret show`; `sc secret list`
emits names plus a recipient count. The one intentional plaintext print is
`sc serve token add`, which prints a freshly minted token once and stores
only its hash (ADR-0040).
Exclude the rule via query-filters, and move the exclusions out of the
inline `config:` block into .github/codeql/codeql-config.yml so each one
carries its reason in a reviewable place. The exclusion's cost is recorded
there too: it would hide a genuine cleartext egress, so the compensating
controls are docs/THREAT-MODEL.md and the P5 commit-time secret scanner.
The remaining critical alert (a deliberately-wrong key in a #[cfg(test)]
negative test in crates/crypto/src/envelope.rs) is dismissed as a false
positive rather than filtered: tests are inline per CLAUDE.md, so a
paths-ignore entry would also blind rust/hard-coded-cryptographic-value to
the real crypto in the same file.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tonibergholm-codento
approved these changes
Sep 3, 2026
tonibergholm-codento
self-requested a review
September 3, 2026 08:29
tonibergholm-codento
previously approved these changes
Sep 3, 2026
# Conflicts: # .github/workflows/codeql.yml
tonibergholm-codento
self-requested a review
September 3, 2026 08:39
tonibergholm-codento
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Code scanning had 145 open high alerts, every one of them from
rust/cleartext-logging. This excludes that rule and moves the CodeQL exclusions out of the workflow's inlineconfig:block into.github/codeql/codeql-config.yml, so each one carries its reason somewhere reviewable.Why the rule is noise here
rust/cleartext-loggingtaints anything flowing out of a type or function whose name containsSecret, then flags everyprintln!/eprintln!downstream. In this codebase that is the entire secrets API by design, so all 145 alerts landed on metadata that is public by construction:eprintln!("skipped (no key): {path}")— a file path (~30 alerts, acrossswitch,sparse,ws,workspace)eprintln!("warning: not authorized for secret {name}; skipping")— a secret name, i.e. public registry dataprintln!("{index:<3} landed @ {}", merged_tip.short())— a snapshot idprintln!("{}", serve_tls_fingerprint(&root)?)— a cert fingerprint, which is the entire point of the commandassert_eq!(..., "{path}: decrypts back to ...")— a test assertion messageNone print plaintext. Secret plaintext has exactly one sanctioned egress — the child-process env injected by
sc run(ADR-0008). There is nosc secret show;sc secret listemits names plus a recipient count. The one intentional plaintext print issc serve token add, which prints a freshly minted token once and stores only its hash (ADR-0040).What this exclusion costs
It would hide a genuine cleartext egress if one were ever added. That trade-off is recorded in the config file itself, along with the compensating controls:
docs/THREAT-MODEL.mdand the P5 commit-time secret scanner.The critical alert
Alert #166 (
rust/hard-coded-cryptographic-valueatcrates/crypto/src/envelope.rs:427) islet wrong = [0u8; 32];— a deliberately-wrong key in a#[cfg(test)]negative test assertingdecrypt_pathrejects it. Dismissed as a false positive rather than filtered: tests are inline per CLAUDE.md, so apaths-ignoreentry would also blind that rule to the real crypto in the same file. The rule stays armed forcrates/crypto.Verification
not-configuredand all recent analyses carry the workflow's/language:*categories, so theconfig-filewill actually be honored (a config file is silently ignored under default setup).🤖 Generated with Claude Code