Reputation: 147
Recently we had terrible day someone from team deleted terraform state file. so we thought implementing alerts on s3. is there any way we can alert(send notifications)? and can we know which IAM user has performed the action?
Upvotes: 2
Views: 1578
Reputation: 37029
You can use CloudTrail + SNS to generate alerts about S3 object creation and deletion like so:
https://asecure.cloud/a/cwalarm_s3_creation_deletion/
Here's a user guide from AWS that may help you as well: https://docs.aws.amazon.com/AmazonS3/latest/userguide/NotificationHowTo.html
There's a nice video from 2018 about how to get SNS notifications to get alerts about S3 object creation/deletion. Check that out also: https://www.youtube.com/watch?v=EGyuzMbXD0Y
The other couple of practices you could us are:
That'll prevent an important file from being accidentally deleted.
You should enable CloudTrail. Enable S3 bucket logs with object level logging. That'll allow CloudTrail to audit what happened to an object level. Here are a couple article that can help you get started:
Upvotes: 3
Reputation: 269091
Amazon S3 Events can send notifications when objects in an Amazon S3 bucket are created or deleted.
The notification can:
Upvotes: 2