Setup integration: Amazon CloudWatch Event
You need to setup an AWS SNS HTTPS endpoint for this integration!
CloudWatch Events announce important changes in your AWS account. An event can be an EBS Snapshot Notification, a Trusted Advisor Event, or much more.
Monitoring root user logins
Your AWS account’s root user should never be used. Instead, you create IAM users. If the root user logs in, this should be suspicious. With marbot, you can receive an alert when the root user logs in.
Before you can start to set up CloudWatch Events, you have to make one change to the SNS topic endpoint that is required for this integration. You have to allow CloudWatch Events to send messages to your topic.
Allowing AWS to send messages to your topic
- Visit https://console.aws.amazon.com/sns/?region=us-east-1
- Click on the Topics link on the left
- Select the topic that you created for marbot
- Click on the Actions button, where you click on the Edit topic policy link.
- Select the Advanced view tab
If this is the first time you edit the SNS topic policy, you should see a default entry like this:
{ |
You have to add an entry to the Statement
array:
{ |
- Replace ARN with your SNS topic ARN that you created for marbot.
- Click on the Update policy button to save the policy.
Now, AWS is allowed to send messages to your topic.
Creating a CloudWatch Event
- Visit https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#events:
- Click on the Create rule button
- In the Event Source section
- Set the Service Name to
AWS Console Sign-in
- Set the Event Type to
Sign-in Events
- Select Specific user(s) by ARN and insert
arn:aws:iam::ACCOUNT_ID:root
below. - Replace ACCOUNT_ID with your AWS Account ID.
- Set the Service Name to
- In the Targets section
- Select SNS topic in the head
- Select the Topic
marbot
- Continue by clicking the Configure Details button.
- Choose a Name
- Save by clicking the Create rule button.
Sample Alert
When you login to the AWS Management Console with the root user, you should receive an alert in Slack: