-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(codebuild): Secret env variable as token from another account fails on Key decryption #14483
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
Conversation
37acdca to
fd1e221
Compare
|
I implemented the fix for the test that shows that different account secrets parsed as tokens are not working at the moment due to missing kms policies. Also let me know if we still need to clarify things about the use case. 😄 |
7749b67 to
56dbd21
Compare
|
Okay this is the approach I opted for. It is still missing some tests and more implementation for:
The if statement straight up sucks but I was too tired to figure out a better one. Maybe you can give me a hint or I will look at it tomorrow again. 😄 Any concerns or hints from your side @skinny85 ? |
skinny85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the effort @Kruspe! This looks great, just needs a little bit more polish 🙂.
Also, make sure to update the ReadMe of the CodeBuild module to explain that you can pass Secrets directly in the value property!
skinny85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting this in 'Request changes' to clear it from my ToDo list, @Kruspe please re-request my review (there's a button in the top-right of the PR window, next to my avatar) when you're ready with the last changes!
|
Hey @skinny85 sorry for taking a while to get going here again. It was a busy week. Hope I didn't take up to much capacity in your brain. |
skinny85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @Kruspe! A few suggestions before we merge this in.
|
Hey @skinny85 I fixed mostly everything you mentioned above. There is one open point which we need to discuss (see the review above). |
When creating a SecretValue for SecretsManager save the values of the secret seperatly. Add test cases for SecretValues from an imported Secret
Add direct tests for providing a SecretValue via `SecretValue.secretsManager()`. Remove duplicated code and refactor type checking for SecretValue
We have to check this right away since SecretValues might not be passed as token but rather gets transformed into a string
When creating a new secret or importing it through a stack in another account we need to pass the account to the SecretValue. This allows us to check if the account for where the Project lives is in deed a different one.
…', which is in .gitallowed.
Add test for a secretArn which is provided as a token and fails at this moment due to a missing kms policy
skinny85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @Kruspe!
| // Work around a bug in SecretsManager - | ||
| // when the access is cross-environment, | ||
| // Secret.secretArn returns a partial ARN! | ||
| // So add a "*" at the end, so that the permissions work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // So add a "*" at the end, so that the permissions work | |
| // So add a "-??????" at the end, so that the permissions work |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
fixes #14477
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license