# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 --- description: | ### Document Name - ASR-PCI_3.2.1_RDS.1 ## What does this document do? This document changes public RDS snapshot to private ## 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 RDS.1](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-pci-controls.html#pcidss-rds-1) schemaVersion: '0.3' assumeRole: '{{ AutomationAssumeRole }}' outputs: - Remediation.Output - ParseInput.AffectedObject parameters: Finding: type: StringMap description: The input from the Orchestrator Step function for the PCI.RDS.1 finding 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+=,.@-]+$' RemediationRoleName: type: String default: "SO0111-MakeRDSSnapshotPrivate" allowedPattern: '^[\w+=,.@-]+$' mainSteps: - name: ParseInput action: 'aws:executeScript' outputs: - Name: DBSnapshotId Selector: $.Payload.resource_id Type: String - Name: DBSnapshotType Selector: $.Payload.matches[0] Type: String - Name: FindingId Selector: $.Payload.finding_id Type: String - Name: ProductArn Selector: $.Payload.product_arn Type: String - Name: AffectedObject Selector: $.Payload.object Type: StringMap - Name: Type Selector: $.Payload.type Type: String - Name: RemediationRegion Selector: $.Payload.resource_region Type: String - Name: RemediationAccount Selector: $.Payload.account_id Type: String inputs: InputPayload: Finding: '{{Finding}}' parse_id_pattern: '^arn:(?:aws|aws-cn|aws-us-gov):rds:(?:[a-z]{2}(?:-gov)?-[a-z]+-\d):\d{12}:(cluster-snapshot|snapshot):([a-zA-Z](?:[0-9a-zA-Z]+-)*[0-9a-zA-Z]+)$' resource_index: 2 expected_control_id: - 'PCI.RDS.1' Runtime: python3.8 Handler: parse_event Script: |- %%SCRIPT=common/parse_input.py%% nextStep: Remediation - name: Remediation action: 'aws:executeAutomation' isEnd: false inputs: DocumentName: ASR-MakeRDSSnapshotPrivate TargetLocations: - Accounts: [ '{{ParseInput.RemediationAccount}}' ] Regions: [ '{{ParseInput.RemediationRegion}}' ] ExecutionRoleName: '{{RemediationRoleName}}' RuntimeParameters: DBSnapshotId: '{{ParseInput.DBSnapshotId}}' DBSnapshotType: '{{ParseInput.DBSnapshotType}}' AutomationAssumeRole: 'arn:{{global:AWS_PARTITION}}:iam::{{global:ACCOUNT_ID}}:role/{{RemediationRoleName}}' nextStep: UpdateFinding - name: UpdateFinding action: 'aws:executeAwsApi' inputs: Service: securityhub Api: BatchUpdateFindings FindingIdentifiers: - Id: '{{ParseInput.FindingId}}' ProductArn: '{{ParseInput.ProductArn}}' Note: Text: RDS DB Snapshot modified to private UpdatedBy: ASR-PCI_3.2.1_RDS.1 Workflow: Status: RESOLVED description: Update finding isEnd: true