# Automating Incident Response with EventBridge

In this part, we'll explore the practical elements of integrating EventBridge with other services, including the basic deployment of AWS Lambda functions and the creation of Amazon SNS topics. We'll cover the skills required to use Lambda and SNS services in this lab, but previous experience with EventBridge is assumed.

EventBridge and the incident response process

EventBridge can stream events from a range of AWS services, assisting in event-driven automation and the monitoring of operational changes in your AWS estate. AWS’s security-focused services (such as GuardDuty) create events when new security findings are made, and other AWS services, such as Lambda or SNS, can be integrated into event streams to take actions when events are received. This can enable automation and reduce delays in the incident response process.\


AWS Lambda functions are serverless functions that can interact with and configure resources in other services (along with many other capabilities). They can be invoked by EventBridge if the function is set as the target of a rule, and they can even ingest the event to use the data provided within. This means that Lambda functions can be used to automate a response to a potential incident.



<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FB3JLR5irUHPaVykn80id%2Fimage103.png?alt=media&#x26;token=3f536a34-24a1-42d1-b0da-9c89437ecc3d" alt=""><figcaption></figcaption></figure>

Amazon’s Simple Notification Service (SNS) is a notification service. Events can be forwarded to SNS topics, where each topic – the target of these events – can have multiple subscriptions. A subscription is an external location, such as a phone number, email address, or HTTP endpoint, to which notifications are forwarded. This is used to rapidly notify security teams of unusual events.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FpMV7d4UIuYdmA6R17WKG%2Fimage%20104.png?alt=media&#x26;token=ad045220-e258-45eb-87a2-d686a309b33f" alt=""><figcaption></figcaption></figure>

Examples of Lambda and SNS in incident response include:

1. GuardDuty creates a new security finding, such as one of your EC2 instances being connected to by an IP address that isn't on your list of trusted IPs. An event is generated and streamed via an event bus to a Lambda function. The Lambda function creates a new entry in the EC2 network access control list (ACL) to block the unknown IP address.
2. EventBridge can monitor user API calls via CloudTrail. You might receive an event for an “API call via CloudTrail” that a user has attempted the CreateUser operation in the IAM service. If your organization only uses IAM roles, this would be suspicious. The event is streamed to an SNS topic target, with a subscription to an email address; your security team is instantly notified and can investigate.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FTqeFz5Wf1KdVJxVspB0W%2Fimage%20105.png?alt=media&#x26;token=ce0c7de8-1381-4550-a0fd-990406aac35b" alt=""><figcaption></figcaption></figure>











