Skip to content

Instantly share code, notes, and snippets.

View restump's full-sized avatar

Reuben Stump restump

  • Philadelphia, PA
View GitHub Profile
@restump
restump / DeleteRoleAllAccounts.py
Created April 22, 2019 12:03
Delete role on all accounts
#!/usr/bin/env python
import boto3
import pprint
import argparse
import csv
from multiprocessing import Process
from botocore.exceptions import ProfileNotFound, ClientError
def doHttpRequest(self, verb, url, headers=None, data=None):
options = {}
if headers:
options["headers"] = headers
if data:
options["data"] = data
try:
r = self.http._request(verb.lower(), url, options)
r.raise_for_status()
@restump
restump / now-mid-aws-disco-permissions.json
Created August 12, 2020 22:16
Updated minimal IAM policy to support NOW AWS MID assume-role discovery
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"account:ListRegions",
"application-autoscaling:Describe*",
"autoscaling:Describe*",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResource",
@restump
restump / restrict-data-read-permissions.json
Last active August 12, 2020 22:34
AWS IAM permissions to restrict sensitive data resources
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestrictSensitiveDataReadActions",
"Action": [
"cloudformation:GetTemplate",
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:Query",