README
¶
Steadybit extension-host
This Steadybit extension provides a host discovery and various actions for host targets.
Learn about the capabilities of this extension in our Reliability Hub.
Configuration
| Environment Variable | Helm value | Meaning | Required | Default |
|---|---|---|---|---|
STEADYBIT_LABEL_<key>=<value> |
Environment variables starting with STEADYBIT_LABEL_ will be added to discovered targets' attributes. Example: STEADYBIT_LABEL_TEAM=Fullfillment adds to each discovered target the attribute team=Fullfillment |
no | ||
STEADYBIT_DISCOVERY_ENV_LIST |
List of environment variables to be evaluated and added to discovered targets' attributes. Example: STEADYBIT_DISCOVERY_ENV_LIST=STAGE adds to each target the attribute stage=<value of $STAGE> |
no | ||
STEADYBIT_EXTENSION_DISCOVERY_ATTRIBUTES_EXCLUDES_HOST |
discovery.attributes.excludes.host | List of Target Attributes which will be excluded during discovery. Checked by key equality and supporting trailing "*" | false | |
STEADYBIT_EXTENSION_PORT |
containerPorts.http | Port the extension's HTTP server listens on. | false | 8085 |
STEADYBIT_EXTENSION_HEALTH_PORT |
containerPorts.health | Port the health/liveness endpoint listens on. | false | 8081 |
STEADYBIT_EXTENSION_HOSTNAME |
discovery.hostnameFromKubernetes | Hostname reported for the host target. The chart sets it to the Kubernetes node name when discovery.hostnameFromKubernetes is true; otherwise the OS hostname is used. |
false | |
STEADYBIT_EXTENSION_DISABLE_RUNC |
Run attack helpers directly (via nsenter) instead of inside a runc-managed container. |
false | false | |
STEADYBIT_EXTENSION_NETWORK_STRICT_ROOT_QDISC |
When true, refuse network attacks on interfaces whose root qdisc isn't noqueue; when false, snapshot the root qdisc tree and replay it on revert (preserving cloud-tuned state). |
false | true | |
STEADYBIT_EXTENSION_FILL_MEMORY_RESERVE |
Memory the "Fill Memory" attack always leaves available so the host OS and (on Kubernetes) the kubelet stay responsive. Accepts suffixes K/M/G or %. | false | 512MiB | |
STEADYBIT_EXTENSION_FILL_MEMORY_OOM_SCORE_ADJ |
oom_score_adj applied to the "Fill Memory" process. The default sits just above the agent/extension-host, so the fill is OOM-killed before the Steadybit tooling if memory is exhausted. | false | -996 | |
STEADYBIT_EXTENSION_TLS_INTERCEPT_CA_CERT |
tlsIntercept.existingSecret |
PEM CA certificate enabling 'Intercept Outgoing HTTP Request' to synthesize responses for HTTPS dependencies, 'Slow Outgoing HTTP(s) Dependency' to delay each HTTPS request, and the L7 mode of 'Reset TCP/HTTP(s) Connection' to reset each HTTPS request. Test environments only — see below. | no | |
STEADYBIT_EXTENSION_TLS_INTERCEPT_CA_KEY |
tlsIntercept.existingSecret |
PEM private key matching the CA certificate. | no |
Beyond the settings above, this extension supports the configuration common to all Steadybit extensions:
- extension-kit — HTTP and health ports, TLS and mutual TLS, unix domain socket, logging, and pprof.
- Target Filtering — stop the extension reporting targets you do not want.
- Group Matching — tag discovered targets with a group, so enrichment rules only match within it.
When installed as linux package this configuration is in/etc/steadybit/extension-host.
Needed capabilities
The capabilities needed by this extension are: (which are provided by the helm chart)
SYS_ADMINSYS_CHROOTSYS_BOOTSYS_TIMESYS_PTRACEKILLNET_RAWNET_ADMINNET_BIND_SERVICEBPFDAC_OVERRIDESETUIDSETGIDAUDIT_WRITESETPCAPMKNOD
Optional:
SYS_RESOURCE
Installation
Kubernetes
Detailed information about agent and extension installation in kubernetes can also be found in our documentation.
Recommended (via agent helm chart)
All extensions provide a helm chart that is also integrated in the helm-chart of the agent.
The extension is installed by default when you install the agent.
You can provide additional values to configure this extension.
Additional configuration options can be found in the helm-chart of the extension.
Alternative (via own helm chart)
If you need more control, you can install the extension via its dedicated helm-chart.
helm repo add steadybit-extension-host https://steadybit.github.io/extension-host
helm repo update
helm upgrade steadybit-extension-host \
--install \
--wait \
--timeout 5m0s \
--create-namespace \
--namespace steadybit-agent \
steadybit-extension-host/steadybit-extension-host
Linux Package
Please use our agent-linux.sh script to install the extension on your Linux machine. The script will download the latest version of the extension and install it using the package manager.
After installing, configure the extension by editing /etc/steadybit/extension-host and then restart the service.
Extension registration
Make sure that the extension is registered with the agent. In most cases this is done automatically. Please refer to the documentation for more information about extension registration and how to verify.
Security
We try to limit the access needed for the extension to the absolute minimum. So the extension itself can run as a non-root user on a read-only root file-system and will, by default, if deployed using the provided helm chart.
In order to execute certain actions the extension needs extended capabilities, see details below.
Resource Attacks
The resource attacks are starting processes in the target containers cgroup/namespaces using runc (APL2.0) for this the following capabilities are needed: CAP_SYS_CHROOT, CAP_SYS_ADMIN, CAP_SYS_PTRACE, CAP_NET_BIND_SERVICE, CAP_DAC_OVERRIDE, CAP_SETUID, CAP_SETGID, CAP_AUDIT_WRITE, CAP_KILL.
These processes are executed with the root user, but are short-lived and terminated after the attack is finished.
The resource attacks optionally need CAP_SYS_RESOURCE. We'd recommend it to be used, otherwise the resource attacks are more likely to be oom-killed by the kernel and fail to carry out the attack.
Under the hood stress-ng (GPL2.0) is used to perform the stress attacks.
For the fill disk dd or fallocate and nsmount (MIT) is used.
For the fill memory memfill (MIT) is used.
All needed binaries are included in the extension container image.
Network Attacks
The network attacks are starting processes in the target containers network namespaces using runc (APL2.0) for this the following capabilities are needed: CAP_NET_ADMIN, CAP_NET_RAW, CAP_BPF, CAP_SYS_CHROOT, CAP_SYS_ADMIN, CAP_SYS_PTRACE, CAP_NET_BIND_SERVICE, CAP_DAC_OVERRIDE, CAP_SETUID, CAP_SETGID, CAP_AUDIT_WRITE, CAP_KILL.
These processes are executed with the root user, but are short-lived and terminated after the attack is finished.
Under the hood start ip or tc is used to reconfigure the network stack and dig is used in case the hostnames need to be resolved.
All needed binaries are included in the extension container image.
Removing some of the capabilities in Kubernetes/Containers
In case you want to reduce the default capabilities of this extension, remove them from the helm values and use a custom image which doesn't set the capability on the executable. A customer image can be built using the following Dockerfile:
FROM ghcr.io/steadybit/extension-host:latest
USER root
RUN setcap 'cap_setuid,cap_sys_chroot,cap_setgid,cap_net_raw,cap_net_admin,cap_sys_admin,cap_dac_override,cap_sys_ptrace+eip' /extension
USER 10000
ENTRYPOINT ["/extension"]
Hardened nodes (nosuid root filesystem)
The extension runs non-root and relies on file capabilities on its binary. On hardened nodes
(e.g. CIS/STIG) the container root filesystem is mounted nosuid, which makes the kernel ignore
those file capabilities — the extension then starts without effective capabilities and attacks fail
with fork/exec /usr/bin/nsenter: operation not permitted.
If the node configuration cannot be changed to drop nosuid, set privileged=true to run the
extension in privileged mode (this also flips the managed SecurityContextConstraint to allow it):
--set privileged=true
Version and Revision
The version and revision of the extension:
- are printed during the startup of the extension
- are added as a Docker label to the image
- are available via the
version.txt/revision.txtfiles in the root of the image
HTTPS response injection (opt-in)
Intercept HTTP Request normally synthesizes a response for cleartext HTTP
only. Supplying a certificate authority lets it do the same for an HTTPS
dependency: the proxy terminates the matched TLS connection with a certificate
it mints for that hostname and handles it request by request, over HTTP/1.1 or
HTTP/2. Percentage applies to each request, as on cleartext HTTP: a selected
request is answered by the proxy, the others are forwarded to the real
dependency over the proxy's own TLS connection, once the proxy has verified
the dependency's certificate (see Dependencies with a private CA below). If
it cannot, the request gets a 502 from the proxy itself: the TLS handshake to
the dependency is aborted, so the dependency never sees the request, and it is
not counted as a fault.
The same CA lets Slow Outgoing HTTP(s) Dependency delay each HTTPS
request, with Percentage per request. Without it, HTTPS connections are not
decrypted, so the delay is decided once per connection and applies only before
its first request.
It also lets the L7 mode of Reset TCP/HTTP(s) Connection reset each HTTPS
request, with Percentage per request: on HTTP/2 the request's stream is
reset and the connection stays open, on HTTP/1.1 the connection is closed.
Most HTTP/1.1 clients silently resend a request whose reused connection closed
without a reply, so the workload may see fewer failures than the
Percentage; the statistics count every reset. Without the CA, the reset is
decided once per HTTPS connection, so a keep-alive client is reset only until
one connection is spared, which then carries every later request.
kubectl -n <ns> create secret generic intercept-ca \
--from-file=ca.crt=ca.crt --from-file=ca.key=ca.key
helm upgrade ... --set tlsIntercept.existingSecret=intercept-ca
The CA is yours. You generate it, choose how long it lives, and install it in the truststores of the workloads you want to fault. For every attack using it, every matched HTTPS connection is decrypted, whatever the Percentage, so a workload that does not trust the CA, or pins certificates, fails all its requests to the dependency, not only the selected share. That is reported in the attack's statistics rather than silently doing nothing.
Mutual TLS cannot be intercepted. The proxy forwards without the workload's
client certificate, so a dependency that requires one rejects the forwarded
requests, and the workload gets a 502 for them. Do not target such
dependencies with HTTPS interception.
Dependencies with a private CA. A forwarded request reaches the dependency
only if the proxy can verify its certificate. Public CAs are built in. For a
dependency whose certificate comes from your own CA, trust that CA the same way
as in every Steadybit extension: mount it and point SSL_CERT_DIR at it.
Without it, or with a CA that did not sign the dependency's certificate, the
requests that are not selected get a 502 instead of reaching the dependency.
kubectl create configmap -n steadybit-agent company-ca --from-file=./company-ca.crt
extraVolumeMounts:
- name: extra-certs
mountPath: /etc/ssl/extra-certs
readOnly: true
extraVolumes:
- name: extra-certs
configMap:
name: company-ca
extraEnv:
- name: SSL_CERT_DIR
value: /etc/ssl/extra-certs:/etc/ssl/certs
For test environments, an experiment can forward without verifying the
dependency at all: enable Skip Dependency Certificate Verification in the
attack's advanced settings. It applies to that experiment only;
STEADYBIT_EXTENSION_INSECURE_SKIP_VERIFY does not affect the proxy.
When the attack starts, the execution log warns if only public CAs verify the
dependencies, or if a path in SSL_CERT_DIR / SSL_CERT_FILE is missing or
holds no certificate. When forwarding fails during the attack, the statistics
widget shows how often, and the execution log adds a tip on the dependency's
certificate.
⚠️ The private key can impersonate any HTTPS endpoint to anything that trusts it. Keep this to test environments, and treat the Secret accordingly.
Documentation
¶
There is no documentation for this package.
Directories
¶
| Path | Synopsis |
|---|---|
|
flags
Package flags holds the action parameters that change what an attack does, with the logic and the execution-log output that depend on them.
|
Package flags holds the action parameters that change what an attack does, with the logic and the execution-log output that depend on them. |