Repository navigation
fix(masker): mask describe Command, Args and CRD Spec values (RIG-12026) - #228
Conversation
|
All-clear at 75ca15c Reviewed head 75ca15c (round 2, interdiff 295215d..75ca15c). Round 1 (6fc5f99): four medium findings, all fixed in 295215d. Round 2 (295215d): two high and two medium regressions from round 1, all fixed in 75ca15c. The interdiff review on 75ca15c has no high or medium findings. Residuals, accepted and listed in the PR body: an indented Name: header (low, pinned as an xfail row); Spec: followed by Status: keeps Status values (out of scope by design); an info-level over-mask on name:/value: list items under a Spec key. |
5d9f51d to
a6aaf28
Compare
75ca15c to
f74aa8f
Compare
|
All-clear at f74aa8f |
Describe output printed literal values under Command:, Args: and a CRD Spec: block raw. Mask them in _describe_spans. Gate the block rules on a column-zero Name:/Namespace: describe header, so Python docstrings with Args: sections are not masked. Adds ten rows, four of which fail before the fix (pod Args x2, pod Command, CRD Spec). Co-authored-by: Matt Wilkinson <matt@rigel.build>
…026 review) Review of 6fc5f99 found medium bypasses in the new Spec rule. The ref gate matched (v1: anywhere and an unanchored <none> prefix, so a secret could hide behind either. Anchor the ref forms. A deeper Spec line that ends in a colon is a block-scalar value, not a key: mask it. A column-zero Spec: header opens its block without the Name: header, so a saved fragment is masked. Command: and Args: keep the describe header gate. Known gaps, not fixed: an indented Name: header (low, real describe output puts Name: at column zero), and a YAML Spec: at column zero is over-masked.
…review r2) Interdiff review of 295215d found regressions from the round-1 change. The Spec branch dropped its whole-line fallback, so a dotted or spaced key, a list item under Spec or under a key, a bare line at key column, and a Command: key nested in Spec printed raw. Restore the whole-line mask for any Spec line that is not a plain identifier key. Add six rows pinning those shapes.
a6aaf28 to
0ecf7e6
Compare
f74aa8f to
f41eddd
Compare
|
All-clear at f41eddd |
What does this do
kubectl describeoutput now masks the values underCommand:,Args:, and a CRDSpec:block. Those values printed raw before (--db-pass=<value>in Args, a bare token in Command,adminPassword:under HelmRelease Spec).Why do we need it
RIG-12026, follow-up to RIG-11965 (nebula#223). Option A masks the whole output of a read it cannot parse, but
describehas a clean shape, so it stays unmasked. The RIG-11965 allowlist review flagged both paths as high.Summary
redact_kubernetes._describe_spans:Command:/Args:blocks mask every line under them, and an inlineCommand: argvvalue masks after the header.Spec:blocks mask eachkey: valuescalar, except<set to the key ...>and<none>refs.Name:/Namespace:describe header. A column-zeroSpec:opens its block alone. Python docstrings withArgs:are not masked.5d9f51d4).redact_kubernetes.pyand the test file. An implement child re-checked them and made no edits.Verification
494a2684: 4 rows fail. Green: 10 of 10 describe rows pass.6fc5f998: not clear, no high. Four medium fixed in295215dd.pytest tests/agent/ -k redacton295215dd: 1113 passed, 2 skipped, 9 xfailed.ruff checkon the touched files: clean.Risks
Name:header (low) disables the Command and Args gate. Pinned as an xfail row.Spec:at column zero is over-masked, not leaked.Spec impact
None.
Checks skipped:
nebula has no pre-push hook config; GitHub Actions ci.yaml runs its checksRefs RIG-12026
Co-authored-by: Matt Wilkinson matt@rigel.build