Skip to content

Commit

Permalink
Release/1.5.4 (#175) (#176)
Browse files Browse the repository at this point in the history
* upgraded lambda runtime python to 3.9

* changed SSL permissions set * as principal all buckets

* added version and manifest

* removed action from lambda code bucket policy PutObjectAcl

* added update request type Update event  to password policy lambda

* stack changes for AWSConfigRole to AWS_ConfigRole replacement
  • Loading branch information
silavjy committed May 5, 2022
1 parent 6c6125b commit e762a15
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 16 deletions.
2 changes: 1 addition & 1 deletion AccountBaseline-CFN/AB-SECLZ-LambdaAndTrigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Resources:
Fn::GetAtt:
- rLambdaRole
- Arn
Runtime: python3.7
Runtime: python3.9
Tags: []
EventRuleRole:
Type: AWS::IAM::Role
Expand Down
2 changes: 1 addition & 1 deletion CFN/EC-lz-Config-SecurityHub-all-regions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Resources:
- sts:AssumeRole
Path: /
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSConfigRole
- arn:aws:iam::aws:policy/service-role/AWS_ConfigRole
Policies:
- PolicyName: root
PolicyDocument:
Expand Down
2 changes: 1 addition & 1 deletion CFN/EC-lz-config-cloudtrail-logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ Resources:
Action:
- 'sts:AssumeRole'
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/service-role/AWSConfigRole'
- 'arn:aws:iam::aws:policy/service-role/AWS_ConfigRole'
Policies:
- PolicyName: root
PolicyDocument:
Expand Down
5 changes: 2 additions & 3 deletions CFN/EC-lz-iam-setting_password_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ Resources:
raise e
finally:
cfnresponse.send(event, context, response_status, {"Response":response_data}, '')
elif 'RequestType' in event and event['RequestType'] == 'Create':
elif 'RequestType' in event and (event['RequestType'] == 'Create' or event['RequestType'] == 'Update'):
try:
response = boto3.client('iam').update_account_password_policy(
AllowUsersToChangePassword = bool(event['ResourceProperties']['AllowUsersToChangePassword']),
# HardExpiry=bool(event['ResourceProperties']['HardExpiry']),
MaxPasswordAge=int(event['ResourceProperties']['MaxPasswordAge']),
MinimumPasswordLength=int(event['ResourceProperties']['MinimumPasswordLength']),
RequireLowercaseCharacters=bool(event['ResourceProperties']['RequireLowercaseCharacters']),
Expand All @@ -161,7 +160,7 @@ Resources:
Handler: 'index.lambda_handler'
MemorySize: 128
Role: !GetAtt LambdaExecutionRole.Arn
Runtime: python3.6
Runtime: python3.9
Timeout: 60

PasswordPolicy:
Expand Down
4 changes: 2 additions & 2 deletions CFN/EC-lz-logshipper-lambdas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Resources:
Handler: 'CloudtrailLogShipper.lambda_handler'
MemorySize: 128
Role: !GetAtt LogShipperLambdaExecutionRole.Arn
Runtime: python3.8
Runtime: python3.9
Timeout: 900
Environment:
Variables:
Expand Down Expand Up @@ -196,7 +196,7 @@ Resources:
Code: ##configCodeURI##
Handler: 'ConfigLogShipper.lambda_handler'
Role: !GetAtt LogShipperLambdaExecutionRole.Arn
Runtime: python3.8
Runtime: python3.9
Timeout: 900
Environment:
Variables:
Expand Down
20 changes: 19 additions & 1 deletion CFN/EC-lz-s3-bucket-lambda-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,30 @@ Resources:
- "s3:GetObjectAcl"
- "s3:GetObjectVersion"
- "s3:PutObject"
- "s3:PutObjectAcl"
Resource:
Fn::Join:
- ""
-
- !GetAtt LambdaArtefactsBucket.Arn
- "/*"
-
Sid: "LambdaBucketSSL"
Action: s3:*
Principal: "*"
Effect: Deny
Resource:
- Fn::Join:
- ""
-
- !GetAtt LambdaArtefactsBucket.Arn
- Fn::Join:
- ""
-
- !GetAtt LambdaArtefactsBucket.Arn
- "/*"
Condition:
Bool:
"aws:SecureTransport": "false"



9 changes: 3 additions & 6 deletions CFN/EC-lz-s3-buckets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ Resources:
-
Sid: "AWSCloudTrailgBucketSSL"
Action: s3:*
Principal:
Service: cloudtrail.amazonaws.com
Principal: "*"
Effect: Deny
Resource:
- Fn::Join:
Expand Down Expand Up @@ -248,8 +247,7 @@ Resources:
-
Sid: "AWSConfigBucketSSL"
Action: "s3:*"
Principal:
Service: config.amazonaws.com
Principal: "*"
Effect: Deny
Resource:
- Fn::Join:
Expand Down Expand Up @@ -306,8 +304,7 @@ Resources:
Sid: "AWSAccessLogsBucketSSL"
Action: "s3:*"
Effect: Deny
Principal:
Service: cloudwatch.amazonaws.com
Principal: "*"
Resource:
- Fn::Join:
- ""
Expand Down
2 changes: 1 addition & 1 deletion EC-SLZ-Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.3
1.5.4
39 changes: 39 additions & 0 deletions Updates/1.5.4/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ "version" : "1.5.4",
"regions" : ["ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-west-1", "eu-west-2","eu-west-3","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"],
"tags" : [
{ "Key": "Organization","Value": "EC" },
{ "Key": "Owner","Value": "DIGIT.C.1" },
{ "Key": "Environment","Value": "prod" },
{ "Key": "Criticity","Value": "high" },
{ "Key": "Project","Value": "secLZ" },
{ "Key": "Confidentiality","Value": "confidential" },
{ "Key": "ApplicationRole","Value": "security" }
],
"stacks" : {
"SECLZ-Iam-Password-Policy" : {
"update" : true
},
"SECLZ-LogShipper-Lambdas-Bucket" : {
"update" : true
},
"SECLZ-LogShipper-Lambdas" : {
"update" : true
},
"SECLZ-Central-Buckets" : {
"update" : true
},
"SECLZ-config-cloudtrail-SNS" : {
"update" : true
}
},
"stacksets" : {
"SECLZ-Enable-Config-SecurityHub-Globally" : {
"update" : true
}
},
"accounts" : {
"exclude" : [],
"include" : []
}

}

0 comments on commit e762a15

Please sign in to comment.