Skip to content

Only redact non-short secrets ending in suffix#145

Open
DrJosh9000 wants to merge 1 commit intomainfrom
ps-1448-buildkite-logs-redactor-patterns-are-evaluated-greedily-and
Open

Only redact non-short secrets ending in suffix#145
DrJosh9000 wants to merge 1 commit intomainfrom
ps-1448-buildkite-logs-redactor-patterns-are-evaluated-greedily-and

Conversation

@DrJosh9000
Copy link
Contributor

What

  • Only redact secrets that are at least 6 characters long
  • Only redact secrets from env vars that strictly have one of the suffixes, not merely contained anywhere in the string

Why

Addresses buildkite/agent#3588

Unlike the standard environment-variable-based secret redaction in the agent, which implements the two rules above, buildkite-agent redactor add will add nearly any arbitrary string to the redactors for the current job. This behaviour allows users to more flexibly redact particular strings that don't necessarily conform to the default limits by calling buildkite-agent redactor add. Since we're calling it, we should apply the default rules.

@DrJosh9000 DrJosh9000 requested a review from a team as a code owner November 20, 2025 05:13
@AliSoftware
Copy link

AliSoftware commented Nov 22, 2025

Damn, I only saw you opened this after I worked on it and opened my own PR #146 😅

I see that yours also introduces the MinSecretSize 👍 while mine doesn't. [EDIT] Actually I added the check on size as well now

That being said, mine adds unit tests too, so maybe still worth a look?

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