Akamai App & API Protector: Edge WAF, DDoS Shield, and Origin Cloaking
# [02 Akamai Edge] Akamai App & API Protector: Edge WAF, DDoS Shield, and Origin Cloaking
## Overview
When hosting the Xage Universal Access gateway in cloud environments such as AWS, Microsoft Azure, or Google Cloud Platform, securing the HTTP/HTTPS ingress boundary is paramount. Akamai App & API Protector (formerly Kona Site Defender combined with API Gateway and Bot Management) serves as the primary edge inspection and traffic conditioning layer.
This document details the configuration, security rulesets, origin cloaking mechanisms, and header translation required to place Akamai's edge platform securely in front of a Xage cloud deployment.
---
## 1. Edge Ingress Architecture and Anycast Routing
Traffic intended for the Xage gateway is steered to Akamai through authoritative DNS CNAME records pointing to an Akamai Edge Hostname (e.g., `access.company.com.edgekey.net`):
1. **Global Anycast Resolution:** Akamai Edge DNS resolves user queries to the topologically nearest edge server across thousands of Points of Presence (PoPs) globally.
2. **TLS Termination:** The edge server terminates user TLS connections using certificates provisioned through Akamai's Certificate Provisioning System (CPS). This removes the cryptographic handshake overhead from the cloud origin and allows deep Layer 7 packet inspection.
3. **Optimized Backhaul Route:** Akamai routes inspected traffic over its optimized private backbone (SureRoute) to the cloud origin, minimizing latency, route flapping, and packet loss.
---
## 2. Web Application & API Protection (App & API Protector)
Xage exposes two primary web interfaces in the cloud:
- **Administrative & User Portal (HTTPS / WebSockets):** HTML5 web application delivering the unified dashboard, session viewer, and web-based terminal/remote desktop emulators.
- **REST and gRPC APIs:** Endpoints utilized by client CLI tools, identity synchronizers, and distributed Xage Fabric nodes for control plane communication.
To protect these interfaces, Akamai App & API Protector is configured with the **Adaptive Security Engine (ASE)**:
### A. Core Attack Mitigation
- **OWASP Top 10 Defense:** Automatic inspection and blocking of SQL Injection (SQLi), Cross-Site Scripting (XSS), Local File Inclusion (LFI), Remote File Inclusion (RFI), and Command Injection attacks.
- **Server-Side Request Forgery (SSRF) Protection:** Inspects all outbound API payloads and headers to prevent attackers from using the portal as an SSRF trampoline into cloud metadata endpoints (e.g., `169.254.169.254`).
- **Malformed Request Rejection:** Enforces RFC-compliant HTTP methods, header lengths, and parameter counts, rejecting protocol anomalies at the edge.
### B. Rate Limiting and DoS Defense
- **Burst and Sustained Rate Rules:** Configured to throttle brute-force authentication attacks on Xage login endpoints (e.g., `/api/v1/auth/login`). Requests exceeding 20 attempts per minute per IP address are challenged via client cryptographic challenges or dropped immediately.
- **Slowloris and Slow POST Mitigation:** Mitigates low-and-slow Layer 7 attacks by enforcing minimum request data transfer rates and aggressive read timeouts on incomplete headers.
### C. Bot Management and Credential Stuffing Prevention
- **Behavioral Telemetry:** Differentiates legitimate web browser telemetry from headless automated scraping frameworks (Puppeteer, Selenium, Playwright).
- **Known Credential Stuffing Lists:** Blocks authentication requests utilizing passwords identified across global breach intelligence feeds.
---
## 3. Origin Cloaking via Akamai Site Shield
Exposing the cloud origin’s public IP address defeats the purpose of an edge WAF: an adversary could bypass Akamai entirely by sending HTTP requests directly to the cloud load balancer's IP address. To prevent this, enterprises implement **Akamai Site Shield**.
### How Site Shield Works:
1. Akamai assigns a stable, dedicated pool of edge server IP addresses (Site Shield CIDR blocks) reserved for communicating with the customer’s cloud origin.
2. The enterprise configures their cloud firewall (AWS Security Group, Azure Network Security Group, or cloud firewall appliance) to allow inbound TCP port 443 traffic **strictly and exclusively** from the Site Shield CIDR blocks.
3. All other inbound internet traffic (0.0.0.0/0) is dropped at the cloud VPC edge.
```
Public Internet Users
│
▼ (Any Public IP)
[ Akamai Edge Servers ]
│
▼ (Site Shield CIDR Blocks Only: e.g., 23.32.0.0/18, 104.64.0.0/18)
[ Cloud Security Group: Allow TCP 443 ONLY from Site Shield ]
│
▼ (Verified Traffic Only)
[ Cloud Load Balancer / Xage Node Ingress ]
```
### Site Shield Maintenance:
- Akamai provides automated notifications when Site Shield IP ranges are scheduled for update.
- Infrastructure-as-Code (Terraform / Ansible) scripts query the Akamai Site Shield API (`/siteshield/v1/maps`) to automatically update cloud security groups before new edge IP ranges are energized.
---
## 4. Origin Authentication & Mutual TLS (mTLS)
To guarantee that traffic reaching the cloud load balancer originated from an authorized Akamai edge server (and not another Akamai customer sharing the same edge network):
- **Origin Server TLS Verification:** Akamai verifies the cloud load balancer's SSL/TLS certificate against an enterprise-managed Public Key Infrastructure (PKI) or trusted CA.
- **Mutual TLS (mTLS) / Client Certificate Authentication:** Akamai presents a customer-specific client certificate signed by Akamai's Certificate Authority during the TLS handshake with the cloud origin. The cloud load balancer validates this certificate before forwarding traffic to Xage.
---
## 5. Header Forwarding & Audit Fidelity
Because Akamai acts as a reverse proxy, the source IP of every incoming TCP packet hitting the cloud origin will be an Akamai edge server IP. However, Xage requires the original user's IP for audit logs, geolocation policies, and session forensics.
The following header behaviors must be configured in **Akamai Property Manager**:
| Header Name | Configuration Value | Purpose in Xage |
| :--- | :--- | :--- |
| `True-Client-IP` | `{{builtin.AKAMAI_TRUE_CLIENT_IP}}` | Contains the real public IP of the connecting client. Xage uses this for primary logging. |
| `X-Forwarded-For` | `{{builtin.AKAMAI_TRUE_CLIENT_IP}}, ...` | Appends client and proxy intermediate addresses according to standard proxy chain formatting. |
| `X-Forwarded-Proto` | `https` | Informs Xage that the client-to-edge connection was encrypted via HTTPS. |
| `X-Forwarded-Port` | `443` | Specifies the original inbound destination port. |
| `X-Akamai-Edge-PoP` | `{{builtin.AKAMAI_EDGE_SERVER_POP}}` | Injects the edge PoP code (e.g., `ORD`, `IAD`, `FRA`) for latency and path analysis. |
---
## 6. WebSocket and Interactive Session Conditioning
A critical operational requirement for Xage is support for long-lived, bidirectional streams:
- Xage renders SSH terminals and RDP virtual desktops in standard browser canvases by converting binary protocols into WebSockets (`wss://`) over port 443.
- Standard CDN edge configurations enforce 30-to-60 second idle timeouts, which would cause active administrator sessions to disconnect abruptly when an engineer pauses between commands.
### Akamai Configuration Mandates for Xage:
1. **Enable WebSockets Behavior:** Explicitly add the "WebSockets" rule in Akamai Property Manager for path patterns matching `/ws/*` and `/api/v1/sessions/*`.
2. **WebSocket Idle Timeout:** Extend the WebSocket idle ping/pong timeout to **300 seconds (5 minutes)** or match the corporate session idle limit.
3. **Buffer Management:** Disable intermediate response buffering for WebSocket upgrade paths to prevent keystroke lag and screen tearing during interactive terminal sessions.
4. **HTTP/2 and HTTP/3 Protocol Support:** Enable HTTP/2 for the primary web portal to enable multiplexing of page assets, telemetry streams, and session notifications over a single TCP connection.