Skip to content

Commit

Permalink
fix(AWS Deploy): Improve S3 bucket policy security (#8542)
Browse files Browse the repository at this point in the history
  • Loading branch information
as19ish committed Nov 24, 2020
1 parent 445369e commit 2a9b57b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/aws/deploy/lib/checkForChanges.test.js
Expand Up @@ -1089,7 +1089,7 @@ describe('checkForChanges #2', () => {
'serverless/test-package-artifact/dev/1589988704359-2020-05-20T15:31:44.359Z/compiled-cloudformation-template.json',
})
.returns({
Metadata: { filesha256: 'GqTahQAAhwcDCqdXMSfmMNHTQodNZ2NLj8MEoMsk8i0=' },
Metadata: { filesha256: 'SR2Mu/JOUfvCHkOakMdXJJNBekv7yYptwBEuR+BblTU=' },
});

headObjectStub
Expand Down
11 changes: 11 additions & 0 deletions lib/plugins/aws/package/lib/core-cloudformation-template.json
Expand Up @@ -40,6 +40,17 @@
"/*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{ "Ref": "AWS::Partition" },
":s3:::",
{ "Ref": "ServerlessDeploymentBucket" }
]
]
}
],
"Condition": {
Expand Down
6 changes: 6 additions & 0 deletions lib/plugins/aws/package/lib/generateCoreTemplate.test.js
Expand Up @@ -42,6 +42,12 @@ describe('#generateCoreTemplate()', () => {
],
],
},
{
'Fn::Join': [
'',
['arn:', { Ref: 'AWS::Partition' }, ':s3:::', { Ref: 'ServerlessDeploymentBucket' }],
],
},
],
Condition: {
Bool: { 'aws:SecureTransport': false },
Expand Down

0 comments on commit 2a9b57b

Please sign in to comment.