CloudTrail
This page describes steps to follow to setup real-time visualization of AWS assets (vpc, subnet and virtual server) using CloudTrail based approach.
Events
Note - Only mandatory attributes have been shown below for various events. You can remove all the attributes other than ones mentioned below (using eventbridge pipe etc) so that any sensitive information (e.g. account number) about your account is NOT posted to MechCloud.
1. Create Vpc
2. Delete Vpc
3. Create Subnet
4. Delete Subnet
5. Create VM
6. Delete VM
Steps
1. Create a trail
Navigate to CloudTrail -> Trails.
Click on Create trail button to create a new trail with following details. This describes only few settings. You can adjust other settings as per your needs.
General Details
Trail name - mc-mgmt-events
(Optional) Make sure that Enable for all accounts in my organization option is UNCHECKED as selecting this may result in huge charges.
Events
Event type - Make sure ONLY Management events option is CHECKED.
Management events
Make sure only Write is CHECKED.
Make sure both Exclude AWS KMS events and Exclude Amazon RDS Data API events are CHECKED.
Select newly created trail and click on Stop logging button so that unnecessary events are NOT logged in the S3 button associated with the trail. A good practice is to enable logging for this trail just before real-time visualization starts and disable it at the end of real-time visualization.
2. Create an Event Bridge rule
Create an event bridge rule with the following details -
Define rule detail
Name - mc-cloudtrail-events
Event bus - default
Make sure that Enable the rule on the selected event bus is enabled.
Select Rule with an event pattern under Rule type.
Build event pattern
Creation method - Custom pattern (JSON editor)
Event pattern
Select target(s)
Target 1
Target types - AWS service
Select a target - SQS Queue
Queue - management-events.fifo
Message group ID - mc-cloudtrail-events
Last updated