Infrastructure Layer

Attacks

Gremlin is a simple, safe, and secure way to use Chaos Engineering to improve system resilience. The Gremlin Platform provides a range of attacks which you can run against your infrastructure. This includes Resource Gremlins, Network Gremlins and State Gremlins. It is also possible to schedule regular attacks, create attack templates, and view attack reports.

Gremlin provides a library of possible failure modes to test. You can impact system resources, delay or drop network traffic to your dependencies, shut down your hosts, and much more!

Visit the attack creation page to start testing your infrastructure today. Go to the attacks list page to monitor ongoing and historic attacks.

Each attack, or "gremlin", tests your resilience in a different way:

Resource Gremlins

Resource gremlins are a great starting point -- simple to run and understand. They reveal how your service degrades when starved of CPU, memory, IO, or disk.

Gremlin Impact
CPU Generates high load for one or more CPU cores.
Memory Allocates a specific amount of RAM.
IO Puts read/write pressure on I/O devices such as hard disks.
Disk Writes files to disk to fill it to a specific percentage.

State Gremlins

State gremlins introduce chaos into your infrastructure so that you can observe how well your service handles it or fails.

Gremlin Impact
Shutdown Reboots or halts the host operating system to test how your system behaves when losing one or more cluster machines.
Time travel Changes the host's system time, which can be used to simulate adjusting to daylight saving time and other time-related events.
Process killer Kills the specified process, which can be used to simulate application or dependency crashes.

Network Gremlins

Network gremlins allow you to see the impact of lost or delayed traffic to your application. Test how your service behaves when you are unable to reach one of your dependencies, internal or external. Limit the impact to only the traffic you want to test by specifying ports, hostnames, and IP addresses.

Gremlin Impact
Blackhole Drops all matching network traffic.
Latency Injects latency into all matching egress network traffic.
Packet loss Induces packet loss into all matching egress network traffic.
DNS Blocks access to DNS servers.

Warning: Important considerations for targeting Kubernetes Pods with Network Attacks


Attack Stage Progression

Every Attack on Gremlin is composed of one or more Executions, where each Execution is an instance of the attack running on a specific target.

The Stage progression of an Attack is derived from the Stage progression of all of an Attack's Executions. Gremlin weighs the Importance of Stages so as to mark an Attack with the most important Stage of its executions.

Example

An Attack with three Executions will derive its final reported stage by picking the most important stage from among its executions. So, if the three Execution Stages are TargetNotFound, Running, TargetNotFound, the resulting stage for the Attack will be Running.

You can see Stages ordered by their importance below.

Stages

Stages are sorted by descending order of importance (the Running Stage holds the highest importance)

Stage Description
Running Attack running on the host
Halt Attack told to halt
RollbackStarted Code to rollback has started
RollbackTriggered Daemon started a rollback of client
InterruptTriggered Daemon issued an interrupt to the client
HaltDistributed Distributed to the host but not yet halted
Initializing Attack is creating the desired impact
Distributed Distributed to the host but not yet running
Pending Created but not yet distributed
Failed Client reported unexpected failure
HaltFailed Halt on client did not complete
InitializationFailed Creating the impact failed
LostCommunication Client never reported finishing/receiving execution
ClientAborted Something on the client/daemon side stopped the Gremlin and it was aborted without user intervention
UserHalted User issued a halt, and that is now complete
Successful Completed running on the Host
TargetNotFound Attack not scoped to any current targets

Parameter Reference

Resource Gremlins

CPU
Parameter Description
Length The length of the attack (seconds)
Cores The number of cores to try to utilize
Disk
Parameter Description
Length The length of the attack (seconds)
Dir The root directory for the IO attack
Workers The number of diskwrite workers to run concurrently
Block Size Number of Kilobytes (KB) that are read/written at a time
Volume Percentage Percent of Volume to fill (0100)
IO
Parameter Description
Length The length of the attack (seconds)
Dir The root directory for the IO attack
Workers The number of IO workers to run concurrently
Mode Do only reads, only writes, or both
Block Size Number of Kilobytes (KB) that are read/written at a time
Block Count The number of blocks read/written by workers
Memory
Parameter Description
Length The length of the attack (seconds)
MB The number of megabytes to allocate
GB The number of gigabytes to allocate

State Gremlins

Process Killer
Parameter Description
Length The length of the attack (seconds)
Interval The number of seconds to delay before kills
Process The process name to match (allows regex) or the process ID
Group The group name or ID to match against (name matches only)
User The user name or ID to match against (name matches only)
Newest If set the newest matching process will be killed (name matches only, cannot be used with o)
Oldest If set the oldest matching process will be killed (name matches only, cannot be used with n)
Exact If set the match must be exact and not just a substring match (name matches only)
Kill Children If set the processes children will also be killed
full match If set the processes name match will occur against the full command line string that the process was launched with
Shutdown
Parameter Description
Delay The number of minutes to delay before shutting down
Reboot Indicates the host should reboot after shutting down
Time Travel
Parameter Description
Length The length of the attack (seconds)
NTP Disable NTP from correcting systemtime
Offset The offset to the current time (seconds)

Network Gremlins

Blackhole
Parameter Description
Length The length of the attack (seconds)
Ipaddresses Only impact traffic to these IP addresses (also accepts CIDR values, like: 10.0.0.0/24)
Device Impact traffic over this network interface
Hostnames Only impact traffic to these hostnames
Egress Ports Only impact egress traffic to these destination ports (also accepts ranges, like 8080-8085)
Ingress Ports Only impact ingress traffic to these destination ports
Protocol Impact traffic over this network interface
Latency
Parameter Description
Length The length of the attack (seconds)
Ipaddresses Only impact traffic to these IP addresses (also accepts CIDR values, like: 10.0.0.0/24)
Device Impact traffic over this network interface
Hostnames Only impact traffic to these hostnames
Egress Ports Only impact egress traffic to these destination ports (also accepts ranges, like 8080-8085)
Source Ports Only impact egress traffic from these source ports
MS How long to delay egress packets (millis)
Protocol Impact traffic over this network interface
DNS
Parameter Description
Length The length of the attack (seconds)
Ipaddresses Prevent lookups from these DNS servers (also accepts CIDR values, like: 10.0.0.0/24)
Device Impact traffic over this network interface
Protocol Impact traffic over this network interface
Packet Loss
Parameter Description
Length The length of the attack (seconds)
Ipaddresses Only impact traffic to these IP addresses (also accepts CIDR values, like: 10.0.0.0/24)
Device Impact traffic over this network interface
Hostnames Only impact traffic to these hostnames
Egress Ports Only impact egress traffic to these destination ports (also accepts ranges, like 8080-8085)
Source Ports Only impact egress traffic from these source ports
Percent Percentage of packets to drop (10 is 10%)
Protocol Impact traffic over this network interface
corrupt Corrupt the packets instead of just dropping them.

Multiple Values

Port and address options can be used multiple times in a single command

# Attack both DynamoDB and database.mydomain.org
gremlin attack latency -h dynamodb.us-west-1.amazonaws.com -h database.mydomain.org

Alternatively, a , can also be used to specify multiple values.

gremlin attack latency -p 8080,443

Whitelisting

A ^ can be used before a port or address to whitelist that parameter.

Note: If only a whitelist is supplied, all other traffic is impacted.

# Slow down all ports except DNS port
gremlin attack latency -p ^53

This can be particularly useful for whitelisting a specific IP from a range.

# Blackhole all hosts in 10.0.0.0/24 except for 10.0.0.11
gremlin attack blackhole -i 10.0.0.0/24 -i ^10.0.0.11