Skip to content

Omit cluster secret request bodies from REST debug logs - #959

Open
lox wants to merge 5 commits into
mainfrom
security/redact-cluster-secret-debug-values
Open

Omit cluster secret request bodies from REST debug logs#959
lox wants to merge 5 commits into
mainfrom
security/redact-cluster-secret-debug-values

Conversation

@lox

@lox lox commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

bk --debug dumps REST request bodies to stderr. Cluster secret create and value-update requests contain plaintext secret material, which should never be copied into terminal or CI logs.

Changes

  • Omit request bodies entirely for cluster secret create and value-update endpoints while retaining request metadata and redacted headers.
  • Preserve byte-for-byte request forwarding and continue showing bodies for unrelated endpoints.
  • Recognize malformed secret paths, including extra slashes and URL delimiters, so invalid IDs cannot expose a body before the API rejects the request.
  • Leave response debug dumps unchanged because the API does not return secret values.

Testing

  • Tests have run locally (with go test ./...)
  • Code is formatted (with go fmt ./...)

Disclosures / Credits

Amp implemented and tested this change under my direction.

@lox
lox requested review from a team as code owners August 24, 2026 07:20

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found no code issues. This changes secret-redaction behavior in the shared debug transport, so it needs human review under the repository's approval policy.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 20206, then answer my questions about the findings.

Install the reading-buildsworth-logs skill to run this.

About buildsworth

Model: gpt-5.6-sol with xhigh thinking.

How to request a review: Comment @buildsworth-bk review on the PR, or request buildsworth-bk as a reviewer.

Risk labels (how buildsworth classifies risk) — buildsworth classifies risk itself from the diff. Unless repository policy already allows L2 approval, grant it by mentioning @buildsworth-bk (see approval ceiling and L2 approval grant):

  • L1 — Low risk (dep bumps, docs/copy, lockfiles, small presentational fixes). buildsworth may approve by default.
  • L2 — Standard risk (new UI, additive API fields, refactors). Approved only when repository policy or a verified grant allows it; otherwise comment-only.
  • L3 — High risk (auth, migrations, payments, secrets, perf-critical paths). Human review always required.

Comment thread pkg/cmd/factory/factory.go Outdated

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One blocking redaction gap remains in the existing malformed-path thread.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 20426, then answer my questions about the findings.

Install the reading-buildsworth-logs skill to run this.

@buildsworth-bk-app
buildsworth-bk-app Bot dismissed their stale review August 25, 2026 06:06

Previous concerns have been addressed.

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The URL-delimiter redaction gap is fixed, and I found no new code issues. This still changes secret handling in the shared debug transport, so it needs human review.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 20751, then answer my questions about the findings.

Install the reading-buildsworth-logs skill to run this.

@lox
lox requested a review from SorchaAbel August 25, 2026 06:31
@lox lox changed the title Redact cluster secret values from REST debug logs Omit cluster secret request bodies from REST debug logs Aug 25, 2026

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found no code issues in the latest revision. This changes secret handling in the shared debug transport, so it still needs human review.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 20782, then answer my questions about the findings.

Install the reading-buildsworth-logs skill to run this.

Comment thread pkg/cmd/factory/factory.go

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found no code issues in the latest revision. This changes handling of plaintext secrets in the shared REST debug transport, so it remains above the L1 approval ceiling and needs human review.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 20826, then answer my questions about the findings.

Install the reading-buildsworth-logs skill to run this.

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.

3 participants