DEV Community

Cover image for Incident Response Essentials: Building a Resilient AWS Environment with Wazuh
Ezekiel Obeisun Jr
Ezekiel Obeisun Jr

Posted on

Incident Response Essentials: Building a Resilient AWS Environment with Wazuh

You know what they say about cloud security - it's all fun and games until someone leaves their S3 bucket PUBLIC. While that might get a chuckle from seasoned cloud engineers, the reality of cloud security incidents is no laughing matter...... sometimes.

*Here is the deal - deploying resources has become as easy as the button. *

Studies show that cloud misconfigurations account for nearly 65-70% of all cloud security incidents. It's like having a state-of-the-art home security system but leaving your front door wide open.

https://www.crowdstrike.com/en-us/blog/common-cloud-security-misconfigurations/

While many organizations get caught up in the flashy marketing of expensive security tools, the truth often lies in mastering the fundamentals. It's not about having the most expensive security suite – it's about understanding the basics and implementing them properly, yes i'm talking to myself too....

Here's a surprising truth: many organizations, even those with robust security teams, often discover they're not fully prepared when a security incident occurs. It's like having a fire extinguisher but never planning how to use it during an actual fire. Security incidents aren't just about hackers breaking in – they can be as simple as an employee accidentally sharing sensitive data or a system misconfiguration exposing private information. (Keys, Secrets, etc.)

Incident response is a structured framework - a mindset for managing and addressing security breaches, cyberattacks, and other security incidents within an organization.

It enables policies, procedures, and tools that enable organizations to detect, respond to, and recover from security threats while minimizing potential damage and preventing future occurrences.

  1. What happened?
  2. What are we going to do about it?
  3. How do we prevent it from happening again? Simple.

But here's what makes incident response in the cloud different: the speed and scale at which incidents can happen whether within a traditional on-premises environments or within the cloud, an attacker might take days or weeks to move through your network. In the cloud, they can spin up thousands of dollars worth of resources in minutes if they get access to the right credentials.

Core Components of Incident Response

The incident response framework consists of four essential phases that work together to create a comprehensive security management system:

  1. Preparation - The preparation phase establishes the foundation for effective incident handling. Organizations develop response strategies, create detailed playbooks, define team roles and responsibilities, implement monitoring tools, and establish clear communication channels. Regular training exercises ensure team readiness and validate response procedures.

  2. Detection and Analysis - Security teams analyze alerts, determine the scope and impact of incidents, and prioritize response actions based on severity levels. This stage requires both automated monitoring systems and skilled analysis to accurately identify genuine threats. - (True Positive and False Positive)

  3. Containment and Eradication - When an incident is confirmed, the focus shifts to containment and elimination of the threat.

  4. Post-Incident Recovery - The recovery phase extends beyond immediate incident resolution. Organizations must systematically restore affected systems, document the entire incident lifecycle, analyze the effectiveness of the response, and implement improvements based on lessons learned.

In 2024 on Sunday, AWS has launched Security Incident Response, a new service for quick and efficient security event management.

AWS Security Incident Response, launched in December 2024, is a comprehensive security service designed to help organizations prepare for, respond to, and recover from security events like account takeovers, data breaches, and ransomware attacks.

https://aws.amazon.com/security-incident-response/ - Learn More.

https://aws.amazon.com/premiumsupport/aws-incident-detection-response/

https://docs.aws.amazon.com/security-ir/latest/userguide/security-incident-response-guide.html

Understanding incident response at a theoretical level is crucial, but what better way to learn than hands-on experience. As an AWS Community Builder, I recently deployed Wazuh—a robust, open-source SIEM solution within my own environment. This initiative not only demonstrated how Wazuh integrates with native AWS security services but also highlighted practical strategies for those considering a similar setup.

Image description

Image description

Before we dive deeper, lets first acknowledge the tool.

What is a SIEM ?

A SIEM (Security Information and Event Management) solution is like a central command center for your IT security. It collects logs and alerts from various devices—such as servers, applications, and network equipment—then analyzes them in one place. This helps you quickly spot, investigate, and address potential security threats.

In this case - Wazuh, it’s an open-source SIEM platform. It not only gathers data from across your systems (like AWS services, operating systems, and apps), but also uses built-in rules and threat intelligence to detect suspicious activities. By bringing all your security-related information under one roof, Wazuh makes it easier to understand what’s happening in your environment and take swift action if something goes wrong.

