Information
AWS Config provides you with a detailed inventory of your AWS resources and their current configuration, and continuously records configuration changes to these resources.
You can evaluate these configurations and changes for compliance with ideal configurations as defined by AWS Config Rules.
Evaluation of EC2 instance configuration to ensure there are no publicly addressable IP's attached which would violate the defence in depth model
Solution
Using the Amazon unified command line interface:
* Create locally a json file (similar with the below sample) with the configuration of the Config Rule, and save it as /tmp/ConfigRule.json:
"Description": "Checks whether all EIP addresses allocated to a VPC are attached to EC2 instances or in-use ENIs.",
"ConfigRuleName": "eip-attached",
"Source": {
"Owner": "AWS",
"SourceIdentifier": "EIP_ATTACHED"
},
"Scope": {
"ComplianceResourceTypes": [
"AWS::EC2::EIP"
]
}
}
* Create a Config Rule using the configuration saved earlier:
aws configservice put-config-rule --config-rule file:///tmp/ConfigRule.json