Introduction to AWS CloudTrail Service

Introduction to AWS CloudTrail Service

6 mins read580 Views Comment
Updated on Sep 16, 2022 19:09 IST

Consider AWS CloudTrail to be a detective who keeps an eye on your AWS account and environment. It specifies what action was taken, when and where it was taken, and who took it.

2022_03_Add-a-heading.jpg

AWS CloudTrail allows you to audit your AWS account for governance, compliance, operational efficiency, and risk. With CloudTrail, users can continuously monitor, log, and save account activities related to AWS infrastructure actions. 

CloudTrail gives an event history of your AWS account activity, including actions taken via the AWS SDKs, command-line tools, and other AWS services. When you create an AWS account, CloudTrail is enabled. When something happens in your AWS account, itโ€™s noted in a CloudTrail event. You can quickly check recent events by going to Event history in the CloudTrail console.

CloudTrail can publish a notification for each log file delivered. It enables users to take action upon receiving a log file. According to AWS, the entire process should take about 15 minutes. The same facility could also be configured to aggregate log files from multiple accounts. This facilitates the delivery of log files to a single S3 bucket.

Check Out the Best Online Courses

CloudTrail logs two kinds of events: management events and data events. CloudTrail makes use of such events in three ways.

  1. Trails: It allows events to be delivered and stored in Amazon S3, with optional delivery to Amazon CloudWatch Logs and EventBridge.
  2. Insights: It examines control plane events in API call volumes for unusual behavior.
  3. Event history: It offers a free 90-day history of control plane actions. 

In this blog, we will learn in brief about AWS CloudTrail. But, before letโ€™s go through the topics that we will be covering in this blog:

  1. Use cases of AWS CloudTrail
  2. AWS CloudTrail features
  3. Enable AWS CloudTrail
  4. How to create a trail?
  5. Who can use AWS CloudTrail ?
  6. How does CloudTrail work?
  7. AWS CloudTrail pricing
  8. Differences between CloudWatch and CloudTrail

Use cases of AWS CloudTrail

  1. Audit activity: Monitor, save and validate activity events to ensure their authenticity. Quickly generate audit reports required by internal policies and external regulations.
  2. Troubleshoot operational issues: Closely monitor API usage history with machine learning models. It can detect unusual activity in your AWS accounts and determine the root cause.
  3. Identify security incidents: Identify unauthorized access. This is done using Who, What, and When details in CloudTrail Events. Respond with EventBridge alerts based on rules and automated workflows.
Recommended online courses

Best-suited AWS Certification courses for you

Learn AWS Certification with these high-rated online courses

โ‚น8.47 K
6 weeks
โ€“ / โ€“
5 weeks
โ€“ / โ€“
โ€“ / โ€“
โ‚น15 K
35 hours
โ‚น16 K
8 hours
โ€“ / โ€“
60 hours
โ‚น48 K
1 day
โ€“ / โ€“
32 hours

AWS CloudTrail features

There are many features of CloudTrail. Some of those are:

  1. Multi-account: CloudTrail can capture and store events from different accounts in a single location. This guarantees that all settings are universally applied across all existing and newly created accounts.
  2. Always on: CloudTrail records management events across all AWS services. And that too, with no manual configuration required.
  3. Multi-region: CloudTrail captures and stores events from various regions in a single location. This makes sure that all settings are universally applied across all areas, both existing and newly launched.
  4. CloudTrail Insights: Detect anomalies in your Amazon Web Services accounts, such as spikes.
  5. Encryption: By default, CloudTrail uses Amazon S3 server-side encryption. This helps encrypt all log files delivered to your specified Amazon S3 bucket (SSE).

Letโ€™s summarize these points:

  1. Allows you to view changes made in the Event History.
  2. Configuration with multiple regions.
  3. CloudTrail is โ€œAlways Onโ€ to view data from the last 90 days.
  4. Validation and encryption of log files.
  5. Data events, management events, and CloudTrail Insights are all available.

Enable AWS CloudTrail

CloudTrail is enabled as soon as you create an AWS account. Every action is recorded as an event and stored for 90 days. A CloudTrail trail can help you keep, analyze, and manage changes to your AWS resources. A CloudTrail can also extend the record of events beyond 90 days.

How to create a trail?

Here are the steps to create a trail: (You can skip step 8, as per the requirement)

  1. Log in to your AWS console with the IAM user set up for CloudTrail administration. Define the region wherein you want to build your trail.
  2. Go to CloudTrail > Trails > Create a new trail from the navigation pane.
  3. Enter a descriptive name in the Trail name field to help you identify the purpose of the trail.
  4. Select whether you want to make a new Amazon S3 bucket or use an existing one in the Storage Location section.
  5. After selecting your S3 bucket, click the Advanced button to expand the menu.
  6. Select Yes for the Send SNS notification for every log file delivery option.
  7. Click Yes, to create a New SNS Topic option to start a new SNS topic.
  8. Click No and select the SNS topic from the dropdown to use an existing SNS topic.
  9. Create the trail.

Who can use AWS CloudTrail ?

Clients/Customers who can use this service include:

  1. Clients who can track resource changes
  2. Customers who can show proof of compliance.
  3. Clients who require assistance with troubleshooting.
  4. Customers who conduct a security analysis.

How does AWS CloudTrail work?

You can view, search, and download the last 90 days of the task in your AWS account using event history. Users can also use CloudTrail to analyze, archive, and react to new in your AWS resources. A trail allows the delivery of events to a specific Amazon S3 bucket. You can create a trail using the CloudTrail console, the AWS console, or both.

Explore Free Online Courses with Certificates

For an AWS account, you can make two types of trails:

  1. A trail that applies to all regions
  2. A trail that applies to one region

In a trail that applies to all regions, CloudTrail records events in each region. This trail also delivers the CloudTrail event log files to an S3 bucket that you specify. Whereas, in a trail that applies to one region, CloudTrail records the events in that region.

CloudTrail helps to monitor and record account activity all over your AWS infrastructure. This allows you to control storage, analysis, and cleanup actions.

2022_09_image-103.jpg

AWS CloudTrail pricing

If you set up a single trail to deliver a single copy of management events in each region, Amazon CloudTrail pricing is free. You can even download, filter, and view data from the most recent 90 days for free.

By enabling Insights events in your trails, you can use CloudTrail Insights. CloudTrail Insights will be chargeable in each region based on the number of events. Here are the prices:

  1. $2.00 per 100,000 events for management events.
  2. $0.10 for every 100,000 data events.
  3. $0.35 per 100,000 write management events.

Differences between CloudWatch and CloudTrail

The differences between CloudWatch and Clodtrail are:

Benchmark CloudWatch CloudTrail
Description Pays attention to the activity of AWS services and resources, reporting on their health and performance. A log of all actions that have taken place inside your AWS environment.
Example What is happening on AWS? Who did what on AWS?
Service type Monitoring service Web service

If you want to learn more about AWS resources, you can read these blogs:

Introduction to AWS Network Firewall
AWS KMS (Key Management Service)

Conclusion

Todayโ€™s article went over the AWS CloudTrail in great detail. By reading this article, I hope that you were able to alleviate some of your concerns.

These cloud courses may be beneficial if you want a comprehensive to cloud computing. This program assists students who wish to become full-fledged Cloud professionals.

About the Author

This is a collection of insightful articles from domain experts in the fields of Cloud Computing, DevOps, AWS, Data Science, Machine Learning, AI, and Natural Language Processing. The range of topics caters to upski... Read Full Bio