一键导入
config
Manage AWS Config rules, conformance packs, configuration recorder, and compliance evaluation via AWS CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage AWS Config rules, conformance packs, configuration recorder, and compliance evaluation via AWS CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage AWS Certificate Manager certificates, validation, renewal, and import for ALB, CloudFront, and API Gateway via AWS CLI.
Manage Amazon API Gateway REST APIs, HTTP APIs, WebSocket APIs, stages, and deployments via AWS CLI.
Manage EC2 Auto Scaling groups, launch templates, scaling policies, and scheduled actions via AWS CLI.
Manage Elastic Load Balancers (ALB, NLB, CLB), target groups, listeners, and health checks via AWS CLI.
Manage AWS Organizations accounts, OUs, SCPs, and delegated administration via AWS CLI.
Manage Amazon SageMaker notebooks, training jobs, models, endpoints, and pipelines via AWS CLI.
| name | config |
| description | Manage AWS Config rules, conformance packs, configuration recorder, and compliance evaluation via AWS CLI. |
| metadata | {"openclaw":{"emoji":"📋","requires":{"bins":["aws"]}}} |
Use this skill for compliance and configuration management: tracking resource configurations, evaluating compliance rules, managing conformance packs, querying resource history, and running advanced queries against your AWS inventory.
config:* for full access, or scoped policies# Check configuration recorder status
aws configservice describe-configuration-recorder-status --output table
# Describe configuration recorders
aws configservice describe-configuration-recorders
# Describe delivery channels
aws configservice describe-delivery-channels
# Describe delivery channel status
aws configservice describe-delivery-channel-status --output table
# List discovered resources by type
aws configservice list-discovered-resources --resource-type AWS::EC2::Instance --output table
aws configservice list-discovered-resources --resource-type AWS::S3::Bucket --output table
# Get resource configuration
aws configservice get-resource-config-history \
--resource-type AWS::EC2::Instance \
--resource-id <instance-id> \
--limit 5
# List Config rules
aws configservice describe-config-rules \
--query 'ConfigRules[*].[ConfigRuleName,ConfigRuleState,Source.Owner]' \
--output table
# Get rule compliance
aws configservice describe-compliance-by-config-rule --output table
# Get compliance details for a rule
aws configservice get-compliance-details-by-config-rule \
--config-rule-name <rule-name> \
--compliance-types NON_COMPLIANT \
--output table
# Get compliance by resource
aws configservice describe-compliance-by-resource \
--resource-type AWS::S3::Bucket \
--compliance-types NON_COMPLIANT \
--output table
# Get aggregate compliance
aws configservice describe-aggregate-compliance-by-config-rules \
--configuration-aggregator-name <aggregator-name> --output table
# List conformance packs
aws configservice describe-conformance-packs --output table
# Get conformance pack compliance
aws configservice describe-conformance-pack-compliance \
--conformance-pack-name <pack-name> --output table
# List aggregators
aws configservice describe-configuration-aggregators --output table
# Select all EC2 instances
aws configservice select-resource-config \
--expression "SELECT resourceId, resourceType, configuration.instanceType, tags WHERE resourceType = 'AWS::EC2::Instance'" \
--output table
# Find all public S3 buckets
aws configservice select-resource-config \
--expression "SELECT resourceId, resourceName WHERE resourceType = 'AWS::S3::Bucket' AND supplementaryConfiguration.PublicAccessBlockConfiguration.blockPublicAcls = 'false'"
# Find unencrypted EBS volumes
aws configservice select-resource-config \
--expression "SELECT resourceId WHERE resourceType = 'AWS::EC2::Volume' AND configuration.encrypted = 'false'"
# Count resources by type
aws configservice select-resource-config \
--expression "SELECT resourceType, COUNT(*) WHERE resourceType LIKE 'AWS::EC2::%' GROUP BY resourceType"
# Find resources with specific tags
aws configservice select-resource-config \
--expression "SELECT resourceId, resourceType WHERE tags.key = 'Environment' AND tags.value = 'production'"
⚠️ Cost note: AWS Config charges per configuration item recorded ($0.003 each) and per rule evaluation ($0.001 each). Conformance packs: $0.001 per evaluation. Can add up with many resources.
# Create a configuration recorder
aws configservice put-configuration-recorder \
--configuration-recorder name=default,roleARN=<config-role-arn> \
--recording-group allSupported=true,includeGlobalResourceTypes=true
# Create a delivery channel
aws configservice put-delivery-channel \
--delivery-channel '{
"name": "default",
"s3BucketName": "<bucket-name>",
"configSnapshotDeliveryProperties": {"deliveryFrequency": "TwentyFour_Hours"}
}'
# Start recording
aws configservice start-configuration-recorder --configuration-recorder-name default
# Add a managed Config rule
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "s3-bucket-versioning-enabled",
"Source": {
"Owner": "AWS",
"SourceIdentifier": "S3_BUCKET_VERSIONING_ENABLED"
},
"Scope": {"ComplianceResourceTypes": ["AWS::S3::Bucket"]}
}'
# Add a Config rule with parameters
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "restricted-ssh",
"Source": {"Owner": "AWS", "SourceIdentifier": "INCOMING_SSH_DISABLED"},
"Scope": {"ComplianceResourceTypes": ["AWS::EC2::SecurityGroup"]}
}'
# Deploy a conformance pack
aws configservice put-conformance-pack \
--conformance-pack-name security-best-practices \
--template-s3-uri s3://<bucket>/conformance-pack-template.yaml
# Create an aggregator (multi-account/region)
aws configservice put-configuration-aggregator \
--configuration-aggregator-name org-aggregator \
--organization-aggregation-source '{"RoleArn": "<role-arn>", "AllAwsRegions": true}'
# Trigger rule evaluation manually
aws configservice start-config-rules-evaluation \
--config-rule-names <rule-name-1> <rule-name-2>
# Set up auto-remediation for a rule
aws configservice put-remediation-configurations \
--remediation-configurations '[{
"ConfigRuleName": "s3-bucket-versioning-enabled",
"TargetType": "SSM_DOCUMENT",
"TargetId": "AWS-ConfigureS3BucketVersioning",
"Parameters": {
"AutomationAssumeRole": {"StaticValue": {"Values": ["<role-arn>"]}},
"BucketName": {"ResourceValue": {"Value": "RESOURCE_ID"}}
},
"Automatic": true,
"MaximumAutomaticAttempts": 3,
"RetryAttemptSeconds": 60
}]'
# Run remediation manually
aws configservice start-remediation-execution \
--config-rule-name <rule-name> \
--resource-keys '[{"resourceType": "AWS::S3::Bucket", "resourceId": "<bucket-name>"}]'
🛑 DESTRUCTIVE — Always confirm with the user before executing any of these commands.
# Stop recording
aws configservice stop-configuration-recorder --configuration-recorder-name default
# Delete a Config rule
aws configservice delete-config-rule --config-rule-name <rule-name>
# Delete a conformance pack
aws configservice delete-conformance-pack --conformance-pack-name <pack-name>
# Delete an aggregator
aws configservice delete-configuration-aggregator \
--configuration-aggregator-name <aggregator-name>
# Delete remediation configuration
aws configservice delete-remediation-configuration --config-rule-name <rule-name>
# Quick compliance summary
echo "=== Non-Compliant Rules ==="
aws configservice describe-compliance-by-config-rule \
--compliance-types NON_COMPLIANT \
--query 'ComplianceByConfigRules[*].[ConfigRuleName,Compliance.ComplianceType]' \
--output table
echo "=== Non-Compliant Resources ==="
aws configservice describe-compliance-by-resource \
--compliance-types NON_COMPLIANT \
--query 'ComplianceByResources[*].[ResourceType,ResourceId]' \
--output table
# See how a resource changed over time
aws configservice get-resource-config-history \
--resource-type AWS::EC2::SecurityGroup \
--resource-id <sg-id> \
--limit 10 \
--query 'configurationItems[*].[configurationItemCaptureTime,configurationItemStatus,configuration]'
| Error | Cause | Fix |
|---|---|---|
NoAvailableConfigurationRecorderException | Recorder not set up | Create recorder with put-configuration-recorder |
InsufficientDeliveryPolicyException | S3 bucket policy issue | Add Config service permissions to bucket policy |
MaxNumberOfConfigRulesExceededException | Too many rules (150 default) | Request limit increase or consolidate rules |
Rule always shows NOT_APPLICABLE | Scope doesn't match any resources | Check ComplianceResourceTypes in rule scope |
| Advanced query returns empty | Resources not yet recorded | Wait for recorder to capture; check recorder status |
| Remediation failing | SSM document or role issues | Check remediation execution status and IAM role |