Skip to content

Instantly share code, notes, and snippets.

💭
// , ALWAYS serious at http://basanese.com

Nathan Basanese v6

💭
// , ALWAYS serious at http://basanese.com
View GitHub Profile
View business-hrs.sentinel
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 {
View Vault Quantum Resistance
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 Oct 30, 2018
// , Nathan's Vagrantfile for a Disposable Simple Consul server for ACL troubleshooting
View Vagrantfile
# -*- 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 Oct 24, 2018
// , Shows how to "conveniently" map AD groups to Vault Policies.
View ldap_grouper_usage.txt
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 Sep 20, 2018
// , Install Vault on Mac OSX
View latestvaultosx.sh
#!/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 / dontgochasing.sh
Last active Aug 29, 2018
// , Cool Waterfalls for hacker-ey-lookin goodniss
View dontgochasing.sh
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 Aug 10, 2018
// , Set up a virtual environment and run Vault on it. Run these one by one, no idea how they behave as a script
View vault_on_a_centos_vagrant_vm.md

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 Aug 9, 2018
// , convert_hcl_vault_policy_to_json.sh converts a Vault Policy in HashiCorp Language format to the Single line JSON format.
View convert_hcl_vault_policy_to_json.sh
#!/usr/bin/env bash
## tr -d '\n' |
##
## Behold.
##
## ______ _____ _ _ _____ _ ______
## | ___ \ ___| | | | _ | | | _ \
## | |_/ / |__ | |_| | | | | | | | | |
## | ___ \ __|| _ | | | | | | | | |
## | |_/ / |___| | | \ \_/ / |___| |/ /
@v6
v6 / vault_on_an_ubuntu_vagrant.md
Last active Aug 17, 2018
// , Short description of an installation of Vault 0.10.1 on an Ubuntu 18.04 Vagrant box
View vault_on_an_ubuntu_vagrant.md

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

@v6
v6 / mathinator.py
Created Aug 1, 2017
// , Want to sound like you know mathematics?
View mathinator.py
#!/bin/python3
import random
print("Hello?")
nouns = ["plane", "planar coefficients", "structure", "disphrenials", "altcurve", "discontinuity", "conjecture", "aliter", "transport of structure", "isomorphism", "algebraic system"]
adjectives = ["argand", "Euler", "Eilenberg", "arbitrarily prime", "coprime", "genefinite", "modulo out by", "well-defined", "sufficiently nice"]
You can’t perform that action at this time.