Skip to content

Instantly share code, notes, and snippets.

View BrooksCunningham's full-sized avatar

Brooks Cunningham BrooksCunningham

View GitHub Profile
@BrooksCunningham
BrooksCunningham / ngwaf_edge_deploy.go
Created November 9, 2023 14:41
Example of Fastly Next-Gen WAF edge deployment in go
package main
import (
"fmt"
"log"
"os"
"time"
sigsci "github.com/signalsciences/go-sigsci"
)
@BrooksCunningham
BrooksCunningham / get_sigsci_raw_logs.py
Created January 27, 2022 17:15
get logs from signal sciences
import requests, calendar, os, time
from datetime import datetime, timedelta
# For details see
# https://docs.fastly.com/signalsciences/developer/extract-your-data/
# Get environment variables
SIGSCITOKEN = os.getenv('SIGSCITOKEN')
SIGSCIEMAIL = os.environ.get('SIGSCIEMAIL')
@BrooksCunningham
BrooksCunningham / edge_rate_limiting.vcl
Created November 18, 2021 22:37
Edge Rate Limiting Response Enrichment
# Snippet rate-limiter-v1-origin_waf_response-init-init : 100
# Begin rate-limiter webbots - Next Gen WAF Response
penaltybox rl_origin_waf_response_pb {}
ratecounter rl_origin_waf_response_rc {}
table rl_origin_waf_response_methods {
"GET": "true",
"PUT": "true",
"TRACE": "true",
"POST": "true",
@BrooksCunningham
BrooksCunningham / get_sigsci_custom_tags.py
Created October 12, 2021 17:01
print the custom tags for a site/workspace
from SigSci import *
import os
import json
# setup sigsci api module
sigsci = SigSciAPI()
# required variables
sigsci.email = os.environ['SIGSCI_EMAIL']
@BrooksCunningham
BrooksCunningham / fastly.toml
Last active November 22, 2021 14:38
Example fastly.toml for local compute@edge development
[local_server]
[local_server.backends]
[local_server.backends.httpbin]
url = "https://httpbin.org"
[local_server.backends.google_dns]
url = "https://dns.google"

Keybase proof

I hereby claim:

  • I am brookscunningham on github.
  • I am bcunning (https://keybase.io/bcunning) on keybase.
  • I have a public key ASBfia5ViKw9TWkHHTPYA__g8t0E8ti_YQ_djlwObHJC0wo

To claim this, I am signing this object: