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 | |
| import logging | |
| import click | |
| from urllib.parse import urlparse | |
| @click.command() | |
| @click.option('--iplist', prompt='Location of the IP list in S3', help='A file with a CIDR per line of trusted IPs (only TXT supported for now)') | |
| @click.option('--name', default='KnownIPs', prompt='Name', help='Name of the threat list') | |
| def update_threat_list(iplist, name): | |
| if not valid_list(iplist): |
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
| use std::fs::File; | |
| use std::io::{self, BufRead}; | |
| use std::path::Path; | |
| use rand::{thread_rng, Rng}; | |
| use std::collections::HashSet; | |
| use trie_rs::TrieBuilder; | |
| // A silly program that finds words in a single word anagram using brute-force | |
| // We use a data structure called a Trie: https://en.wikipedia.org/wiki/Trie | |
| // to store a dictionary of words |
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
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: | | |
| Creates an IAM role with a fixed set of parameters | |
| Parameters: | |
| RoleName: | |
| Type: String | |
| Description: Name of the role you want to create | |
| EC2Policy: | |
| Type: String |
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
| # Use imagemagick convert for this | |
| # Flop flips an image around the X axis (i.e. mirror image) | |
| convert -flop yourimage.png yourimageflop.png | |
| # Make it loopy | |
| convert -loop 0 -delay 100 yourimage.png yourimageflop.png out.gif |
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
| # Source these to pretend you're running in AWS Lambda | |
| # Tested on Linux, might work on OSX | |
| AWS_EXECUTION_ENV=AWS_Lambda_python2.7 | |
| _HANDLER=handler | |
| FUNCTION_SHIELD_TOKEN='base64encoded token you can get from puresec' | |
| # you will also need to create a dir for the function code under /var | |
| # mkdir -p /var/task && ln <fullpath to your the file above> /var/task/handler.py |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "github.com/aws/aws-sdk-go-v2/aws" | |
| "github.com/aws/aws-sdk-go-v2/aws/external" | |
| "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" | |
| ) |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| "github.com/aws/aws-sdk-go/service/cloudwatchlogs" | |
| ) |
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
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "time" | |
| "github.com/aws/aws-sdk-go-v2/aws" | |
| "github.com/aws/aws-sdk-go-v2/aws/external" |
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
| package main | |
| import ( | |
| "log" | |
| "github.com/awslabs/goformation" | |
| ) | |
| func main() { |
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
| package cmd | |
| import ( | |
| "bytes" | |
| "encoding/binary" | |
| "fmt" | |
| "io" | |
| "log" | |
| "github.com/fatih/structs" |