-
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
aws_ses: SES ReceiptRuleSet S3 action grants too wide permissions #29811
aws_ses: SES ReceiptRuleSet S3 action grants too wide permissions #29811
Comments
Yes, it's missing the required conditions in the bucket policy. // create a DummyStack
export class DummyStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
const ruleSet = new ses.ReceiptRuleSet(this, 'RuleSet');
const defaultRule = ruleSet.addRule('DefaultRule', {
recipients: ['foo.com'],
enabled: true,
});
defaultRule.addAction(new sesa.S3({
bucket: new s3.Bucket(this, 'EmailBucket', {
removalPolicy: RemovalPolicy.DESTROY,
bucketName: 'mock-bucket-name',
}),
}));
}
} BucketPolicy: Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: EmailBucket843A740F
PolicyDocument:
Statement:
- Action: s3:PutObject
Condition:
StringEquals:
aws:Referer:
Ref: AWS::AccountId
Effect: Allow
Principal:
Service: ses.amazonaws.com
Resource:
Fn::Join:
- ""
- - Fn::GetAtt:
- EmailBucket843A740F
- Arn
- /*
Version: "2012-10-17" Guess we should fix here aws-cdk/packages/aws-cdk-lib/aws-ses-actions/lib/s3.ts Lines 56 to 59 in a7384c2
|
|
1 similar comment
|
Since the PR for this issue is reverted, I am re-opening this issue, although I am not sure if there is a good way to fix without running into the same problem that caused the revert.. |
Describe the bug
SES ReceiptRuleSet S3 action grants too wide permissions
Expected Behavior
Should work as documented
https://docs.aws.amazon.com/ses/latest/dg/receiving-email-permissions.html#receiving-email-permissions-s3
Currently missing the following block:
Current Behavior
aws-cdk/packages/aws-cdk-lib/aws-ses-actions/test/actions.test.ts
Line 186 in a7384c2
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.137.0
Framework Version
No response
Node.js Version
20
OS
all
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: