Amazon_EC2_1

Ensure an AWS Managed Config Rule for EIPs attached to EC2 instances within VPC

Description

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.

Remediation

Perform the following to Ensure an AWS Managed Config Rule for EIPs attached to EC2 instances within VPC

  1. Go to the AWS Config console at https://console.aws.amazon.com/config
  2. Select Rules tab from the left side.
  3. Search for a Config Rule that checks whether all EIP addresses allocated to a VPC are attached to EC2 instances or in-use ENIs
  4. Give specific name and description and save it.

Using the Amazon CLI:

  • 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

References:
1. http://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html
2. http://docs.aws.amazon.com/cli/latest/reference/configservice/describe-config-
rules.html
3. http://docs.aws.amazon.com/cli/latest/reference/configservice/put-config-
rule.html

Service

EC2

Severity

Low

Compliance

Mapping

We are now live on AWS Marketplace.
The integrated view of your cloud infrastructure is now easier than ever!