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
provider: | |
name: aws | |
runtime: python3.7 | |
stage: ${opt:stage, 'default'} | |
region: ${file(../infra/terraform.tfvars.json):aws_region.${self:provider.stage}} |
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
{ | |
"app_name" : "cert-transparency", | |
"aws_region": { | |
"default" : "us-east-1", | |
"dev" : "ap-southeast-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
custom: | |
dbTempName: ${ssm:/${self:service.name}/${self:provider.stage}/dynamodb_temp_table} | |
dbTempArn: ${ssm:/${self:service.name}/${self:provider.stage}/dynamodb_temp_table_arn} | |
functions: | |
query_logs: | |
description: Query the certs from the Certificate Transparency Logs | |
handler: query_logs.query_to_db | |
environment: | |
db_table_name: ${self:custom.dbTempName} |
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
resource "aws_ssm_parameter" "ssm_dynamodb_temp_table" { | |
type = "String" | |
description = "Name of DynamoDB Temp Table" | |
name = "/${var.app_name}/${terraform.workspace}/dynamodb_temp_table" | |
value = "${aws_dynamodb_table.dynamodb_temp.name}" | |
overwrite = true | |
} | |
resource "aws_ssm_parameter" "ssm_dynamodb_temp_table_arn" { | |
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
resource "aws_s3_bucket" "s3bucket_domains" { | |
bucket = "${lookup(var.s3bucket_domains, terraform.workspace)}" | |
acl = "private" | |
force_destroy = false # prevent terraform from deleting this bucket if it has objects inside | |
} |
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
{ | |
"app_name" : "cert-transparency", | |
"s3bucket_domains": { | |
"default" : "cert-domains", | |
"dev" : "cert-domains-dev" | |
}, | |
"dynamodb_temp": { | |
"default": "cert-domains", | |
"dev": "cert-domains-dev" | |
} |
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
a2p | |
addr2line | |
animate | |
appletviewer8 | |
ar | |
as | |
aserver | |
awk | |
base64 | |
bashbug |
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 | |
# if you use a separate profile for layers | |
session = boto3.Session(profile_name='LayerUploader') | |
regions = ['ap-northeast-1', 'ap-northeast-2', 'ap-south-1', | |
'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', | |
'eu-central-1', 'eu-north-1', 'eu-west-1', | |
'eu-west-2', 'eu-west-3', 'sa-east-1', | |
'us-east-1', 'us-east-2','us-west-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
const hash = '$2b$12$HcE9WPecLL0IxfWr2om3W.tBWxJTLAd.xpLWDz43oKaqfbxtnUTKm' | |
for (i = 0; i < 500; i++) { | |
const myPlaintextPassword = i.toString() | |
bcrypt.compare(myPlaintextPassword , hash, function(err, res) { | |
console.log(myPlaintextPassword) | |
}) | |
} |
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 json | |
import hmac | |
import hashlib | |
from botocore.exceptions import ClientError | |
headers = {'Access-Control-Allow-Origin': '*'} # CORS | |
def get_secret(): |