Skip to content

Make secret value rejection on pipeline upload optional#1589

Merged
moskyb merged 2 commits into
mainfrom
pipeline-upload-reject-secrets
Mar 23, 2022
Merged

Make secret value rejection on pipeline upload optional#1589
moskyb merged 2 commits into
mainfrom
pipeline-upload-reject-secrets

Conversation

@moskyb

@moskyb moskyb commented Mar 22, 2022

Copy link
Copy Markdown
Contributor

🤔 Problem: In #1523, we made it so that the buildkite-agent pipeline upload command would reject any pipeline yaml that had sensitive values in it. We shipped this as part of v3.34. This is an awesome security feature, and prevents a bunch of footguns, but unfortunately it's a breaking change, and we accidentally shipped it as part of a minor release.

✅ Solution: This PR reverts default redaction behaviour to how it was previously, with some slight changes:

  • The newer behaviour (rejecting a pipeline upload if there's juicy secrets in it) is available with the --reject-secrets flag
  • Even when the --reject-secrets flag isn't used, the command issues a warning that:
    • There are unredacted secrets in the pipeline
    • and that default behaviour in agent v4 will be to reject these pipeline uploads

Slightly related, it makes the --dry-run flag for the pipeline upload command work with redaction.

Screenshots:
Without --reject-secrets:

Screen Shot 2022-03-22 at 2 59 50 PM

With --reject-secrets:

Screen Shot 2022-03-22 at 3 00 10 PM

These are from my local machine using the --dry-run flag, using this pipeline:

steps:
  - label: ":hammer: Example Script"
    command: "echo $COOL_PASSWORD"
    artifact_paths: "artifacts/*"
    agents:
      queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"

Closes #1578
Closes PIP-309

@moskyb moskyb requested review from eleanorakh and pda March 22, 2022 02:02
@moskyb moskyb force-pushed the pipeline-upload-reject-secrets branch from bd36e0c to 684d9a5 Compare March 22, 2022 02:09
@moskyb

moskyb commented Mar 22, 2022

Copy link
Copy Markdown
Contributor Author

i've also tested that this works in a non-dry run environment, using an agent on my machine:

With --reject-secrets:

Screen Shot 2022-03-23 at 10 20 35 AM

Without --reject-secrets:

Screen Shot 2022-03-23 at 10 19 51 AM

Comment thread clicommand/pipeline_upload.go Outdated
@eleanorakh eleanorakh requested a review from tessereth March 22, 2022 22:02
Comment thread clicommand/pipeline_upload.go Outdated
Comment thread clicommand/pipeline_upload.go Outdated
Comment thread clicommand/pipeline_upload.go Outdated

@pda pda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good plan 👍🏼

Comment thread clicommand/pipeline_upload.go Outdated
Comment thread redaction/redactor.go
@moskyb moskyb requested review from pda and ticky March 23, 2022 01:22

@pda pda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good, up to you if you want to fix #1589 (comment)

@moskyb moskyb force-pushed the pipeline-upload-reject-secrets branch 2 times, most recently from 50c34d3 to bb17702 Compare March 23, 2022 01:45
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.

Feature flag to reject pipelines with redacted variables

4 participants