Creating a Policy when a new EIP is attached in AWS

Reply
Highlighted
L1 Bithead

Creating a Policy when a new EIP is attached in AWS

Hi, 
I have had times when end users assign an EIP to a EC2 instance causing some exposure. Is there a way I can create a policy to alert me when a new EIP is associated or requested?

Tags (2)
Highlighted
L1 Bithead

You can leverage our Audit Policies with something along the below lines, in terms of RQL.

 

event where operation IN ( 'AssociateElasticIp', 'RegisterElasticIp', 'UpdateElasticIp' )

 

This will create an alert anytime you have a user actually make a change to the EIP.

 

Another way you can achieve this is by simply checking for instances that have a public IP. Though this will return existing systems that should or are known to have public IPs.

 

config where api.name = 'aws-ec2-describe-instances' AND json.rule = publicIpAddress exists and publicIpAddress is not empty

Respectfully Submitted,
Francisco Breijo
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!