AwsCLI icon
If icon
SlackIncomingWebhook icon
Log icon
Schedule icon

AWS CloudTrail Multi-Region Logging Disabled Audit Sentinel

Audit all CloudTrail trails for disabled logging, missing multi-region coverage, and log validation issues, then alert Slack.

Categories
CloudInfrastructure

This sentinel periodically enumerates every AWS CloudTrail trail in your account and checks whether each one has active logging enabled. Trails with IsLogging: false are collected and reported to Slack with their multi-region and log-file-validation status, giving security and compliance teams immediate visibility into audit-log gaps.

How it works

  1. io.kestra.plugin.aws.cli.AwsCLI calls aws cloudtrail describe-trails --include-shadow-trails false to list all trails owned by the account.
  2. For each trail, aws cloudtrail get-trail-status is called to retrieve IsLogging. The trail's IsMultiRegionTrail and LogFileValidationEnabled flags are read from the describe output.
  3. Trails where IsLogging is false are accumulated into a disabled_trails string and issues_found is set to true.
  4. io.kestra.plugin.core.flow.If branches on issues_found. When true, a Slack alert lists the affected trail names with their multi-region and validation attributes. When false, the flow logs a clean result.
  5. A top-level errors block fires a Slack alert on any unhandled exception.

What you get

  • Per-trail audit of logging status across every CloudTrail trail in the account.
  • Slack alerts listing disabled trail names with multi-region and log-validation attributes.
  • Execution history in Kestra for every sentinel check run.
  • A top-level error handler to catch and surface AWS CLI failures.

Who it's for

  • Security engineers enforcing AWS CloudTrail coverage as part of CIS or SOC 2 programmes.
  • Cloud compliance teams that need continuous audit-log gap detection.
  • DevOps teams managing multi-region AWS environments.

Why orchestrate this with Kestra

AWS Config can detect this condition, but it requires a separate service with its own rule lifecycle and SNS notification pipeline. Kestra consolidates describe, status check, conditional branching, and Slack notification into a single auditable flow with namespace-scoped secrets, retries, and full execution lineage.

Prerequisites

  • An AWS IAM identity with cloudtrail:DescribeTrails and cloudtrail:GetTrailStatus permissions.
  • A Slack incoming webhook.

Secrets

  • AWS_ACCESS_KEY_ID: AWS access key ID.
  • AWS_SECRET_ACCESS_KEY: AWS secret access key.
  • SLACK_WEBHOOK: Slack incoming webhook URL.

Quick start

  1. Add AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SLACK_WEBHOOK to your Kestra namespace secrets.
  2. Set the aws_region input to your target region (default: us-east-1).
  3. Enable the schedule trigger or execute manually to audit current CloudTrail state.

How to extend

  • Add a remediation step that calls aws cloudtrail start-logging --name <arn> to re-enable logging automatically.
  • Extend the check to verify IsMultiRegionTrail and LogFileValidationEnabled and alert when either is false.
  • Loop across multiple AWS regions by parameterising the region input and using Kestra's Loop.
  • Persist audit results to S3 or a data warehouse for long-term compliance reporting.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.