Skip to content

Instantly share code, notes, and snippets.

View v6's full-sized avatar
💭
// , ALWAYS serious at http://basanese.com

Nathan Basanese v6

💭
// , ALWAYS serious at http://basanese.com
View GitHub Profile
@v6
v6 / business-hrs.sentinel
Created November 18, 2019 18:17 — forked from rigelreyes/business-hrs.sentinel
Sentinel Test files
import "time"
# Expect requests to only happen during work days (Monday through Friday)
# 0 for Sunday and 6 for Saturday
workdays = rule {
time.now.weekday > 0 and time.now.weekday < 6
}
# Expect requests to only happen during work hours (7:00 am - 6:00 pm)
workhours = rule {
How would Vault's encryption handle attacks from quantum computers?
I've been researching HashiCorp Vault lately, and I really like that it uses strong cryptography for it's core security mechanisms.
https://www.vaultproject.io/docs/internals/security.html#external-threat-overview
I want to learn more about this, because it's interesting to discuss.
And it may end up affecting many security systems that rely on conventional mechanisms of cryptography in the future, as the technology advances and state actors begin to adopt it.
@v6
v6 / Vagrantfile
Created October 30, 2018 18:31
// , Nathan's Vagrantfile for a Disposable Simple Consul server for ACL troubleshooting
# -*- mode: ruby -*-
# vi: set ft=ruby :
 
echo "THIS WILL MAKE A VM WITH 1 CONSUL RUNNING IN SERVER MODE, AND ANOTHER RUNNING IN CLIENT MODE"
$script = <<SCRIPT
 
echo "Installing dependencies on the new VM created by Vagrant ..."
sudo apt-get update
sudo apt-get install -y unzip curl jq dnsutils
@v6
v6 / ldap_grouper_usage.txt
Created October 24, 2018 01:00
// , Shows how to "conveniently" map AD groups to Vault Policies.
super-duper-vault-train $ls
LICENSE initpayload.json
PRODUCTION_INSTALLATION.md instance7_consul_http_token.txt
README.md instance7_vault_consul_http_token.txt
Vagrantfile myunseal.sh
Vagrantfile.new playbooks
account.sh prereqs.sh
configureconsul.sh provision_consul
configurevault.sh provision_vault
consuldownload.sh vaultdownload.sh
@v6
v6 / latestvaultosx.sh
Last active September 20, 2018 20:32
// , Install Vault on Mac OSX
#!/usr/bin/env bash
## Install the latest Vault on a Mac.
## Run this as follows:
## bash <(curl -s https://gist.githubusercontent.com/v6/d7c1f40a25b5a12a469d76f7efb7733e/raw/59f0f5e4cc3bba4d01ce2c4099f8df0cee72d187/latestvaultosx.sh)
release="$(curl -s https://releases.hashicorp.com/vault/index.json|jq -r '.versions[].version'|grep -v 'beta\|rc' | grep '0.1' | tail -n 1)"
download="https://releases.hashicorp.com/vault/${release}/vault_${release}_darwin_amd64.zip"
echo "Vault Release: ${release}"
echo "Vault Download: ${download}"
@v6
v6 / convert-a-cert.sh
Last active March 3, 2022 18:03
Cert Generation History
openssl pkcs7 -inform DER -print_certs -in azwus-prd-hashi-vault001_prod_azwus_nathantech_com.p7b -out azwus-prd-hashi-vault001_prod_azwus_nathantech_com_stacked.cer
@v6
v6 / dontgochasing.sh
Last active August 29, 2018 23:24
// , Cool Waterfalls for hacker-ey-lookin goodniss
for a in $( seq 1 20 ); do for i in $( ls ); do tree; done; done
sudo tcpdump -qlp -i en0 | grep --color=auto -e '.*>'
brew install wireshark; sudo tshark --color
cat /dev/urandom
## Set a profile with courier new for the font, and 00ff27 for the foreground color before starting this BS
@v6
v6 / vault_on_a_centos_vagrant_vm.md
Last active August 10, 2018 04:33
// , Set up a virtual environment and run Vault on it. Run these one by one, no idea how they behave as a script

After I installed Vagrant from http://vagrantup.com/downloads.html, I used the following set of commands to make a Vagrant environment for testing Vault:

mkdir -p ~/proj/vaulttest/ ;  cd ~/proj/vaulttest/ ;  vagrant init bento/centos-7.5 ;  vagrant up  &&  vagrant ssh

After this, I checked to make sure I was on vagrant by looking at my command prompt for vagrant, and installed vault in my Vagrant machine:

wget https://releases.hashicorp.com/vault/0.10.1/vault_0.10.4_linux_amd64.zip  &&  ls  &&  sudo yum install -y unzip  &&  unzip vault_0.10.4_linux_amd64.zip  &&  sudo mv vault /usr/local/bin/vault  &&  vault -h
@v6
v6 / convert_hcl_vault_policy_to_json.sh
Created August 9, 2018 19:03
// , convert_hcl_vault_policy_to_json.sh converts a Vault Policy in HashiCorp Language format to the Single line JSON format.
#!/usr/bin/env bash
## tr -d '\n' |
##
## Behold.
##
## ______ _____ _ _ _____ _ ______
## | ___ \ ___| | | | _ | | | _ \
## | |_/ / |__ | |_| | | | | | | | | |
## | ___ \ __|| _ | | | | | | | | |
## | |_/ / |___| | | \ \_/ / |___| |/ /
@v6
v6 / vault_on_an_ubuntu_vagrant.md
Last active August 17, 2018 22:34
// , Short description of an installation of Vault 0.10.1 on an Ubuntu 18.04 Vagrant box

After I installed Vagrant from http://vagrantup.com/downloads.html, I used the following set of commands to make a Vagrant environment for testing Vault:

mkdir -p ~/proj/vaulttest/ ; cd ~/proj/vaulttest/ ; vagrant init ubuntu/bionic64 ; vagrant up && vagrant ssh

After this, I checked to make sure I was on vagrant by looking at my command prompt for vagrant, and installed vault in my Vagrant machine:

wget https://releases.hashicorp.com/vault/0.10.1/vault_0.10.1_linux_amd64.zip && ls && sudo apt-get install -y unzip && unzip vault_0.10.1_linux_amd64.zip && sudo mv vault /usr/local/bin/vault && vault -h