Steadybit logoReliability Hub
GitHubGitHub iconStart free trial
Steadybit logoReliability Hub

Intercept Outgoing HTTP Request

AttackAttack
Beta
Returns a custom HTTP response (status, body, headers) for HTTP(S) calls to a specific dependency.
Targets:
Linux Hosts
Install now

Intercept Outgoing HTTP Request

Returns a custom HTTP response (status, body, headers) for HTTP(S) calls to a specific dependency.
AttackAttack
Targets:
Linux Hosts
Install now

Intercept Outgoing HTTP Request

AttackAttack
Beta
Returns a custom HTTP response (status, body, headers) for HTTP(S) calls to a specific dependency.
Targets:
Linux Hosts
Install now

Intercept Outgoing HTTP Request

Returns a custom HTTP response (status, body, headers) for HTTP(S) calls to a specific dependency.
AttackAttack
Targets:
Linux Hosts
Install now
Go back to list
YouTube content is not loaded by default for privacy reasons.

Introduction

Returns a synthesized HTTP response for a specific dependency's HTTP(S) calls — a status code, and optionally a custom body and headers — without ever reaching the real dependency. Requests are matched by the HTTP Host header (cleartext HTTP) or the TLS SNI (HTTPS). HTTPS requires an interception CA configured in the extension (see HTTPS).

Prerequisites

If you are not using our container images for the extension, the attack requires iptables (from the iptables package).

Details

A transparent TCP proxy is started in the host's network namespace. An iptables rule redirects matching outgoing TCP connections to the proxy, which reads the HTTP Host header (cleartext HTTP) or the TLS SNI (HTTPS) to decide whether a request belongs to one of the targeted dependencies. Requests to other destinations are relayed through untouched. Because selection happens by hostname rather than by IP, the attack works for dependencies behind shared or rotating IPs (CDNs, cloud endpoints). Each execution uses its own iptables chain, so multiple attacks can run concurrently. For matched requests the proxy writes the configured HTTP status code (and optional body and headers) back to the client instead of forwarding the request.

Only HTTP(S) traffic to the targeted hostname(s) is affected. Other traffic on the host is relayed untouched.

HTTPS

