This file contains hidden or 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
#!/usr/bin/env python | |
import requests | |
import ipaddr | |
# Get the AWS IP address ranges https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html | |
ip_ranges = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json').json()['prefixes'] | |
# Get the CIDR to check from from the user | |
cidrtocheck = input("Enter your CIDR to check... ") | |
range = ipaddr.IPNetwork(cidrtocheck) # Turn it into IP Network Class |
This file contains hidden or 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 ast | |
import boto3 | |
from botocore.exceptions import ClientError | |
pricingclient = boto3.client('pricing', region_name='us-east-1') | |
paginator = pricingclient.get_paginator('get_attribute_values') | |
response_iterator = paginator.paginate( | |
ServiceCode='AmazonEC2', |
I hereby claim:
- I am reecestart on github.
- I am reecestart (https://keybase.io/reecestart) on keybase.
- I have a public key ASD96G7e5AWoI7kYirqOOtSoOTvm4lH1AMO_tC2Poky-qQo
To claim this, I am signing this object:
This file contains hidden or 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": [ | |
{ | |
"Sid": "AWSCloudTrailAclCheck20150319", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "cloudtrail.amazonaws.com" | |
}, | |
"Action": "s3:GetBucketAcl", |
This file contains hidden or 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", | |
"Id": "Key policy created by CloudTrail", | |
"Statement": [ | |
{ | |
"Sid": "Enable IAM User Permissions", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": [ | |
"arn:aws:iam::012345678901:root", |
This file contains hidden or 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 | |
from botocore.exceptions import ClientError | |
class bcolors: | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' | |
pricingclient = boto3.client('pricing', region_name='us-east-1') |
This file contains hidden or 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 | |
from datetime import date | |
from datetime import datetime | |
today = date.today() | |
today = datetime.combine(today, datetime.min.time()) | |
client = boto3.client('s3') | |
# Get all buckets | |
response = client.list_buckets() |
NewerOlder