Skip to content

Instantly share code, notes, and snippets.

View Piccirello's full-sized avatar

Thomas Piccirello Piccirello

View GitHub Profile
@Piccirello
Piccirello / github-secret-scanning-signature-verification.js
Last active February 25, 2021 20:27
Node 14 code to verify the signature from a GitHub secret scanning alert
const crypto = require("crypto");
const axios = require("axios");
const GITHUB_KEYS_URI = "https://api.github.com/meta/public_keys/secret_scanning";
/**
* Verify a payload and signature against a public key
* @param {String} payload the value to verify
* @param {String} signature the expected value
* @param {String} keyID the id of the key used to generated the signature
@Piccirello
Piccirello / aws-bucket-policy-get-object.json
Created July 31, 2020 10:05
AWS Bucket policy to grant public 'Get' access
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::REPLACE_ME_WITH_BUCKET_NAME/*"
}

Keybase proof

I hereby claim:

  • I am piccirello on github.
  • I am piccirello (https://keybase.io/piccirello) on keybase.
  • I have a public key ASDnvAHG4gXyzo2o_o0XRRAaZshjd59ZMUOweEuMC8CuRAo

To claim this, I am signing this object:

@Piccirello
Piccirello / copyDatastoreEntities.js
Created March 27, 2019 12:26
Copy Google Cloud Datastore entities to a new project and/or namespace
/*
Copy Google Cloud Datastore entities to a new project and/or namespace.
This script compares the contents of the new datastore against the original
datastore to verify the copy was successful.
inspired by https://gist.github.com/tarunbhardwaj/f17b2451869a1ee588679c8464b40755
*/
const { Datastore } = require('@google-cloud/datastore');