Skip to content

Conversation

moskyb
Copy link
Contributor

@moskyb moskyb commented Jul 18, 2025

Description

In some cases, when using signed pipelines, the values of some environment variables can't necessarily be controlled by the user to the degree that steps will always pass verification -- for example, successive pipeline uploads can change build-level environment such that steps will fail to verify.

To allow users to still use pipeline signing in these situations, we've added a pair of flags to the agent --signing-ignored-env-vars and --verification-ignored-env-vars. As their names imply, they remove environment variables from the step payloads that we sign and verify.

This means that if we knew that environment variables called MOUNTAIN and RIVER were going to change between signing and verification, we could start the signing agents with --signing-ignored-env-vars="MOUNTAIN,RIVER" and the verifying agents with --verification-ignored-env-vars="MOUNTAIN,RIVER".

Setting these flags reduces the integrity of the signature, and thus weakens the security guarantees that signed pipelines provides. As such, when in use, signing pipelines with ignored env vars will always emit a warning. The intent is that the use of these flags will be a stopgap until agent environments can be better controlled.

This PR relies on the associated one in go-pipeline.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

@moskyb moskyb requested a review from a team July 21, 2025 05:09
@moskyb moskyb changed the title SPIKE: Support ignoring env vars in job signatures Support ignoring env vars in job signatures Jul 21, 2025
github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20220812150832-b6b31c6eeeaf
github.com/buildkite/bintest/v3 v3.3.0
github.com/buildkite/go-pipeline v0.14.0
github.com/buildkite/go-pipeline v0.14.1-0.20250718044939-1ded6233e93a
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume you intend to do a go-pipeline release before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes! very much the plan

},
cli.StringSliceFlag{
Name: "verification-ignored-env-vars",
Usage: "A list of environment variable names to ignore when signing the pipeline. These variables (and their values) will not be included in the signature. For signatures to match, the corresponding flag must be set on the agent that verifies the signature and runs the job",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same usage string as the other new flag? Should it match the comment in agent_configuration.go?

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.

2 participants