1 Answer
- Newest
- Most votes
- Most comments
0
Here's how to add remediation actions to a Conformance Pack template:
Basic Structure for Adding Remediation:
Resources:
# Original Config Rule
YourConfigRule:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: rule-name
Source:
Owner: AWS
SourceIdentifier: RULE_IDENTIFIER
# Add Remediation
YourRemediationConfig:
Type: AWS::Config::RemediationConfiguration
Properties:
ConfigRuleName: !Ref YourConfigRule
TargetId: AWS-RunPowerShell # or other SSM automation
TargetType: SSM_DOCUMENT
Parameters:
AutomationAssumeRole:
StaticValue:
Values:
- !Sub arn:aws:iam::${AWS::AccountId}:role/YourRemediationRole
** Example with Specific Rule and Remediation:**
Resources:
# S3BucketPublicReadProhibited Rule
S3PublicReadRule:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: s3-bucket-public-read-prohibited
Source:
Owner: AWS
SourceIdentifier: S3_BUCKET_PUBLIC_READ_PROHIBITED
# Remediation for S3 Public Read
S3PublicReadRemediation:
Type: AWS::Config::RemediationConfiguration
Properties:
ConfigRuleName: !Ref S3PublicReadRule
TargetId: AWS-DisableS3BucketPublicReadWrite
TargetType: SSM_DOCUMENT
Parameters:
AutomationAssumeRole:
StaticValue:
Values:
- !Sub arn:aws:iam::${AWS::AccountId}:role/RemediationRole
S3BucketName:
ResourceValue:
Value: RESOURCE_ID
** Required IAM Role:**
RemediationRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: ssm.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonS3FullAccess
- arn:aws:iam::aws:policy/service-role/AmazonSSMAutomationRole
** Update Conformance Pack:**
# Using AWS CLI
aws configservice put-conformance-pack \
--conformance-pack-name FedRAMP-Moderate \
--template-body file://updated-template.yaml
Or using AWS Console Navigate to AWS Config > Conformance Packs > Edit
More reference https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-remediationconfiguration.html
answered a year ago
Relevant content
- asked 3 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago

Hi, thanks for your reply. I did as you said, but if I run "aws configservice put-conformance-pack" command, it says "An error occurred (ConformancePackTemplateValidationException) when calling the PutConformancePack operation: Template passed in the input parameter is invalid". It's running ok if I run the same template in the cloudformation console.