-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat: disallow cross account asset publishing in some scenarios #31623
Conversation
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.
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
|
@@ -141,7 +141,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou | |||
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": false, | |||
"@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the logical ID of the resource (DescribeStackResources
).
Co-authored-by: Rico Hermans <[email protected]>
Co-authored-by: Rico Hermans <[email protected]>
@@ -287,8 +288,15 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt | |||
options.envResources, | |||
options.sdk, | |||
options.overrideTemplate); | |||
let bootstrapStackName: string | undefined; | |||
try { | |||
bootstrapStackName = (await options.envResources.lookupToolkit()).stackName; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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