AWS CloudTrail, as the name suggests, is used for backtracking AWS console activities or finding unauthorized access, deletion, creation, or anything happening in AWS. It is used for historical tracking purposes of AWS console activities.
It is very useful when working in a large team where you need visibility into team member activities. When everyone has admin access, there will be numerous creations and deletions of AWS resources. If permissions are attached to a role used by an organization or third-party service such as Jenkins, that role should have all necessary permissions to execute Jenkins jobs daily. AWS CloudTrail can track if any policy is detached or deleted, or if a role is removed from a user group. We can filter activities by date, day, month or year.
In my recent company, I was responsible for cleaning up users after they left the company. I accidentally removed a user from user groups which stopped the company's Jenkins deployments. Through AWS CloudTrail, they traced it back to my IAM username. This served as a learning experience and demonstrated a useful case for AWS CloudTrail.
We did not utilize AWS CloudTrail's integration with CloudWatch for real-time observability. We used it for backtracking since access was already least privileged for people. With modularized access, individuals take ownership of their actions.
We make use of AWS CloudTrail's feature to send log files to an Amazon S3 bucket for long-term storage and analysis. Most organizations perform this activity because CloudWatch is integral to the AWS console where logs are generated. Third-party log generations can also be integrated. For services such as Lambda, CloudWatch integration is essential for troubleshooting errors. CloudWatch logs can be dumped to S3 for review or audit purposes. S3 features Glacier for long-term, cost-effective storage of large amounts of data.
For Lambda, we implemented Python code that would invoke AWS CloudTrail upon any AWS console action, feeding logs into CloudWatch and subsequently to services such as S3. We also had the option to receive notifications for selected service creations or destructions via email.
AWS CloudTrail can be scaled to monitor all services and provide notifications for any changes. Beyond simple CloudWatch logs, it can send targeted notifications via email or Teams integration when CRUD operations affect specific services by IAM users.
The service maintains a comprehensive trail of all AWS activities. If an account is seven years old, it potentially contains all historical data from that period. This proves invaluable during audits requiring data from several years back.
AWS CloudTrail is currently underutilized and has potential for many more use cases.
I have not experienced the Trail feature of AWS CloudTrail in tracking changes to AWS infrastructure.
AWS CloudTrail could benefit from more comprehensive documentation and broader service integration. Making it as fundamental as EC2 would increase its adoption. It is currently an underrated but powerful service.
I have been working with AWS CloudTrail for approximately one and a half years.
AWS CloudTrail does not fit directly into our architecture as it functions more as a helper service, which limited our utilization of its capabilities.
AWS CloudTrail was our first solution for this purpose, and we continue using it because it effectively meets our needs. We would only consider alternatives if issues arose with AWS CloudTrail.
The setup was completed before I joined the company two years ago. I had to review metadata and receive knowledge transfer from colleagues to understand the setup, but I did not participate in the initial implementation.
AWS CloudTrail becomes particularly valuable during audits, such as PCI DSS, where tracking historical changes and activities is crucial. The integration with CloudWatch allows for filtered logs according to specific requirements.
I would rate AWS CloudTrail a nine out of ten based on our experience, as we have not encountered any significant issues with the service.