Detection · Topic 2 of 7

EventBridge Alerting Pipelines

Build event driven security alerting with EventBridge rules, event patterns, cross account event buses and SNS or chat notifications for an organization.

  • 6 min
  • Includes a diagram
In a nutshell
  • EventBridge reacts to events and routes them to targets. CloudWatch alarms react to metrics. Choose by the type of signal.
  • The default bus receives AWS service events. Use a custom bus with a resource policy for cross account delivery.
  • Use aws:PrincipalOrgID in the bus policy to trust every account in the organization without listing them.

What it is

Amazon EventBridge is a serverless event bus that receives events from AWS services and your own applications, matches them against rules, and sends them to targets. For security teams it is the glue between detection services and response or notification: a GuardDuty finding, a Security Hub finding, an AWS Config compliance change or a CloudTrail API call becomes an event, and a rule routes it onward.

The big design question is where the alert should land. A single account can alert itself, but an organization usually forwards events to one central security account.

GuardDutyfindingeventEventBridgerule matchestargetSNStopicdeliversEmail or chatsecurity team

How it works

Buses, rules and patterns

Every account has a default event bus that AWS services write to. A rule holds an event pattern (a JSON filter) or a schedule, plus up to several targets. Matching is exact on the field values you list, and it is case sensitive.

This pattern matches GuardDuty findings with a severity of 7 or higher.

{
  "source": ["aws.guardduty"],
  "detail-type": ["GuardDuty Finding"],
  "detail": {
    "severity": [{ "numeric": [">=", 7] }]
  }
}

API activity that is not published as its own event type arrives with the detail type AWS API Call via CloudTrail. Rules on that detail type depend on CloudTrail management events being recorded, and events from global services such as IAM are recorded in us-east-1, so the rule must live in that Region.

# AWS CLI: create the rule, then attach an SNS topic as the target
aws events put-rule --name high-severity-guardduty \
  --event-pattern file://pattern.json
aws events put-targets --rule high-severity-guardduty \
  --targets "Id"="1","Arn"="arn:aws:sns:us-east-1:111122223333:security-alerts"

Targets and permissions

How EventBridge is allowed to call a target depends on the target type. This is a favourite troubleshooting point.

TargetPermission mechanism
Amazon SNS topic, Amazon SQS queue, AWS LambdaResource policy on the target that trusts events.amazonaws.com
Step Functions, Systems Manager Automation, Kinesis, ECS tasksIAM role that the rule assumes
Another event bus in another accountThe receiving bus resource policy, and a role on the rule for sending

For failed deliveries, configure a retry policy and a dead letter queue (DLQ) on the target. An archive and replay feature stores events so that you can re-run a rule after fixing it.

Cross account and organization alerting

A rule in a member account's default event bus matches an event and forwards it with PutEvents to a custom central-security bus in the security account, whose bus policy allows PutEvents by aws:PrincipalOrgID; rules on that bus then send events to a Lambda function and an SNS topic. To centralise alerts, create a custom event bus in the security account and give it a resource policy that allows events:PutEvents from the other accounts. A policy that trusts a whole organization uses the aws:PrincipalOrgID condition key, so you do not list every account.

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "AllowOrgToPutEvents",
    "Effect": "Allow",
    "Principal": "*",
    "Action": "events:PutEvents",
    "Resource": "arn:aws:events:us-east-1:222233334444:event-bus/central-security",
    "Condition": { "StringEquals": { "aws:PrincipalOrgID": "o-exampleorgid" } }
  }]
}

In each source account, a rule forwards matching events to that central bus. Events are Regional, so each Region needs its own forwarding rule or its own central bus.

Member accountrule forwardsPutEventsCentral bussecurity accountruleLambdaenrich and routeCentral bussecurity accountruleSNSpage on call

Notification choices

OptionBest for
SNS email or SMSSimple paging and fan out to several subscribers
Amazon Q Developer in chat applications (formerly AWS Chatbot)Posting alerts to Slack or Microsoft Teams
Systems Manager Incident ManagerEscalation plans, on call schedules and response plans
Lambda to a ticketing toolCustom enrichment before a person is notified

Prefer the delegated administrator feature of detection services over per account wiring where it exists. GuardDuty and Security Hub can aggregate findings across the organization, so one rule in the administrator account sees member findings.

Input transformers

Raw findings are long. An input transformer picks fields from the event, such as severity, resource and account, and builds a short message for the target. Use it to make a page readable at three in the morning.

What to remember for the exam

  • EventBridge reacts to events and routes them to targets. CloudWatch alarms react to metrics. Choose by the type of signal.
  • The default bus receives AWS service events. Use a custom bus with a resource policy for cross account delivery.
  • Use aws:PrincipalOrgID in the bus policy to trust every account in the organization without listing them.
  • SNS, SQS and Lambda targets use resource policies, and most other targets use a role that the rule assumes.
  • Events are Regional, and IAM API calls arrive in us-east-1.
  • Add a DLQ to targets so failed deliveries are kept, and use archive and replay to re-process events.
  • Use an input transformer to shorten findings before notifying people.
  • For organization wide findings, prefer GuardDuty or Security Hub delegated administrator aggregation over a rule in every account.
Exam tip

When an exam scenario asks for the least operational effort to alert on a service finding, the answer is usually an EventBridge rule with an SNS target, not a Lambda function that polls an API.

Common mistakes

Matching on the wrong field. Patterns are case sensitive and match whole values, so GuardDuty Finding and guardduty finding are different.

Creating the rule in the wrong Region. A rule for IAM changes in us-west-2 never fires, because those events are recorded in us-east-1.

Forgetting the target permission. The rule matches and the metric Invocations rises, but FailedInvocations also rises because the SNS topic or Lambda function does not trust EventBridge.

Assuming events cross accounts automatically. The sending rule needs the receiving bus as a target, and the receiving bus needs a policy that allows the sender.

Watch out

An SNS topic encrypted with a customer managed KMS key needs a key policy that lets EventBridge use the key, otherwise alerts are dropped silently.

Check yourself

  • How do you let every account in an organization send events to a central bus?

    Add a resource policy to the central bus that allows events:PutEvents with the aws:PrincipalOrgID condition.

  • Which target types use a resource policy, and which use a role?

    SNS, SQS and Lambda use a resource policy that trusts EventBridge, while targets such as Step Functions and Systems Manager Automation use a role.

  • Why does an EventBridge rule for an IAM change not fire when created in another Region?

    IAM is a global service whose API calls are recorded in us-east-1, so the rule must be in that Region.

Topic 2 of 7 in Detection

Test yourself on Detection

The full AWS SCS-C03 question bank has 858 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.