Skip to content

Instantly share code, notes, and snippets.

Gene Wood gene1wood

Block or report user

Report or block gene1wood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gene1wood
gene1wood / scheduler.py.diff
Created Aug 16, 2019
Diff between scheduler.py in security_monkey 0.3.6 and moz_security_monkey
View scheduler.py.diff
--- scheduler-ca556d328280eba6b53df8934a6d63eaf1eb7d86.py 2019-08-16 07:47:49.289601195 -0700
+++ scheduler-bd1b505fef48e69fab6a7e76538bbac8a9149013.py 2019-08-16 07:48:41.593548348 -0700
@@ -1,138 +1,143 @@
"""
-.. module: security_monkey.scheduler
+.. module: moz_security_monkey.scheduler
:platform: Unix
:synopsis: Runs watchers, auditors, or reports on demand or on a schedule
.. version:: $$VERSION$$
@gene1wood
gene1wood / get_policy_documents_for_role.py
Created Jul 24, 2019
Function to return all AWS IAM policy documents (inline and managed) for a given IAM role
View get_policy_documents_for_role.py
import boto3
def get_paginated_results(product, action, key, credentials=None, args=None):
args = {} if args is None else args
credentials = {} if credentials is None else credentials
return [y for sublist in [x[key] for x in boto3.client(
product, **credentials).get_paginator(action).paginate(**args)]
for y in sublist]
@gene1wood
gene1wood / how-to-test-mozdef.md
Created Jul 16, 2019
Instructions on how to test MozDef after making code changes
View how-to-test-mozdef.md

Run tests

make test

Run MozDef and send events through to trigger an alert

sudo pip install mozdef_client mozdef_util
sudo service apache2 stop
@gene1wood
gene1wood / string-to-qrcode.bash
Created Jun 23, 2019
Convert a string to a QR code.
View string-to-qrcode.bash
#!/bin/bash
# Make sure qrencode and imagemagick are installed
read -p "Enter string to be displayed as a QR code : " value
echo -n "${value}" | qrencode --level=H --output=- --size=12 | display -
@gene1wood
gene1wood / SEP315.pdf
Last active Jun 13, 2019
SEP315 Slide Deck
View SEP315.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gene1wood
gene1wood / summary-of-J2M-forks.md
Created Jun 6, 2019
Summary of the forks of the J2M "Convert from JIRA text formatting to GitHub Flavored MarkDown and back again" project
View summary-of-J2M-forks.md
@gene1wood
gene1wood / persisted_json_and_yaml_dict.py
Created May 16, 2019
Python dict object which persists its contents to disk with every change, either in JSON or YAML
View persisted_json_and_yaml_dict.py
import collections, json
class PersistedJSONDict(collections.MutableMapping):
def __init__(self, filename, *args, **kwargs):
self.filename = filename
self.store = dict()
self.load()
self.update(dict(*args, **kwargs))
def __setitem__(self, key, value):
self.store[key] = value
@gene1wood
gene1wood / generate-list-of-aws-elb-ciphers.sh
Created May 8, 2019
All supported AWS Elastic Load Balancer (ELB)
View generate-list-of-aws-elb-ciphers.sh
aws elb describe-load-balancer-policies --query "PolicyDescriptions[?PolicyName=='ELBSample-ELBDefaultCipherPolicy'].PolicyAttributeDescriptions[*].AttributeName[]"
View gist:f0f827cd72dde3ec7a83abd16ef51d97
from authlib.flask.client import OAuth
if os.getenv("NO_AUTH", "False") == "False":
AUTH0_CALLBACK_URL = env.get(constants.AUTH0_CALLBACK_URL)
AUTH0_CLIENT_ID = env.get(constants.AUTH0_CLIENT_ID)
AUTH0_CLIENT_SECRET = env.get(constants.AUTH0_CLIENT_SECRET)
AUTH0_DOMAIN = env.get(constants.AUTH0_DOMAIN)
AUTH0_BASE_URL = "https://" + AUTH0_DOMAIN
AUTH0_AUDIENCE = env.get(constants.AUTH0_AUDIENCE)
if AUTH0_AUDIENCE is "":
@gene1wood
gene1wood / Makefile
Last active Apr 8, 2019
make example Makefile showing the order that targets are resolved
View Makefile
foraker: elbert rainier
@echo "foraker"
elbert:
@echo "elbert"
rainier: blanca
@echo "rainier"
blanca:
You can’t perform that action at this time.