Skip to content

buildkite coordinator: give coordinator agents build-scoped artifact tokens - #16141

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test/cl1004266708
Oct 22, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test/cl1004266708

Conversation

@copybara-service

Copy link
Copy Markdown

buildkite coordinator: give coordinator agents build-scoped artifact tokens

We want to prevent builds from tampering with each others' uploaded artifacts.
The ideal solution would be to grant each agent only
roles/storage.objectCreator on the artifacts bucket, which would allow agents
to upload their own artifacts but not tamper with existing artifacts.
This would require using a random UUID in the upload path.

Unfortunately, buildkite-agent uploads the artifact URL to Buildkite, where
it becomes publicly visible, before uploading the artifact to GCS. This
leaves a window where a malicious job could snipe an artifact URL.

So we take a different approach: use downscoped GCS tokens to grant each job
the ability to only access that build's prefix in the artifacts bucket.

The tokens are generated by the coordinator and sent alongside each job
assignment to agents.

buildkite-agent doesn't support specifying access tokens for GCS uploads
directly, so some cludge with a local token server on the agent is required for
this to work.

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Oct 21, 2026
@copybara-service
copybara-service Bot force-pushed the test/cl1004266708 branch 3 times, most recently from a801d8e to 8f64b0b Compare October 22, 2026 02:42
…tokens

We want to prevent builds from tampering with each others' uploaded artifacts.
The *ideal* solution would be to grant each agent only
`roles/storage.objectCreator` on the artifacts bucket, which would allow agents
to upload their own artifacts but not tamper with existing artifacts.
This would require using a random UUID in the upload path.

Unfortunately, `buildkite-agent` uploads the artifact URL to Buildkite, where
it becomes publicly visible, _before_ uploading the artifact to GCS. This
leaves a window where a malicious job could snipe an artifact URL.

So we take a different approach: use downscoped GCS tokens to grant each job
the ability to _only_ access that build's prefix in the artifacts bucket.

The tokens are generated by the coordinator and sent alongside each job
assignment to agents.

`buildkite-agent` doesn't support specifying access tokens for GCS uploads
directly, so some cludge with a local token server on the agent is required for
this to work.

PiperOrigin-RevId: 1004440638
@copybara-service
copybara-service Bot merged commit c5ab48f into master Oct 22, 2026
8 of 10 checks passed
@copybara-service
copybara-service Bot deleted the test/cl1004266708 branch October 22, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant