Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Cross-Layer Security Orchestration

Hello! Welcome to the final lesson in our module on architecting unified edge security platforms.

Throughout this module, we've designed the foundational building blocks of a global security platform. We've architected systems for distributing policy, collecting telemetry, securing the edge-to-origin path, and steering global traffic. Each of these components performs a critical function in isolation. However, the true power of a modern security platform lies in making these components work together.

This brings us to today's learning outcome, which synthesizes everything we've discussed: Design a system for orchestrating security responses across multiple layers (e.g., blocking an IP at the DDoS layer based on a WAF signal).

We will explore the architectural patterns that enable a security platform to act as a cohesive, intelligent system rather than a collection of siloed tools. You'll learn how to design a "nervous system" that takes a signal detected at one layer and triggers a coordinated response across others, creating a defense that is more efficient, responsive, and robust.


1. The Core Concept: From Silos to Orchestration

Traditionally, security products operated in silos. A Web Application Firewall (WAF) knew about web attacks, and a DDoS mitigation system knew about packet floods, but they rarely shared information. If an attacker's IP was blocked by the WAF, it could still consume network resources by sending volumetric traffic.

Modern security architecture aims to break down these silos through orchestration. The goal is to create feedback loops where intelligence gathered in one part of the system is used to automate actions in another.

A useful mental model for this is the OODA loop, a concept from military strategy:

  • Observe: Detect an event (e.g., a WAF block, a failed login).
  • Orient: Analyze the event in context (e.g., is this IP also showing other suspicious behavior?).
  • Decide: Determine the appropriate response.
  • Act: Execute the response (e.g., block the IP, challenge the user).

Security Orchestration, Automation, and Response (SOAR) platforms are commercial products designed to implement this loop. Understanding their high-level architecture gives us a powerful template for designing our own custom orchestration systems.

What is Splunk SOAR (Phantom)? — Security Orchestration, Automation & Response Platform Overview

This video provides an excellent overview of Splunk SOAR, a popular orchestration platform. It explains how such systems fit into the security stack and automate the 'Decide' and 'Act' phases of a response.

Please watch the following sections to understand the core architectural concepts: Where SOAR fits (08:51 - 11:24): Focus on how SOAR uses the OODA loop to automate the 'Decide' and 'Act' stages based on signals from other tools. How Orchestration Works (11:24 - 23:56): Pay close attention to the concepts of 'Apps' (API connectors to other tools) and standardized 'Actions' (like 'block ip'). This is the key to cross-layer control. Automation with Playbooks (23:56 - 43:54): Understand that 'Playbooks' are essentially visual scripts that define the decision logic (the 'if-then' rules) for an automated response. This is the heart of the decision engine.

The key architectural takeaways from the SOAR model are:

  1. Centralized Intelligence: Signals from many sources are aggregated.
  2. API-driven Actions: The system relies on "apps" or "connectors" that use APIs to control other tools.
  3. Programmable Logic: "Playbooks" codify the organization's response procedures into automated workflows.

Now, let's see how these principles are applied in the custom-built systems of major service providers.


2. Architectural Pattern 1: Centralized Brain with Feedback Loops

One of the most powerful orchestration patterns involves a central analysis engine that consumes data from the entire platform, makes decisions, and pushes new mitigation rules back to the enforcement points at the edge.

Cloudflare's architecture provides a canonical example of this pattern. They have a centralized system called Gatebot that orchestrates responses across different layers of the network stack.

Rolling With The Punches: Shifting Attack Tactics

This Cloudflare blog post details several cross-layer orchestration strategies driven by their Gatebot system. It's a masterclass in building intelligent feedback loops.

Please read the following three sections. For each one, focus on the 'Observe -> Decide -> Act' pattern: 'Centrally Analyzed, Edge Enforced DDoS Mitigations': Understand Gatebot's role as a central analysis engine. 'Using IP Jails to Reduce the Cost of Mitigation': This is a critical example. Note how a Layer 7 signal (high HTTP request rate) triggers a Layer 4 action (dropping packets). 'Using Origin Errors to Catch Low-Rate Attacks': Observe how an application health signal (5xx error rates) is fed back into the security system to adjust its sensitivity.

