A committed credential in source is a quoted literal, and the unquoted form is a config rule of its own - #201
Conversation
|
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #201 +/- ##
=======================================
Coverage 93.63% 93.63%
=======================================
Files 44 44
Lines 17057 17057
=======================================
Hits 15971 15971
Misses 1086 1086 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…d form is a config rule of its own The value class of no-committed-auth-key-values holds the dot, the underscore and the colon, and its opening quote was optional, so a field access, a method chain or a call after `password:` or `token =` was read as a committed credential. Consumers disabled the rule, shadowed it with a copy that excluded Rust, or rewrote it to require the quote and kept the unquoted form for their config files under a second id. The bundled set now carries that split. The source rule requires the value half to open with a quote, so an expression is never sixteen characters of the class. A new no-committed-auth-key-values-in-config keeps the optional quote and is scoped by glob to the shapes where the text after the separator is the value itself: env files, INI, cfg, conf, properties, YAML, TOML, JSON and XML. Both keep the same excludes, and the source rule also excludes every shape the config rule selects, so the two selections are disjoint and a quoted value in a YAML file is one finding and not two. The corpus holds the expressions the source rule lets through and the quoted literals it still refuses, and the config rule's unquoted line in a .env and an .ini beside the same line allowed in a .rs. Its completeness count is now by rule rather than by case, because a rule scoped by glob needs a case per path it must and must not select. The set table in docs/REFERENCE.md states the split. Closes #196
0854f5c to
c437a34
Compare
The value class of
no-committed-auth-key-valuesholds the dot, the underscore and the colon, and its opening quote was optional, so a field access, a method chain or a call afterpassword:ortoken =was read as a committed credential. Consumers disabled the rule, shadowed it with a copy that excluded Rust, or rewrote it to require the quote and kept the unquoted form for their config files under a second id.The bundled set now carries that split.
no-committed-auth-key-valuesrequires the value half to open with a quote:[=:]\s*["'][A-Za-z0-9_./+=:@-]{16,}. Scope unchanged (files.include = ["."], same excludes).no-committed-auth-key-values-in-configkeeps the optional quote and is scoped byfiles.globto*.env,.env*,*.ini,*.cfg,*.conf,*.properties,*.yml,*.yaml,*.toml,*.json,*.xml, with the same excludes.Corpus: the source rule lets through
password: modem_config.password.clone(),let token = raw.trim_start_matches('v'),token = debs_mod.resolve_token(),token = probe_output.strip(), a::path and a?call, and still refusespassword: "hunter2hunter2hunter2"andtoken = 'abcdef0123456789abcd'. The config rule refusesTOKEN=abcdef0123456789abcdin a.envand the unquoted and quoted forms in an.ini, and the same unquoted line in a.rsis allowed. The corpus completeness count is now by distinct rule rather than by case, since a glob-scoped rule needs a case per path it must and must not select.sets.lock.jsonregenerated; the set table indocs/REFERENCE.mdstates the split. uphold's own tree is clean under both rules (checked with a temporary policy inheritingcredentials, since this tree does not inherit it); no fixture needed an exclude change.Closes #196