This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Search HashiCorp Vault for a Secret Value, Traversing all Nested namespaces | |
# | |
########################################################################## | |
# DISCLAIMER: THIS SCRIPT IS PROVIDED STRICTLY AS A PROOF OF CONCEPT. | |
# EXECUTING THIS SCRIPT ASSUMES ALL LIABILITY. | |
########################################################################## | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packer { | |
required_plugins { | |
amazon = { | |
version = ">= 1.0.1" | |
source = "github.com/hashicorp/amazon" | |
} | |
} | |
} | |
data "amazon-ami" "ubuntu-server-east" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import sys | |
from datetime import datetime | |
# Configurable variables | |
archivist_api_token = os.getenv('ARCHIVIST_API_TOKEN') | |
archivist_host = os.getenv('ARCHIVIST_HOST') | |
# Function to sanitize file name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ensure VAULT_ADDR and VAULT_TOKEN are exported. | |
# Ensure VAULT_NAMESPACE is unset | |
# Function to list namespaces recursively | |
function list_namespaces { | |
entry_point=$(echo ${1} | sed 's/\/$//') | |
echo "${entry_point}/" | |
## first, check if root ns, and if so collect children slightly differently due to path specification |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Terraform Enterprise/Cloud - List All Workspaces in All Organizations | |
# | |
#------------------------------------------ | |
# DESCRIPTION | |
#------------------------------------------ | |
# This script will list all workspaces in all organizations visible to the user for which the TFE_TOKEN was generated | |
# | |
#------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First passing argument is the depth | |
# The second passing argument is the starting namespace | |
# Example usage to list namespaces 10 levels deep from the "root" namespace: | |
# ./vault_recursive_namespace_list.sh 10 | |
# Example usage to list namespaces 5 levels deep from the "customer1" namespace. | |
# ./vault_recursive_namespace_list.sh 5 customer1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This policy uses the tfconfig/v2 import to deny resources | |
# from an denied list | |
# Import common-functions/tfconfig-functions/tfconfig-functions.sentinel | |
# with alias "config" | |
import "tfconfig-functions" as config | |
# List of denied resources | |
denied_list = ["aws_instance", "azurerm_virtualmachine", "google_compute_instance"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Quick and dirty script that wraps around the TFX CLI tool to list all Workspaces within an Orgainzation, and then list all remote state | |
# sharing for each Workspace. | |
# | |
# Acquire tfx here: https://tfx.rocks/ | |
# TFX can be configured using environment variables TFE_HOSTNAME, TFE_ORGANIZATION, TFE_TOKEN | |
# | |
export TFE_HOSTNAME="app.terraform.io" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#export VAULT_TOKEN="<root>" | |
export NS="TEST-NAMESPACE" | |
echo "--- Creating namespace" | |
vault namespace create $NS | |
echo "--- Enable approle auth within namespace" | |
vault auth enable -namespace=$NS approle | |
# create policy | |
echo "--- Writing ns-admin policy" | |
echo '# Read TEST-NAMESPACE Namespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
; Inspiration / Code Jacked from the following resources: | |
; https://www.reddit.com/r/windowsporn/comments/x6299x/a_small_effect_on_window_switching/ | |
; https://superuser.com/questions/1190658/fine-tune-this-red-border-around-active-window-ahk-script/1191059#1191059?newreg=d3acdcdab8714e76a5efeca9996e792f | |
; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=110505 | |
; https://discord.com/channels/898554690126630914/898556726108901386/1053662963585781760 # Komorebi Discord | |
; | |
#NoEnv | |
#SingleInstance, Force |
NewerOlder