Skip to content

Commit

Permalink
chore: apply all PublicAccessBlockConfiguration for all s3 buckets (#…
Browse files Browse the repository at this point in the history
…5130)

Fixes #5089


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
  • Loading branch information
iamhopaul123 authored Jul 26, 2023
1 parent 5109d75 commit ac4ded0
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 1 deletion.
2 changes: 2 additions & 0 deletions e2e/multi-pipeline/s3template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true

e2epipelineaddonBucketPolicy:
Metadata:
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/addon/testdata/merge/env/second.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true

MyBucketAccessPolicy:
Type: AWS::IAM::ManagedPolicy
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/addon/testdata/merge/env/wanted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
MyBucketAccessPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/addon/testdata/merge/second.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true

MyBucketAccessPolicy:
Type: AWS::IAM::ManagedPolicy
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/addon/testdata/merge/wanted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
MyBucketAccessPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/addon/testdata/storage/bucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ Resources:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
ELBAccessLogsBucketPolicy:
Type: AWS::S3::BucketPolicy
Condition: CreateALB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/template/templates/addons/s3/cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/template/templates/addons/s3/env/cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Expand Down
5 changes: 5 additions & 0 deletions internal/pkg/template/templates/app/cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ Resources:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ ELBAccessLogsBucket:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
SSEAlgorithm: AES256
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
5 changes: 5 additions & 0 deletions internal/pkg/template/templates/task/cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ Resources:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
LifecycleConfiguration:
Rules:
# .env files are only needed on the initial RunTask call and are not needed after that.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Resources:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Expand Down

0 comments on commit ac4ded0

Please sign in to comment.