Skip to content

fix(reporting): drop PII evidence digests that redaction made stale - #348

Merged
rng1995 merged 2 commits into
mainfrom
naren/pii-digest-redaction
Nov 6, 2026
Merged

rng1995 merged 2 commits into
mainfrom
naren/pii-digest-redaction

Conversation

@rng1995

@rng1995 rng1995 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #307.

A PII finding reports evidence_sha256, the digest a waiver uses, only while it shows its value in full. CI redaction runs after the report is written, through ci/secret_redaction.py and ci/publish_reports.py. It can mask a collected credential inside such a value, for example ops-<token>@example.com. The finding then showed the masked value but kept the digest of the original, and anyone holding the report could use it to confirm a guess for the masked part. #310 closed the same gap for finding IDs.

Change

  • refresh_finding_identities runs after redaction. It now removes a finding's evidence_sha256 unless it equals pii_evidence_sha256(check_name, matched_value) for the value the report shows. Digests of unmasked values are unchanged, so waivers keep working.
  • pii_evidence_sha256 is imported inside the helper. A module-level import would make every skillevaluator.reporting import load all validators, and would weaken the import guard in tests/reporting/test_private_static_reports.py.
  • CHANGELOG: one sentence added to the Unreleased --pii-waivers entry.

Tests

  • tests/ci/test_secret_redaction.py:
    • a masked value's digest is removed, while an untouched value keeps its digest;
    • a digest that does not match its reported value is removed;
    • importing finding_summary loads no validator modules.
  • The first two new tests fail without the fix. The import guard fails with a module-level import, which loads 22 validator modules.
  • Local runs: tests/ci, tests/reporting, test_pii_waivers.py, test_pii_grouping.py and test_oss_packaging.py gave 2404 passed and 21 skipped. tests/test_commands.py -k waiver gave 17 passed.

🤖 Generated with Claude Code

CI redaction can mask a credential inside a PII value that a finding shows
in full. The finding kept evidence_sha256, the digest of the unmasked value,
which lets anyone holding the report confirm a guess for the masked part.
refresh_finding_identities now removes a digest that no longer matches the
finding's reported value, alongside the finding IDs it already recomputes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995
rng1995 enabled auto-merge (squash) November 5, 2026 22:01

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed. Dropping evidence_sha256 unless it is the digest of the value the finding still shows is the right rule: once redaction masks part of a value, the original's digest would let anyone holding the report confirm a guess for the masked part. Checking against pii_evidence_sha256(check_name, matched_value) also covers older reports where the digest and the shown value already disagree, and the tests cover masked, unmasked and missing values. Nothing blocking.

The one failing CI job on the previous head was test_compose_stream_nested_secret_union_does_not_starve_event_loop (1.10 s < 1.0 s), a timing assertion in the Docker environment tests that this PR doesn't touch. I merged main into the branch to clear the CHANGELOG conflict, which also reruns CI.

@rng1995
rng1995 merged commit 03e8c8b into main Nov 6, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/pii-digest-redaction branch November 6, 2026 08:20
rng1995 added a commit that referenced this pull request Nov 6, 2026
Resolve the CHANGELOG.md conflict: main and this PR each started a
"### Changed" list under Unreleased after 0.8.0. Keep one heading, with
main's CI redaction entry (#348) first and this PR's entries after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
Resolve the CHANGELOG.md conflict: main and this PR each started a
"### Changed" list under Unreleased after 0.8.0. Keep one heading, with
main's CI redaction entry (#348) first and this PR's entries after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
Resolve the CHANGELOG.md conflict: main and this PR each started a
"### Changed" list under Unreleased after 0.8.0. Keep one heading, with
main's CI redaction entry (#348) first and this PR's entries after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased (#371)

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants