AWS Security Group Rule Check
Built-in Command Probe template that validates whether AWS security groups have rules configured during a chaos experiment.
AWS Security Group Rule Check is a built-in Command Probe template that validates whether one or more AWS security groups have rules configured during a chaos experiment. Use it to confirm that network access policy stays intact, for example after a fault that modifies or restricts security group rules.
The probe runs the healthchecks utility bundled in the chaos probe image, queries the Amazon EC2 security group APIs, and prints [Pass] when the targeted security groups have rules of the requested type configured. The comparator marks the probe as passed when the output contains [Pass].
Use cases
Use this probe template to:
Validate that security group configurations stay intact during chaos.
Verify that network access rules are configured as expected.
Monitor security posture during infrastructure changes.
Confirm that security groups are not left without rules.
How the probe works
The template configures a Command Probe that runs healthchecks -name aws-resource-access-restrict. The utility resolves the security groups listed in SECURITY_GROUP_IDS in the supplied REGION, calls the Amazon EC2 security group APIs, and prints [Pass] when each group has rules of the RULE_TYPE configured. The comparator passes the probe when the output contains [Pass], and fails it otherwise.
Prerequisites
Chaos infrastructure: A Kubernetes chaos infrastructure with network access to the Amazon EC2 API endpoints.
AWS credentials: Cloud credentials available to the chaos infrastructure, with the permissions listed below.
Target security groups exist: Every ID in
SECURITY_GROUP_IDSexists inREGION.
Permissions required
The credentials used by the probe need the following AWS actions:
The probe uses the AWS credentials available to your chaos infrastructure. Go to AWS IAM integration to set up access through IAM Roles for Service Accounts (IRSA), or go to common policy for all AWS faults to apply a single superset policy.
Probe properties
Command
Comparator
string
contains
[Pass]
The probe passes when the command output contains [Pass], which indicates that the targeted security groups have rules of the requested type configured.
Environment variables
SECURITY_GROUP_IDS
Comma-separated list of security group IDs to check (for example, sg-12345678,sg-87654321).
Yes
-
RULE_TYPE
Type of rule to check. Accepted values are ingress or egress.
No
ingress
REGION
AWS region where the security groups are located (for example, us-east-1, eu-west-2).
Yes
-
Run properties
timeout
Maximum time to wait for the probe to complete (for example, 30s, 1m, 5m).
String
300s
interval
Time between probe executions (for example, 5s, 30s, 1m).
String
10s
attempt
Number of retry attempts before the probe is marked as failed.
Integer
1
pollingInterval
Time between retry attempts (for example, 1s, 5s, 10s).
String
-
initialDelay
Initial delay before the probe starts (for example, 0s, 10s, 30s).
String
-
stopOnFailure
Stop the experiment if the probe fails.
Boolean
false
verbosity
Log verbosity level (info, debug, trace).
String
-
Troubleshooting
Related probe templates
AWS Load Balancer AZ Check: Validate availability zones in an ALB or CLB.
AWS EC2 Instance Status Check: Validate the state of EC2 instances.
Built-in probe templates: Browse the full probe template library.
Last updated
Was this helpful?