Skip to content
Hands-on IT IT Drills

Day 0: Setting Up the Training Ground

Goal: All tools run, ~/bao-lab is in place. · Duration: approx. 20 min · Prerequisite: none

Briefing

  • Part A (Days 1–6) only needs bao, curl and jq.
  • Part B (Days 7–14) additionally needs Docker, kind, kubectl, helm and OpenSSL 3.
  • The book is tested with OpenBao v2.7.1. Newer versions usually work the same way.
  • The CLI is called bao, not vault. Its environment variables start with BAO_.

Drill 1: Install the Tools

macOS with Homebrew:

brew install openbao kind kubectl helm jq openssl@3
OSSL=$(brew --prefix openssl@3)/bin
echo "export PATH=\"$OSSL:\$PATH\"" >> ~/.zshrc   # before /usr/bin/openssl
export PATH="$OSSL:$PATH"
brew list --versions openbao kind kubernetes-cli helm jq openssl@3

Expected (versions may differ):

helm 4.1.1
jq 1.8.2
kind 0.32.0
kubernetes-cli 1.36.3
openbao 2.7.1
openssl@3 3.6.4

Why openssl@3? macOS ships LibreSSL at /usr/bin/openssl. It does not know options used on Day 7 and Day 14. Homebrew does not put openssl@3 on the PATH, hence the entry in ~/.zshrc.

Linux: Download bao as a .deb, .rpm or binary from the official v2.7.1 release at https://github.com/openbao/openbao/releases/tag/v2.7.1. You get kind, kubectl and helm from their official release pages, and jq and openssl from your distribution’s package manager. Day 14, Scenario 7 needs OpenSSL 3.4 or newer.

Warning: Homebrew always installs the current version. If an output in the book differs, check bao version first.

Save your progress? Sign up for free

Drill 2: Check the Versions

bao version
kind version
kubectl version --client
helm version --short
jq --version
openssl version

Expected:

OpenBao v2.7.1 (a5db72ce...), committed 2026-10-01T15:32:54Z
kind v0.32.0 go1.26.3 darwin/arm64
Client Version: v1.36.3
Kustomize Version: v5.8.1
v4.1.1+g5caf004
jq-1.8.2
OpenSSL 3.6.4 25 Aug 2026 (Library: OpenSSL 3.6.4 25 Aug 2026)

If openssl version shows LibreSSL, the PATH entry from Drill 1 is missing.

Save your progress? Sign up for free

Drill 3: Docker Check

docker version --format '{{.Client.Version}} / {{.Server.Version}}'
docker info >/dev/null 2>&1 && echo "Docker läuft" || echo "Docker-Daemon fehlt"

Expected (may differ depending on version):

29.2.1 / 29.2.1
Docker läuft

If Cannot connect to the Docker daemon appears, start Docker Desktop or Colima. For Part A, Docker is not needed until Day 4.

Save your progress? Sign up for free

Drill 4: Create the Working Directory

mkdir -p ~/bao-lab/{tag01,tag02,tag03,tag04,tag05,tag06,tls,k8s}
ls ~/bao-lab

Expected:

k8s
tag01
tag02
...
tls

Save your progress? Sign up for free

Drill 5: Shell Helpers

Append the helpers to ~/.zshrc or ~/.bashrc:

cat >> ~/.zshrc <<'EOF'
# --- OpenBao lab ---
alias bdev='bao server -dev -dev-root-token-id=root'
labenv() { export BAO_ADDR=http://127.0.0.1:8200 BAO_TOKEN=root; }
alias bwho='bao token lookup -format=json | jq -c ".data | {display_name, policies, ttl}"'
EOF
source ~/.zshrc
bao -autocomplete-install

Why? bdev starts the dev server with the fixed root token root (lab only!). labenv sets the environment in every new terminal. With bwho you see at once who you are acting as.

Test the helpers: In the first terminal, start the server with bdev. Then in the second terminal:

labenv && bwho

Expected:

{"display_name":"token","policies":["root"],"ttl":0}

Stop the server afterwards with Ctrl+C.

Save your progress? Sign up for free

Checkpoint

for t in bao kind kubectl helm jq curl docker; do
  command -v "$t" >/dev/null && echo "✔ $t" || echo "✘ $t fehlt"
done
[ -d ~/bao-lab/k8s ] && echo "✔ ~/bao-lab" || echo "✘ ~/bao-lab fehlt"
docker info >/dev/null 2>&1 && echo "✔ Docker-Daemon" || echo "✘ Docker-Daemon"
openssl version | grep -q '^OpenSSL 3' && echo "✔ OpenSSL 3" || echo "✘ OpenSSL 3"
type labenv >/dev/null 2>&1 && echo "✔ labenv" || echo "✘ labenv"

Challenge

Write a shell function baoup. It should start the dev server in the background, write the log to ~/bao-lab/dev.log and wait until bao status succeeds.

Hint: bao status returns exit code 0 when the server is reachable and unsealed.

Solution

baoup() {
  bao server -dev -dev-root-token-id=root > ~/bao-lab/dev.log 2>&1 &
  export BAO_ADDR=http://127.0.0.1:8200 BAO_TOKEN=root
  until bao status >/dev/null 2>&1; do sleep 0.5; done
  echo "OpenBao bereit (PID $!)"
}

To stop it: kill %1 or pkill -f "bao server -dev".

Save your progress? Sign up for free

Enterprise Note

  • Pin the CLI and server versions across the team, for example with mise or asdf.
  • Verify the checksums and signatures of the releases before you distribute binaries.
  • BAO_TOKEN never belongs in ~/.zshrc. The root token root exists only in the lab.
  • For production: a package repository or a container image from a vetted internal registry.