Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
chore: add encryption, https-only, access logging to all buckets (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
carvantes committed Mar 18, 2021
1 parent f24ffe7 commit d27c114
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
53 changes: 53 additions & 0 deletions cloudformation/bulkExport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,33 @@ Resources:

GlueScriptsBucket:
Type: AWS::S3::Bucket
Properties:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
LoggingConfiguration:
DestinationBucketName: !Ref FHIRLogsBucket
LogFilePrefix: 'GlueScriptsBucket'

GlueScriptsBucketHttpsOnlyPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref GlueScriptsBucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: AllowSSLRequestsOnly
Effect: Deny
Principal: '*'
Action:
- s3:*
Resource:
- !GetAtt GlueScriptsBucket.Arn
- !Join ['', [!GetAtt GlueScriptsBucket.Arn, '/*']]
Condition:
Bool:
'aws:SecureTransport': false

BulkExportResultsBucket:
Type: AWS::S3::Bucket
Expand All @@ -51,6 +78,32 @@ Resources:
- Id: ExpirationRule
Status: Enabled
ExpirationInDays: '3'
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
LoggingConfiguration:
DestinationBucketName: !Ref FHIRLogsBucket
LogFilePrefix: 'BulkExportResultsBucket'

BulkExportResultsBucketHttpsOnlyPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref BulkExportResultsBucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: AllowSSLRequestsOnly
Effect: Deny
Principal: '*'
Action:
- s3:*
Resource:
- !GetAtt BulkExportResultsBucket.Arn
- !Join ['', [!GetAtt BulkExportResultsBucket.Arn, '/*']]
Condition:
Bool:
'aws:SecureTransport': false

GlueJobRole:
Type: AWS::IAM::Role
Expand Down
22 changes: 22 additions & 0 deletions serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ resources:
UpdateReplacePolicy: Retain
Properties:
AccessControl: LogDeliveryWrite
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
FHIRBinaryBucketHttpsOnlyPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Expand All @@ -329,6 +333,24 @@ resources:
Condition:
Bool:
'aws:SecureTransport': false
FHIRLogsBucketHttpsOnlyPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref FHIRLogsBucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: AllowSSLRequestsOnly
Effect: Deny
Principal: '*'
Action:
- s3:*
Resource:
- !GetAtt FHIRLogsBucket.Arn
- !Join ['', [!GetAtt FHIRLogsBucket.Arn, '/*']]
Condition:
Bool:
'aws:SecureTransport': false
FhirServerLambdaRole:
Type: AWS::IAM::Role
Properties:
Expand Down

0 comments on commit d27c114

Please sign in to comment.