Skip to content

Instantly share code, notes, and snippets.

@hugobcar
hugobcar / Cf_analyserequests_Waf_PROD.js
Last active Mar 13, 2019
Instant block of attacks to AWS Websites using CloudFront + Lambda@Edge + DynamoDB + WAF
View Cf_analyserequests_Waf_PROD.js
'use strict';
var http = require('http');
// Load the SDK for JavaScript
const https = require('https');
var AWS = require('aws-sdk');
// Set the region
AWS.config.update({region: 'sa-east-1'});
@hugobcar
hugobcar / Insert_Waf_analyserequests_PROD.py
Last active Mar 13, 2019
Instant block of attacks to AWS Websites using CloudFront + Lambda@Edge + DynamoDB + WAF
View Insert_Waf_analyserequests_PROD.py
import json
import boto3
import math
import time
import datetime
import ipaddress
from boto3.dynamodb.conditions import Key, Attr
from os import environ
# Get the service resource.
View Purge_IPs_Waf_Dynamodb_PROD.py
import boto3
import math
import time
import datetime
import ipaddress
from boto3.dynamodb.conditions import Key, Attr
from os import environ
# Get the service resource.
dynamodb = boto3.resource('dynamodb', region_name=environ['DYNAMODB_REGION'])
You can’t perform that action at this time.