# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 --- description: | ### Document Name - ASR-PCI_3.2.1_Config.1 ## What does this document do? Enables AWS Config: * Turns on recording for all resources. * Creates an encrypted bucket for Config logging. * Creates a logging bucket for access logs for the config bucket * Creates an SNS topic for Config notifications * Creates a service-linked role ## Input Parameters * Finding: (Required) Security Hub finding details JSON * AutomationAssumeRole: (Required) The ARN of the role that allows Automation to perform the actions on your behalf. ## Documentation Links * [PCI Config.1](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-pci-controls.html#pcidss-config-1) schemaVersion: "0.3" assumeRole: "{{ AutomationAssumeRole }}" parameters: AutomationAssumeRole: type: String description: (Required) The ARN of the role that allows Automation to perform the actions on your behalf. allowedPattern: '^arn:(?:aws|aws-us-gov|aws-cn):iam::\d{12}:role/[\w+=,.@-]+$' Finding: type: StringMap description: The input from the Orchestrator Step function for the PCI.Config.1 finding KMSKeyArn: type: String default: >- {{ssm:/Solutions/SO0111/CMK_REMEDIATION_ARN}} description: The ARN of the KMS key created by ASR for remediations allowedPattern: '^arn:(?:aws|aws-us-gov|aws-cn):kms:(?:[a-z]{2}(?:-gov)?-[a-z]+-\d):\d{12}:(?:(?:alias/[A-Za-z0-9/-_])|(?:key/(?i:[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})))$' outputs: - Remediation.Output - ParseInput.AffectedObject mainSteps: - name: ParseInput action: 'aws:executeScript' outputs: - Name: FindingId Selector: $.Payload.finding_id Type: String - Name: ProductArn Selector: $.Payload.product_arn Type: String - Name: AWSPartition Selector: $.Payload.partition Type: String - Name: AffectedObject Selector: $.Payload.object Type: StringMap inputs: InputPayload: Finding: '{{Finding}}' parse_id_pattern: '' expected_control_id: - 'PCI.Config.1' Runtime: python3.8 Handler: parse_event Script: |- %%SCRIPT=common/parse_input.py%% isEnd: false - name: Remediation action: 'aws:executeAutomation' isEnd: false inputs: DocumentName: ASR-EnableAWSConfig RuntimeParameters: SNSTopicName: 'SO0111-SHARR-AWSConfigNotification' KMSKeyArn: '{{KMSKeyArn}}' AutomationAssumeRole: 'arn:{{global:AWS_PARTITION}}:iam::{{global:ACCOUNT_ID}}:role/SO0111-EnableAWSConfig' - name: UpdateFinding action: 'aws:executeAwsApi' inputs: Service: securityhub Api: BatchUpdateFindings FindingIdentifiers: - Id: '{{ParseInput.FindingId}}' ProductArn: '{{ParseInput.ProductArn}}' Note: Text: 'AWS Config enabled' UpdatedBy: 'ASR-PCI_3.2.1_Config.1' Workflow: Status: RESOLVED description: Update finding isEnd: true