Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to specify full KMS key ARN for pipeline signing. #1422

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

toothbrush
Copy link
Contributor

Description

We have a use case where we want to have a single KMS key that Buildkite agents in multiple accounts can use to sign and verify pipeline steps. By letting the user specify the whole key ARN rather than just the key ID, the user is free to use a key wherever they want.

We are aware that this is a breaking change, which is not ideal (i.e., if a user has already specified the PipelineSigningKMSKeyId parameter, they'll need to replace it with PipelineSigningKMSKeyArn). Please let us know if it'd be better to accept either/or key ID or ARN -- the reason we didn't implement the change like that off the bat is that as far as we could tell, that'd add a bunch of ugly if-statements everywhere to check which had been provided and do slightly different things accordingly.

CHANGELOG

  • templates/aws-stack.yml: Rename PipelineSigningKMSKeyId to PipelineSigningKMSKeyArn and avoid assuming the key is in the same account/region as the agent stack.

We have a use case where we want to have a single KMS key that Buildkite
agents in multiple accounts can use to sign and verify pipeline steps.
By letting the user specify the whole key ARN rather than just the key
ID, the user is free to use a key wherever they want.

* templates/aws-stack.yml: Rename PipelineSigningKMSKeyId to
PipelineSigningKMSKeyArn and avoid assuming the key is in the same
account/region as the agent stack.

Co-authored-by: Matty Boyles <[email protected]>
@toothbrush
Copy link
Contributor Author

toothbrush commented Dec 30, 2024

(for what it's worth, this patch worked well for us and we are now able to use a cross-account KMS key)

@yob yob requested a review from a team December 30, 2024 05:43
@wolfeidau
Copy link
Contributor

@toothbrush This is a good suggestion, I am not sure it is wise to change the current field as it will suprise poeple using this currently.

I 100% want to enable the feature though, not sure if you had thoughts on how we could support both?

@toothbrush
Copy link
Contributor Author

@toothbrush This is a good suggestion, I am not sure it is wise to change the current field as it will suprise poeple using this currently.

I agree, i think we can provide a more seamless way at the expense of a bit more complex CloudFormation.

I 100% want to enable the feature though, not sure if you had thoughts on how we could support both?

I appreciate the attitude! We were thinking that it should be possible to support both PipelineSigningKMSKeyId and PipelineSigningKMSKeyArn parameters, with assertions that you can only provide one, and logic in the template to construct the ARN based on whichever field the user provided.

We didn't want to dive straight in and do that given the complexity, but since you're open to the idea, we'll have a crack and see what comes out. Thanks @wolfeidau!

@MathewBoyles
Copy link

@wolfeidau Please see alterative PR here: #1424

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