Let's break down the "IP Jails" pattern, as it perfectly embodies our learning outcome:

  • Observe: Gatebot's L7 analysis components detect an extremely high rate of HTTP requests from a distributed set of IPs. The WAF is mitigating this, but at a high computational cost (processing HTTP, serving error pages).
  • Decide: The request rate crosses a predefined threshold. The system decides that these IPs are unequivocally malicious and that the priority is now to mitigate as cheaply as possible.
  • Act: Gatebot pushes a rule to a lower layer of the stack—the L4 packet processor. This rule instructs the edge to simply DROP any TCP packets from the offending IPs, preventing them from ever reaching the more expensive L7 proxy.

This is a powerful optimization: the mitigation is moved down the stack from a computationally expensive layer to a cheaper one, based on a high-confidence signal.

The diagram below illustrates this general concept of a central brain (Gatebot) receiving telemetry from the edge and pushing mitigation instructions back.

Cloudflare DDoS Mitigation Architecture
This diagram shows traffic data and metrics from edge data centers feeding into the central 'Gatebot' system, which in turn sends mitigation instructions back to be enforced at the edge. This represents a classic centralized orchestration feedback loop.

3. Architectural Pattern 2: Log Analysis and Dynamic Policy Updates

While a system like Gatebot is highly sophisticated, we can design a similar, highly effective orchestration system using standard cloud components. This pattern involves analyzing security logs, identifying indicators of attack, and using functions to dynamically update security policies in real-time.

William Hill: High-performance DDOS Protection with AWS

This short video presents a real-world architecture used by William Hill on AWS. It's a fantastic, practical blueprint for an orchestrated response system.

Please watch the segment from 03:52 to 05:03. Focus on the specific AWS services used and the flow of data from log generation to WAF rule update.

Let's blueprint the architecture from the video. As a software engineer, you'll recognize this as a classic event-driven data processing pipeline:

  1. Observe (Log Ingestion): CloudFront, the edge service, writes access logs containing every request to an S3 bucket.
  2. Orient/Decide (Analysis): An analysis server (which could be an EC2 instance, a Spark job, etc.) pulls logs from S3. It runs analytics to identify malicious IPs (e.g., IPs with a high rate of 403s, IPs scanning for vulnerabilities).
  3. Act (Policy Update):
    • The analysis server writes the identified malicious IPs into a DynamoDB table. A Time-to-Live (TTL) attribute is set on each entry, ensuring IPs are automatically removed from the blocklist after a certain period.
    • The DynamoDB table is configured to trigger a Lambda function whenever an item is added or removed.
    • The Lambda function calls the AWS WAF API to update an IP Set with the new list of malicious IPs. This IP Set is used in a WAF rule to block traffic.

This architecture creates a closed loop where the behavior observed at the edge is used to automatically reprogram the edge's defenses.

The diagram below shows another variation of this pattern on AWS, where an ML model analyzes traffic patterns and pushes "intelligent rate limits" to the WAF via a Lambda function.

AWS Architecture for Orchestrated Security Responses
This AWS architecture demonstrates a feedback loop where an ML model analyzes traffic data, generates rate-limiting rules, and uses a Lambda function to apply these rules to the AWS WAF, showcasing automated, multi-layer orchestration.

4. Designing an Orchestration System

Drawing from these patterns, we can define the core components required to build a custom security orchestration engine.

A. Signal Ingestion and Normalization

This is the "Observe" stage. Your system needs a way to consume events from various security products.

  • Mechanisms: This could be a unified logging pipeline (e.g., Fluentd forwarding logs to Kafka), webhook receivers, or direct API polling.
  • Normalization: Signals from different sources (WAF, Bot detector, authentication service) will have different formats. A crucial first step is to normalize them into a common schema.
    • Example Schema: { "timestamp": "...", "source_product": "WAF", "signal_type": "SQL_INJECTION", "source_ip": "1.2.3.4", "target_path": "/login", "user_id": "anon", "confidence": "HIGH" }

B. The Decision Engine

This is the "Orient" and "Decide" brain. It consumes the normalized signals and executes the response logic.

  • Implementation: This can range in complexity:
    • Stateless Rules: Simple if-then logic (e.g., IF signal_type == 'SQL_INJECTION' THEN block_ip(source_ip)).
    • Stateful Correlation: More advanced logic that tracks state over time (e.g., IF ip_failed_login_count > 5 in 1 minute THEN block_ip(source_ip)). This often requires a fast key-value store like Redis.
    • Playbooks: As seen in the SOAR video, this logic can be encoded in playbooks that chain multiple steps, decisions, and actions together.
    • ML Models: For anomaly detection, models can learn baseline behavior and flag deviations.

