Repository navigation
fix(redact): mask raw kubectl and oc secret reads (RIG-11984) - #226
Open
rigel-mintaka wants to merge 4 commits into
Open
rigel-mintaka wants to merge 4 commits into
rigel-mintaka wants to merge 4 commits into
Conversation
Contributor
Author
|
All-clear at 5d9f51d |
rigel-mintaka
marked this pull request as ready for review
November 22, 2026 06:08
Base automatically changed from
harness/rig-11965-mask-kubectl-secret-reads-and-shell
to
main
November 23, 2026 00:53
rigel-mintaka
force-pushed
the
harness/rig-11984-mask-raw-kubectl-and-oc-secret-reads
branch
from
November 23, 2026 01:18
5d9f51d to
a6aaf28
Compare
Contributor
Author
|
All-clear at a6aaf28 |
Co-authored-by: Matt Wilkinson <matt@rigel.build>
…IG-11984) kubectl exec, attach, debug, run and cp print container or file content with no -o flag, and get --raw and create token return raw API objects or bearer tokens. The per-line Secret pass cannot see these, so the masker now masks the whole output of each. Token match over-masks by design (for example -n run); that is accepted under option A. Red first: 7 leak rows failed at 8fd0ee02; all green after the fix.
Pin three bypasses from the PR 226 review as strict xfail rows: oc whoami -t=VALUE, verbose klog Secret bodies at -v 8+, and kuberc default output (--kuberc=, KUBECTL_KUBERC=). Each row is a real leak today; strict xfail turns red when a later fix makes it pass. Not patched here: one patch round, per the review stop rule. Tracked on RIG-11984.
rigel-mintaka
force-pushed
the
harness/rig-11984-mask-raw-kubectl-and-oc-secret-reads
branch
from
November 23, 2026 04:19
a6aaf28 to
0ecf7e6
Compare
Contributor
Author
|
All-clear at 0ecf7e6 |
This branch had an error being deployed
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 does this do
Masks the whole output of raw kubectl and oc reads that the per-line Secret pass cannot see, and masks kubectl plugin output.
oc rsh,oc extract,oc whoami -t/--show-token,oc sa get-tokennow mask whole.get --rawandconfig view --rawmask whole.kubectl-<name>plugin binary, or a plugin verb after kubectl, oc or k, masks whole. A read unmasks only when its first verb after the global flags is a built-in read verb.get,describe,logs,version,config viewwith no flags,oc whoamiwith no token flag.Why do we need it
Raw reads print Secret content that the per-line pass cannot see (RIG-11984). Stacked on nebula#223 (RIG-11965).
Summary
Adds the oc-only and plugin shapes to the kubectl structured-read gate in
forks/hermes-agent/agent/redact.py. Mask-only; no change to the per-line pass.Verification
pytest tests/agent/test_redact*.py tests/agent/test_compaction_redaction_boundaries.py: 1050 passed.ruff checkon the touched files: clean.Risks
Over-masks by design: a token match on exec, debug, run, cp and attach masks clean output that happens to share those words.
Spec impact
None.
Checks skipped:
nebula has no pre-push hook config; GitHub Actions ci.yaml runs its checksRefs RIG-11984
Co-authored-by: Matt Wilkinson matt@rigel.build