Repository navigation
fix(telemetry): a credential written as one word is still a credential (#1095) - #1097
Conversation
PGPASSWORD, s3secretkey, AWSSecretAccessKey, client_secrets and api_keys all fall through the component rules, so the predicate and the export are pinned before the fix. The measurement counters and the recorded auth non-goal are pinned at the same time so the suffix rule cannot reach them.
#1095) A single-component key is matched by whole-word suffix (password, secretkey, apikey, ...), so PGPASSWORD and s3secretkey no longer reach a span; the adjacent-pair lookup tolerates one plural s, so client_secrets and api_keys match. Suffix rather than substring keeps tokens/max_tokens/secret_free alive (#1070), and auth stays a non-goal.
The amended contract adds the plural spellings: passwords, pgpasswords, db_passwords, db_secrets as credentials, and monkey, max_new_tokens, total_tokens, status, access_level as not. The export row keeps secrets_scanned alongside MAX_TOKENS so the noun rule cannot reach it.
The plural compounds join the component set (db_passwords, in any position), secrets joins the last-position nouns (db_secrets), and the whole-word suffix list gains the plural spellings (passwords, pgpasswords). secrets stays out of the component set on purpose: it would drop secrets_scanned.
|
Advisory read at Live state in the same read as the head: The four holds, measured at the tip
The two break risks, measured
Tip identity
Red on main, re-taken here Ran at
Non-blocking
No blocking finding at |
|
Birfy — one request: a counting verdict at State at that tip: all five No further commit is planned on this tip, so a PASS here will not be voided; if your verdict asks for changes, they land on top and the request repeats at the new tip. Tier T2 by |
|
Label state on this PR: What I checked before touching it:
For the record on the wait: the labels are not what delays a verdict. The last two PRs on this repo carried The one request at |
Birfy
left a comment
There was a problem hiding this comment.
Review (Birfy)
Tip SHA: c390e7a
Ran:
- pytest -o addopts="" -q tests/test_span_redaction.py tests/test_memory_spans.py tests/test_rsi_telemetry.py tests/test_changelog_fragments.py tests/test_api_reference.py tests/test_repo_hygiene.py → 132 passed, 2 skipped
- new tests copied onto merge base 0949292 → 13 failed (the 12 new credential rows plus the export row), as required
- python -m tools.changelog_fragments check → 44 changelog fragment(s) OK
- python -m tools.gen_api_docs --check → docs/api.md is up to date
- CI at this tip → green (build, test 3.9–3.13)
Not run: - full local pytest -q — CI already green at this tip
- Ark real-model run — no model path changed
- mkdocs build --strict — docs/ not in this diff
Findings: - none
Verdict: PASS
Fixes #1095
What changed
rsi_telemetry._is_secret_keydropped an attribute when a component spelled acredential word, when the last component was
token/secret, or when twoadjacent components spelled a pair. A credential written as one word reached
none of the three — and one of those words is libpq's own variable.
Before, all
False:PGPASSWORD,pgpassword,pgpasswords,passwords,db_passwords,db_secrets,client_secrets,CLIENT_SECRETS,api_keys,secret_keys,s3secretkey,AWSSecretAccessKey, so a caller that recorded theenvironment it ran under exported the password.
After, all
True, while the #1070 counters stayFalse—tokens,max_tokens,input_tokens,output_tokens,token_count,tokens_in,budget_tokens,secret_free,secrets_scanned.agentdescent/rsi_telemetry.py— the suffix test runs only when the splityields a single component, and only against whole credential words;
_CREDENTIAL_NOUNSgainssecrets(last position only);_CREDENTIAL_COMPONENTSgains the plural compoundspasswords,passwds,secretkeys,apikeys,privatekeys,accesskeys,clientsecrets; theadjacent-pair lookup tolerates one plural
sper component and always triesthe unfolded spelling, which is what keeps
AWS_SECRET_ACCESS_KEYwhileapi+keysfolds toapikey.tests/test_span_redaction.py— 13 credential rows and 17counter/non-credential rows, parametrised, plus the end-to-end row through
span.attributesandto_otel().changelog.d/1095-credential-word-suffix.md— oneFixedfragment.Matching stays component-based: no substring mode, and bare
keystays out ofthe one-word suffix list, so
monkeyandsort_keyare untouched.secretsisdeliberately not in
_CREDENTIAL_COMPONENTS— that set is checked at anyposition, so it would turn
secrets_scannedinto a credential — it is in thelast-position noun set instead, which catches
db_secretsandclient_secretsand leaves the counter alone.
Red at live main
09492927Clean worktree at
09492927f614b5303e54cc3f87b0bb809929e336, with onlytests/test_span_redaction.pycopied in:The export row fails on
assert 'PGPASSWORD' not in {'PGPASSWORD': 'hunter2', 'MAX_TOKENS': 16, 'secrets_scanned': 12}— the boundary, not only the predicate.
AWS_SECRET_ACCESS_KEYis the onecredential row that already passes at main, through the pair rule.
The Lead re-took the same red at
09492927independently: 13 failed, 29 passedin 2.22 s, the same rows.
Verification at the tip
Tip SHA: c390e7a
That is
1e82ec620aab6bdd2c4ca04e56d9493850ecbc41— the build the issuerecords — plus one commit,
c390e7ae, a forward merge of live main09492927into the branch. No rebase, no force-push, and the merge carries no file change
of its own:
git diff 09492927 c390e7aeandgit diff f5e93335 1e82ec62arethe same patch (identical
sha256), 3 files,+99/−4.Ran:
pytest -o addopts="" -q tests/test_span_redaction.py tests/test_memory_spans.pyat
c390e7ae→ 48 passedrsi_telemetry(test_campaign_ops,test_loop_kernel,test_memory_spans,test_ops_fabric,test_rsi_telemetry,test_span_redaction) atc390e7ae→ 85 passedtests/test_changelog_fragments.py tests/test_api_reference.py tests/test_repo_hygiene.pyatc390e7ae→ 76 passedpytest -o addopts="" -q -n 8atc390e7ae→ 7488 passed,58 skipped, 21 failed; the 21 are the host legs only — 12
test_sandbox_container(docker image), 6test_era_srbench, 2test_genesis_example, 1test_wheel_smoke— the same 21 that fail at1e82ec62and atf5e93335, none in telemetrypython -m tools.gen_api_docs --checkatc390e7ae→docs/api.md is up to datepython -m tools.changelog_fragments checkatc390e7ae→44 changelog fragment(s) OKc390e7aeover the acceptance rows → 13 True / 17 False,missed credentials: [],false positives: []Not run:
mkdocs build --strict— mkdocs is not installed in this clone's venv;CI's
buildjob is the linetest_era_srbench,test_genesis_exampleandwheel-smoke legs — environmental on this host, and unchanged by this branch
Non-goals on the issue, as they stand
REDISCLI_AUTHand a bareauthcomponent stayFalseat the tip:authnames a mode as often as a credential, and a token-shaped value is still
redacted wherever it appears. Recorded on the issue as a non-goal.
mytoken,xauthtoken,GITLABTOKEN,NPMTOKENareFalseat the tip.tokenis not in theone-word suffix list because
tokens/max_tokens/total_tokensare thefix(telemetry): a credential key is matched by component, so
tokens/max_tokensstop being dropped from spans #1070 counters. AlreadyTruetoday and unchanged:token,MY_TOKEN,authtoken,OAUTH_TOKEN.records
os.environinto span attributes, and everyattributes=call sitepasses caller-supplied data.
Size: 3 files,
+99/−4against base09492927. T2 by.github/agent/risk-rules.json(agentdescent/**), and under the 250-line cap;ready for a verdict at this tip, and a PASS naming
c390e7aeis what moves it.Claim-Id: #1095