C. The Action/Enforcement Layer

This is the "Act" stage. This component consists of a set of connectors that translate a generic action into a specific API call for a given security product.

  • Generic Actions: Your decision engine should issue generic commands like block_ip, challenge_user, add_to_watchlist.
  • Specific Connectors:
    • The block_ip command would be translated by a WAFConnector into an API call to waf:UpdateIPSet.
    • The same block_ip command might be translated by a DDoSConnector into an API call to add the IP to a BGP flowspec blocklist.
    • The challenge_user command could be translated by an IdentityConnector to force MFA on the user's next login.

This abstraction allows you to add new security products without changing the core logic of your decision engine; you just need to build a new connector.


5. Tying it All Together: A Design Example

Let's design a response to a multi-stage attack to solidify these concepts.

Scenario: An attacker uses a bot to perform credential stuffing against your login page. After their IP is challenged, they pivot to a low-rate DDoS attack against your site's search API.

Orchestrated Response:

  1. Observe - Signal 1 (Bot Detection):

    • Your Bot Management system detects 10 failed login attempts from IP 8.8.4.4 in one minute.
    • It publishes a normalized event to a Kafka topic:
      { "source_product": "BotManager", "signal_type": "CredentialStuffing", "source_ip": "8.8.4.4", "count": 10 }
  2. Act - Response 1 (Low-friction):

    • A simple playbook in the Decision Engine consumes this event.
    • IF signal_type == "CredentialStuffing" AND count > 5
    • THEN execute action: challenge_ip(source_ip)
    • The Action Layer's WAFConnector translates this into an API call that adds 8.8.4.4 to a WAF rule set that serves a CAPTCHA.
  3. Observe - Signal 2 (WAF Anomaly):

    • The attacker, now blocked from logging in, pivots. The same IP, 8.8.4.4, starts hitting /api/search at a rate of 30 requests per second. This isn't enough to trigger global DDoS thresholds but is anomalous for a single IP.
    • The WAF's anomaly detection engine fires, publishing another event:
      { "source_product": "WAF", "signal_type": "L7_Rate_Anomaly", "source_ip": "8.8.4.4", "rate": 30, "path": "/api/search" }
  4. Orient & Decide - Response 2 (Escalation):

    • A more sophisticated, stateful playbook in the Decision Engine is triggered. It correlates signals using a Redis cache.
    • LOOKUP state for "8.8.4.4" -> finds {"last_signal": "CredentialStuffing"}.
    • IF previous_signal was "CredentialStuffing" in last 10 minutes AND current_signal is "L7_Rate_Anomaly"
    • THEN decide: this is a malicious actor, escalate to a hard block.
  5. Act - Response 2 (Multi-Layer Block):

    • The engine executes two actions simultaneously:
      • Action A: block_ip(8.8.4.4, layer=7, duration=1h) -> The WAFConnector adds the IP to a WAF blocklist.
      • Action B: block_ip(8.8.4.4, layer=4, duration=1h) -> The DDoSConnector pushes the IP to the L4 packet filter to be dropped silently, saving WAF resources.

This example shows how a sequence of events can trigger an escalating, multi-layered response, creating a defense that is far more intelligent than any single component could be on its own.


Conclusion

This lesson concludes our module on architecting unified edge security platforms. We've moved from designing individual components to designing the system that makes them work in concert.

Key Takeaways:

  • Orchestration creates feedback loops: It turns a set of disconnected security tools into an integrated defense system where signals from one layer inform actions in another.
  • The architecture follows a clear pattern: Ingest and normalize signals, process them in a decision engine (with rules or playbooks), and execute responses via an API-driven action layer.
  • Cross-layer responses improve efficiency and resilience: Moving mitigation down the stack (e.g., from L7 to L4) based on high-confidence signals saves computational resources and makes the platform more scalable.
  • This is a data and software problem: Building these systems requires robust data pipelines, event-driven architecture, and clean API abstractions—all core competencies for a software engineer.

You now have a complete set of architectural patterns for designing a modern, unified security platform, from the global routing layer down to the individual security engines and the orchestration system that binds them together.

In the next module, "Architecting a Web Application Firewall (WAF)," we will take a deep dive into the first of our specific security products. We will apply the core patterns we've learned here to design the full data plane and control plane of a WAF from first principles.

Can't find a good explanation? Sign up and we'll make it for you

Sign up