aws-remediate-cis-securityhub/cft/aws-cis-securityhubactions.yml [665:719]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      DocumentVersion='1', # default
                      Parameters={
                          'TrailName': [ TrailName ],
                          'CloudTrailLogGroupArn': [ CloudTrailLogGroupArn ],
                          'CloudWatchRoleArn': [ CloudWatchRoleArn ]
                      }
                  )

              except Exception as e:
                  print(e)
                  print("SSM automation execution error")
                  raise

  CloudTrailCloudWatchLogsLambdaRole:
    Type: AWS::IAM::Role
    Properties:
      Policies:
      - PolicyName: CloudTrailCloudWatchLogsLambdaPolicy
        PolicyDocument:
          Version: 2012-10-17
          Statement:
          - Effect: Allow
            Action:
            - cloudwatch:PutMetricData
            Resource: '*'
          - Effect: Allow
            Action:
            - ssm:StartAutomationExecution
            - logs:CreateLogGroup
            - logs:CreateLogStream
            - logs:PutLogEvents
            - logs:DescribeLogGroups
            - iam:PassRole
            Resource: '*'
          - Effect: Allow
            Action:
            - cloudtrail:UpdateTrail
            - securityhub:UpdateFindings
            Resource: '*'
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
        - Effect: Allow
          Principal: { Service: lambda.amazonaws.com }
          Action:
          - sts:AssumeRole
  
# -------------------------------------------------------------------------------------------------------------------------------------------------------
# CIS AWS Foundations Benchmark - 2.1. – Ensure CloudTrail is enabled in all regions
# -------------------------------------------------------------------------------------------------------------------------------------------------------

  CloudTrailEnabledRule: 
    Type: AWS::Events::Rule
    Properties: 
      Name: CloudTrailEnabledRule
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-remediate-pci-securityhub/cft/aws-security-hub-pci-remediations-template2.yml [1511:1563]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      DocumentVersion='1', # default
                      Parameters={
                          'TrailName': [ TrailName ],
                          'CloudTrailLogGroupArn': [ CloudTrailLogGroupArn ],
                          'CloudWatchRoleArn': [ CloudWatchRoleArn ]
                      }
                  )

              except Exception as e:
                  print(e)
                  print("SSM automation execution error")
                  raise

  CloudTrailCloudWatchLogsLambdaRole:
    Type: AWS::IAM::Role
    Properties:
      Policies:
      - PolicyName: CloudTrailCloudWatchLogsLambdaPolicy
        PolicyDocument:
          Version: 2012-10-17
          Statement:
          - Effect: Allow
            Action:
            - cloudwatch:PutMetricData
            Resource: '*'
          - Effect: Allow
            Action:
            - ssm:StartAutomationExecution
            - logs:CreateLogGroup
            - logs:CreateLogStream
            - logs:PutLogEvents
            - logs:DescribeLogGroups
            - iam:PassRole
            Resource: '*'
          - Effect: Allow
            Action:
            - cloudtrail:UpdateTrail
            - securityhub:UpdateFindings
            Resource: '*'
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
        - Effect: Allow
          Principal: { Service: lambda.amazonaws.com }
          Action:
          - sts:AssumeRole
  

# PCI.CloudTrail.2
  CloudTrailEnabledRule: 
    Type: AWS::Events::Rule
    Properties: 
      Name: CloudTrailEnabledRule
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