Although i did it manually, you have the option to deploy an AMI from within AWS Marketplace, deploy your own Wazuh Agent within in minutes.

Image description

Once Wazuh was up and running, I connected it with several AWS security tools to establish a comprehensive monitoring framework:

  1. Amazon CloudTrail to capture API calls
  2. Amazon VPC Flow Logs to observe network traffic
  3. Amazon GuardDuty to detect suspicious activities
  4. AWS Config to track configuration changes

These integrations allowed Wazuh to serve as a centralized hub for collecting and correlating events across my AWS environment.

Here is the Documentation to follow along:-

https://documentation.wazuh.com/current/deployment-options/amazon-machine-images/amazon-machine-images.html#launch-an-instance-from-the-aws-marketplace

Configuring the Wazuh Agent

After Configuring the Wazuh Agent, I started to run a few internal testing to make sure the agent was running properly for a few days.

Image description

Image description

While my original aim was to validate Wazuh’s capabilities and its integrations with various AWS services, the process led me down several interesting paths—from personal productivity strategies to the discovery of multiple CVEs.

Image description

Python Package Vulnerabilities
Even small Python libraries (often dependencies of bigger projects) can pose significant security risks if they aren’t kept up to date. Attackers can exploit these vulnerabilities to crash services or run malicious code reasons why we have DevSecOps (topic for another day)

What I Found

  • wheel (0.37.0) – Susceptible to a potential Regular Expression DoS (denial of service).
  • setuptools (58.0.4) – Remote code execution risk if used to download packages from untrusted URLs.
  • future (0.18.2) – Possible DoS attack via malicious HTTP headers.

Microsoft Edge Vulnerabilities

  • Multiple CVEs (e.g., remote code execution, memory corruption) tied to Microsoft Edge version 132.0.2957.115.
  • Potential for attackers to trick users into visiting a malicious webpage or opening a compromised PDF, leading to code execution or a system crash.

Why It Matters
Browsers are common entry points for attackers. If an exploit allows remote code execution, it can give malicious actors the ability to run harmful programs, steal data, or pivot into broader network attacks.

*How to Fix ? Uninstall the browser.... joking joking. *

Immediately apply any available security patches from Microsoft (update the browser) if patched.

Image description

Luckily during this "testing" process I learned that even commonly used packages can harbor significant threats. Thanks to Wazuh’s ongoing scans and alerts, I was able to quickly address vulnerabilities, boosting my AWS environment’s security posture in the process.

  1. Dependency Management is Critical - One or two outdated libraries can make your entire system vulnerable. Regular scans and automated patching help keep these risks at bay.

  2. Continuous Monitoring Pays Off - Wazuh’s alerts surfaced issues in real time, reminding me that proactive scanning is far more effective than waiting for a breach to happen.

  3. Security Requires Broad Coverage - It’s not just operating systems or big enterprise apps—browser plugins, small Python tools, and older test servers can all introduce weaknesses.

For more detailed configuration guides and advanced use cases, check out the Wazuh Documentation.

If you’re new to AWS threat detection services, I highly recommend exploring Amazon GuardDuty and AWS Config to see how it can complement your environment.

By leveraging both open-source tools and AWS’s built-in capabilities, you can build a robust, scalable security strategy that evolves alongside your cloud environment.”

Here are additional documentation to refer to for more information.

1. Official AWS Security Incident Response Documentation
AWS Security Incident Response - Offers an overview of incident response best practices, including how to prepare for and manage security incidents in the AWS Cloud.

https://aws.amazon.com/premiumsupport/aws-incident-detection-response/

2. AWS Premium Support: Security Incident Response
Provides answers to frequently asked questions and step-by-step guidance on responding to security events using AWS-native tools.

Beyond incident response, disaster recovery is another crucial piece of the puzzle. By pairing Wazuh’s continuous monitoring with AWS Backup for automated backups and cross-region replication, you can ensure that even if a major incident occurs, your environment can be restored quickly and efficiently. An effective incident response plan can feel overwhelming at first, but by taking it step by step, you’ll soon see that it’s a long-time mindset of constantly being curious and eager to learn new things that create experts.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more