Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Creating a CloudTrail Trail and EventBridge Alert for Console Sign-Ins

During this hands-on lab you will explore how to create a multi-Region CloudTrail Trail with Log File Integrity and Validation enabled, as well as create an EventBridge Rule that can send a notification via Amazon SNS to alert you whenever there is a Root user console sign-in!

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 30m
Published
Clock icon Feb 02, 2024

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create Multi-Region CloudTrail Trail

    Create a new CloudTrail Trail (do not use the quick create feature!) with the following settings:

    If the settings are not mentioned below, then leave as default.

    Trail Attributes

    • Name: OurTrail
    • Storage location: Create new S3 bucket.
    • Log file SSE-KMS encryption: Enabled
    • New KMS Key Alias: CloudTrailKey
    • Log File Validation: Enabled

    Log Events

    • Event type: Management events
    • Management events: Read and Write API Activity
  2. Challenge

    Create CloudTrail-specific KMS Key

    This will be created during your CloudTrail Trail creation in the previous objective. We call it out separately here for a learning check.

    Create a new KMS key with an Alias of CloudTrailKey.

  3. Challenge

    Create SNS Topic and Subscription

    • Create a new standard SNS Topic called ConsoleAlerts.
    • Create a new subscription for the SNS Topic using the email protocol.
    • Confirm the subscription via the chosen email address.
    • Test the subscription by publishing a test message.
  4. Challenge

    Create Amazon EventBridge Rule

    • Create a new EventBridge Rule named ConsoleSigninAlerts.
    • Set the event bus to default.
    • Set the rule type to Rule with event pattern.
    • For Event source choose AWS events or EventBridge partner events.
    • Under Creation method choose Custom pattern (JSON editor) and copy/paste the JSON file from the lab GitHub repo. Update references of REPLACE_ME with your account ID.
    • Under Sample events choose AWS Console Sign In via CloudTrail and copy the code.
    • Switch Sample event type to Enter my own, paste the copied code and replace account ID references on lines 6, 14, 15, and 16 with your account ID.
    • Set the target to be your ConsoleAlerts SNS Topic.
    • Test everything by signing out of your AWS account then back in as cloud_user. You should receive an email containing the JSON of the captured event.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans