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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Cognito Stack | |
Parameters: | |
AuthName: | |
Type: String | |
Description: Unique Auth Name for Cognito Resources | |
Resources: | |
# Creates a role that allows Cognito to send SNS messages |
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
#!/usr/bin/env python | |
import slackweb | |
import argparse | |
def notify(): | |
parser = argparse.ArgumentParser(description='slack notification script') | |
parser.add_argument('--webhook_url', help='incoming webhook url', required=True) | |
parser.add_argument('--verdict', help='pass or fail', default='pass') |
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
''' | |
Follow these steps to configure the webhook in Slack: | |
1. Navigate to https://<your-team-domain>.slack.com/services/new | |
2. Search for and select "Incoming WebHooks". | |
3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration". | |
4. Copy the webhook URL from the setup instructions and use it in the next section. |
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 datetime | |
import json | |
config = boto3.client("config") | |
ec2 = boto3.client("ec2") | |
def evaluate_flowlog(vpc_id): | |
response = ec2.describe_flow_logs( | |
Filter=[ |
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 logging | |
from datetime import * | |
#setup simple logging for INFO | |
logger = logging.getLogger() | |
logger.setLevel(logging.WARNING) | |
#define the connection | |
ec2 = boto3.resource('ec2', region_name="us-west-2") |
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
#!/usr/bin/env python | |
# | |
# Author: Nick Skitch | |
# For Tagging Compliance. | |
prog_desc = "Evaluation of AWS EC2 instances for tag compliance. If dryrun false, will add non_compliant_tag key tag with value \ | |
of missing required tags. WIP." | |
import boto3 | |
import json | |
import argparse |
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 hashlib | |
import boto3 | |
import time | |
## CONFIG ## | |
BUCKET = 'bucket-name' | |
FILEPATH = 'hashes' | |
SEP = '\t' | |
def log(metric_name, metric_type='count', metric_value=1, tags=[]): |
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
''' | |
This is an example of the server-side logic to handle slash commands in | |
Python with Flask. | |
Detailed documentation of Slack slash commands: | |
https://api.slack.com/slash-commands | |
Slash commands style guide: | |
https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c | |
''' |
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
#!/usr/bin/env bash | |
set -e | |
function usage() { | |
set -e | |
cat <<EOM | |
##### ecs-run ##### | |
Simple script for running tasks on Amazon Elastic Container Service | |
One of the following is required: | |
Required arguments: |
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
# -*- coding: utf-8 -*- | |
"""A simple tool to document how to control AWS resources. | |
AWS AUTHENTICATION | |
------------------- | |
In order to run any of the code below, you need a profile with AWS credentials | |
set up on your computer. It's very easy to do this. Google how to configure | |
your profile with boto3, or visit the docs: |