Attacking an HTTPS dependency requires an interception CA configured in the extension (Helm value tlsIntercept.existingSecret, see the extension's README). The proxy decrypts each matched HTTPS connection with a certificate it issues for the hostname, so it decides each request on its own, exactly as for cleartext HTTP, and forwards the other requests to the real dependency over its own TLS connection. Without a CA, the proxy can't see the requests inside TLS and HTTPS is relayed untouched, so no response is synthesized. Don't attack HTTPS dependencies without one.

  • The target's workloads must trust the CA. Every matched HTTPS connection is decrypted, whatever the Fault Probability, so a workload that doesn't trust the CA, or pins certificates, fails all its requests to the dependency. The statistics show these rejected connections.
  • A forwarded request reaches the dependency only if the proxy can verify the dependency's certificate. Public CAs are built in. For a dependency with a private CA, mount that CA and point SSL_CERT_DIR at it, or enable Skip Dependency Certificate Verification (unsafe, test environments only). Otherwise these requests get a 502 from the proxy.
  • Mutual TLS is not supported: the proxy forwards without the workload's client certificate, so the dependency rejects the request and the workload gets a 502.
  • Every TLS connection whose SNI matches a dependency hostname is decrypted as HTTP. Other protocols over TLS to the same hostname (e.g. Kafka or Redis over TLS) then fail, so restrict Dependency Ports to the HTTPS port(s) in that case.

Intercepting every port

With Dependency Ports left empty, every outgoing TCP connection of the host passes through the proxy during the attack; localhost traffic is excluded unless Attack Localhost Traffic is enabled (see below). This includes system services such as the kubelet and the container runtime. Requests to the dependency hostnames are recognized on any port, by their Host header or their TLS SNI, and answered with the configured response; everything else is relayed untouched.

Localhost traffic

By default, localhost traffic (127.0.0.0/8) on the host is never intercepted, whether or not Dependency Ports are set. Enable Attack Localhost Traffic to intercept it as well, e.g. when the application reaches the dependency through a local forward proxy or a 127.x entry in /etc/hosts.

  • Matching localhost connections pass through the proxy: existing ones may be reset when the attack starts, and all of them are closed when it ends. Without Dependency Ports, this applies to all localhost traffic on the host, including local agents and sidecars. Use Dependency Ports to narrow it down.
  • Only IPv4 localhost is intercepted; ::1 is not affected.
  • If a hostname seems to point to localhost, the attack warns but still runs.
  • The extension's own ports stay excluded, so the attack can still be stopped.
  • Earlier versions intercepted localhost only when Dependency Ports were set.

Use Cases

  • Simulate a dependency returning 5xx errors and verify error handling and fallbacks
  • Force specific status codes (e.g. 429, 503) to test retry, backoff and circuit-breaker logic
  • Return a crafted body or headers to exercise response parsing and validation

Protocol compatibility

  • HTTP/1.0 and HTTP/1.1 (cleartext) — matched by the HTTP Host header and the synthesized response is written back. Fully supported. Fault Probability applies per request: each request on a keep-alive connection is decided on its own, and the connection stays open after a synthesized response. A WebSocket upgrade is decided on the upgrade request only; after that, the connection is passed through untouched.
  • HTTPS (TLS), HTTP/1.1 and HTTP/2 — matched by the TLS SNI; requires an interception CA (see HTTPS). The connection is decrypted and handled like cleartext HTTP: Fault Probability applies per request, also on keep-alive and multiplexed HTTP/2 connections, and the synthesized response is written back inside TLS.
  • HTTP/2 cleartext (h2c) — not matched (the authority is not a plain Host header).
  • HTTP/3 (QUIC) — not affected: this attack intercepts TCP only.

Parameters

ParameterDescriptionDefault
Dependency HostnamesThe hostname(s) of the dependency to affect. Matched at layer 7 by the HTTP Host header (cleartext HTTP) or the TLS SNI (HTTPS). Required.
DurationHow long should the attack last?30s
Fault ProbabilityThe chance that each matching request gets the fault. Each request is decided on its own, also on keep-alive connections, for cleartext HTTP and HTTPS.50
Dependency IPs/CIDRs(optional) Restrict matching to these IP addresses or CIDR blocks.
Dependency Ports(optional) Restrict matching to these ports. Leave empty to intercept every port.
Exclude IPs/CIDRs(optional) Exclude these IP addresses or CIDR blocks from matching.
Attack Localhost Traffic(optional) Also intercept traffic to localhost (127.0.0.0/8). See Localhost traffic.false
Response StatusThe HTTP status code to return for matched requests.503
Response Body(optional) A custom response body to return.
Response Headers(optional) Custom response headers to return.
Skip Dependency Certificate Verification(optional) Unsafe, test environments only: forward intercepted HTTPS requests to the dependency without verifying its certificate. See HTTPS.false
Response Delay (ms)(optional) Delay in milliseconds before returning the synthesized response, to mimic a slow-then-failing dependency.0

Statistics

While the attack runs, a Dependency Fault Statistics widget shows the intercepted ports, how many connections were intercepted, how many of them went to a dependency hostname and how many were faulted, a breakdown of what was done (latency applied, HTTP responses injected, connections reset, forwarded untouched), and a per-hostname table. Zero intercepted connections means the interception installed but no traffic hit it — check the ports and that traffic flows through this network namespace. Intercepted connections but none to a dependency hostname means the traffic flows, but the hostnames don't match — check them against the TLS SNI or HTTP Host header. For HTTP and HTTPS, the summary shows requests instead of connections: how many went to a dependency hostname and how many were faulted, with the share in percent to compare with Fault Probability. The per-hostname table shows both, and there a keep-alive connection counts as faulted once, however many of its requests were. If the proxy can't connect to a destination, the widget shows how often forwarding failed. HTTP responses injected counts every synthesized response.

More Linux Host actions

See all
Block DNS
Blocks access to DNS servers
AttackAttack
Linux Hosts
Start using Steadybit today

Get started with Steadybit, and you’ll get access to all of our features to discover the full power of Steadybit. Available for SaaS and on-prem!

Are you unsure where to begin?

No worries, our reliability experts are here to help: book a demo with them!

Statistics
-Stars
Tags
Host
Kubernetes
Network
HTTP
AWS
Azure
GCP
Homepage
hub.steadybit.com/extension/com.steadybit.extension_host
License
MIT
MaintainerSteadybit
Install now
Steadybit logoReliability Hub
Start free trial
© 2026 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon