Query to alert when EBS data volume is de-attached from and EC2 instance

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Query to alert when EBS data volume is de-attached from and EC2 instance

L1 Bithead

Looking for help with the right RQL to

alert when any EBS data volume is de-attached from an EC2 instance

1 accepted solution

Accepted Solutions

This should get you started: 

event where operation = 'DetachVolume'

If you are looking for a specific user doing the action, you can add subject or role using the AND function.

View solution in original post

3 REPLIES 3

L1 Bithead

This is a built-in policy:

"AWS EBS Volume is unattached"

 

RQL:

config where cloud.type = 'aws' AND api.name = 'aws-ec2-describe-volumes' AND json.rule = attachments[*] all empty or attachments[*].state does not contain "attached"

Thanks for the query.

However, Question was about the detection event, if there was any volume de-attached. Later on, maybe that was left in the de-attached state or may be attached to another machine or attached to the same machine.

This query provided simply returns the de-attached volume list.

We might have to look at audit events.

This should get you started: 

event where operation = 'DetachVolume'

If you are looking for a specific user doing the action, you can add subject or role using the AND function.

  • 1 accepted solution
  • 6885 Views
  • 3 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!