Skip to content

Commit

Permalink
Merge pull request #18 from nodomain/feat/enc-at-rest
Browse files Browse the repository at this point in the history
feat: enable s3 sse default encryption
  • Loading branch information
mariusmitrofan authored Jan 26, 2021
2 parents 5059d51 + 5444a2c commit 27b9628
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions cloudformation-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1718,10 +1718,48 @@ Resources:
SecretString:
Ref: SentryEmailPassword

S3KmsKey:
Type: AWS::KMS::Key
Properties:
EnableKeyRotation: true
KeyPolicy:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: kms:*
Resource: "*"
Principal:
AWS:
- Fn::Sub: arn:aws:iam::${AWS::AccountId}:root
- Effect: Allow
Principal:
AWS: "*"
Action:
- kms:Encrypt
- kms:Decrypt
- kms:ReEncrypt*
- kms:GenerateDataKey*
- kms:CreateGrant
- kms:DescribeKey
Resource: "*"
Condition:
StringEquals:
kms:CallerAccount:
Ref: AWS::AccountId
kms:ViaService:
Fn::Sub: s3.${AWS::Region}.amazonaws.com

SentryBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
BucketEncryption:
ServerSideEncryptionConfiguration:
- BucketKeyEnabled: true
ServerSideEncryptionByDefault:
SSEAlgorithm: 'aws:kms'
KMSMasterKeyID:
Fn::GetAtt: S3KmsKey.Arn
PublicAccessBlockConfiguration:
BlockPublicAcls: True
BlockPublicPolicy: True
Expand Down Expand Up @@ -5720,10 +5758,3 @@ Resources:
print(str(e))
data["Reason"] = str(e)
cfnresponse.send(event, context, cfnresponse.FAILED, data)







0 comments on commit 27b9628

Please sign in to comment.