def find_sh_correlation_match()

in security_hub_correlation_cdk/lambdas/create_sh_finding/create_sh_finding.py [0:0]


def find_sh_correlation_match(event):
    sh_resource = event['Records'][0]['dynamodb']['NewImage']['ResourceId']['S']
    logger.info('Searching DynamoDB entry for {}...'.format(sh_resource))
    ddbtable = ddb.Table(DYNAMODB_TABLE)
    try:
        network_correlation(sh_resource, ddbtable)
        macie_correlation(sh_resource, ddbtable)
        backdoor_correlation(sh_resource, ddbtable)
    except ClientError as error_handle:
        logger.error(error_handle.dynamodb_match['Error']['Code'])