feat: disallow cross account asset publishing in some scenarios#31623
feat: disallow cross account asset publishing in some scenarios#31623mergify[bot] merged 14 commits intomainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
|
For whoever ends up picking this PR up: hopefully there are just a couple of methods to implements: aws-cdk/packages/aws-cdk/lib/api/deployments.ts Lines 676 to 680 in 3a930fb aws-cdk/packages/aws-cdk/lib/api/deployments.ts Lines 682 to 685 in 3a930fb |
| "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true, | ||
| "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true, | ||
| "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true | ||
| "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true, |
There was a problem hiding this comment.
This was automatically done as part of the build 🤷♂️
| // Check if we can retrieve the bucketName from the output | ||
| const bucketNameOutput = response.Stacks[0].Outputs?.find( | ||
| output => output.OutputKey === 'BucketName', | ||
| ); |
There was a problem hiding this comment.
Use the logical ID of the resource (DescribeStackResources).
Co-authored-by: Rico Hermans <rix0rrr@gmail.com>
Co-authored-by: Rico Hermans <rix0rrr@gmail.com>
| options.overrideTemplate); | ||
| let bootstrapStackName: string | undefined; | ||
| try { | ||
| bootstrapStackName = (await options.envResources.lookupToolkit()).stackName; |
There was a problem hiding this comment.
This performs a lookupToolkit, which returns ToolkitInfo, which has most of the information already.
Why can't the logic live there?
There was a problem hiding this comment.
I actually tried that first, but it started getting a bit ugly because that's an abstract class and we have a "we don't exist yet" version of that class, which kept breaking tests and was difficult to mock properly. So I just said screw it and refactored the change into functional util, which was much easier to test and mock.
|
Due to the nature of the change this is essentially not integ-testable so we will not be adding an integ test for this. Added pr-linter/exempt-test flag |
|
Recreated the vulnerability. Got this exception when my bootstrap version is less than 21: And no such failure when our bootstrap version has been updated Which is the intended functionality |
|
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
|
I also added readme change since this isn't really a feat, more like a security fix but I'm keeping what eli designated the pr as. If we want readme changes feel free to request changes or remove the flag |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main 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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #.
Reason for this change
Description of changes
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license