This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import time | |
import argparse | |
import subprocess | |
import shlex | |
""" | |
Usage: python3 exhaust_ephemeral_ports.py <dst> <dport> <optional:loop> | |
Example: python3 exhaust_ephemeral_ports.py 172.31.23.144 80 | |
Help: exhaust_ephemeral_ports.py --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Regular Expressions List | |
//Short Tutorial | |
\ // the escape character - used to find an instance of a metacharacter like a period, brackets, etc. | |
. // match any character except newline | |
x // match any instance of x | |
^x // match any character except x | |
[x] // match any instance of x in the bracketed range - [abxyz] will match any instance of a, b, x, y, or z | |
| // an OR operator - [x|y] will match an instance of x or y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Title: | |
Incident date: | |
Owner: | |
Peer-review committee: | |
Tags: | |
Summary: | |
Supporting data: | |
Customer Impact: | |
Incident Response Analysis: | |
Post-Incident Analysis: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import random | |
import time | |
def stop_random_instance(ec2_client, az_name, tag): | |
paginator = ec2_client.get_paginator('describe_instances') | |
pages = paginator.paginate( | |
Filters=[ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
description: Stop instances in a particular AZ with tag filter | |
schemaVersion: '0.3' | |
assumeRole: "{{ AutomationAssumeRole }}" | |
parameters: | |
AvailabilityZone: | |
type: String | |
description: "(Required) The Availability Zone to impact" | |
TagName: | |
type: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
schemaVersion: '0.3' | |
description: Execute CPU stress via Run Command | |
assumeRole: "{{AutomationAssumeRole}}" | |
parameters: | |
AutomationAssumeRole: | |
type: String | |
description: "The ARN of the role that allows Automation to perform the actions on your behalf." | |
default: '' | |
InstanceIds: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.0.0", | |
"title": "What is the impact of an terminating the database master", | |
"description": "terminating the master database should not prevent the application from running", | |
"tags": ["db"], | |
"configuration": { | |
"endpoint_url": { | |
"type": "env", | |
"key": "ELEANOR_URL" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ssm:DescribeAssociation", | |
"ssm:GetDeployablePatchSnapshotForInstance", | |
"ssm:GetDocument", | |
"ssm:DescribeDocument", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.0.0", | |
"title": "What is the impact of randomly terminating an instance in an AZ", | |
"description": "terminating EC2 instance at random should not impact my app from running", | |
"tags": ["ec2"], | |
"configuration": { | |
"aws_region": "eu-west-1" | |
}, | |
"steady-state-hypothesis": { | |
"title": "more than 0 instance in region", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import random | |
REGION = 'eu-west-1' | |
def stop_random_instance(az, tag_name, tag_value, region=REGION): | |
''' | |
>>> stop_random_instance(az="eu-west-1a", tag_name='chaos', tag_value="chaos-ready", region='eu-west-1') | |
['i-0ddce3c81bc836560'] |
NewerOlder