Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Fixing KeyError details Lambdas CIS_2-9_RR & CIS_1-3_1-4_RR #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions SecurityHub_CISPlaybooks_CloudFormation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Resources:
import datetime
import os
def lambda_handler(event, context):
nonRotatedKeyUser = str(event['detail']['findings'][0]['Resources'][0]['Details']['Other']['userName'])
nonRotatedKeyUser = str(event['detail']['findings'][0]['Resources'][0]['Id']).rsplit('/', 1)[-1]
findingId = str(event['detail']['findings'][0]['Id'])
lambdaFunctionName = os.environ['AWS_LAMBDA_FUNCTION_NAME']
# Create bot3 clients and resource
Expand Down Expand Up @@ -1024,7 +1024,7 @@ Resources:
import os
def lambda_handler(event, context):
# Grab non-logged VPC ID from Security Hub finding
noncompliantVPC = str(event['detail']['findings'][0]['Resources'][0]['Details']['Other']['vpcId'])
noncompliantVPC = str(event['detail']['findings'][0]['Resources'][0]['Id']).rsplit('/', 1)[-1]
findingId = str(event['detail']['findings'][0]['Id'])
# import lambda runtime vars
lambdaFunctionName = os.environ['AWS_LAMBDA_FUNCTION_NAME']
Expand Down Expand Up @@ -1714,4 +1714,4 @@ Resources:
SourceArn:
Fn::GetAtt:
- "CIS43RREventRule"
- "Arn"
- "Arn"