Skip to content

Local Vault cluster: Compose auto-init, auto-unseal, and tenant isolation - #1

Open
amitslog wants to merge 8 commits into
masterfrom
develop
Open

Local Vault cluster: Compose auto-init, auto-unseal, and tenant isolation#1
amitslog wants to merge 8 commits into
masterfrom
develop

Conversation

@amitslog

@amitslog amitslog commented Aug 21, 2026

Copy link
Copy Markdown

Summary

Local Docker Compose target for a tenant-isolated Vault CE cluster. One command on a dev machine: ./setup.sh.

  • First run initializes a persistent Shamir Vault (5/3).
  • Later starts and container restarts unseal through a Compose sidecar. No manual unseal.
  • This is laptop Shamir automation, not production KMS.
  • Isolation is path and ACL based at kv/customers/{tenant}/*. Not Enterprise namespaces.
  • Dynamic Postgres credentials are optional (./setup.sh --with-credentials).
  • aws/, gcp/, and azure/ are placeholders only. No Terraform yet.

Operator, architecture, DR, and break-glass docs live in README.md.

What is in this branch

  • setup.sh / local/: Compose, unseal sidecar, health, stop, reset
  • config/ scripts/: policies, AppRole, KV v2, tenant onboard/offboard
  • tests/: isolation and credentials conformance
  • README.md: how to run, isolation, backup/restore, break-glass

Test plan

  • ./setup.sh (isolation only: Vault + unseal, no Postgres)
  • ./tests/run-conformance.sh --layer isolation
  • ./local/tests/runtime-test.sh (restart keeps data, sidecar unseals)
  • ./setup.sh --with-credentials
  • ./tests/run-conformance.sh --layer all (zero leftover v-* roles)

@amitslog
amitslog requested a review from BSick7 August 22, 2026 18:29

@BSick7 BSick7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really good start.
I think we should do a few things:

  • create a go library rather than a federation of bash scripts
  • build tests using go; wind down the CI to be simpler and be able to run tests locally
  • package a vault utils docker image that is maintained in this repo containing all bootstrap utils
  • adjust the docker compose to execute this bootstrap as a one time execution

Comment thread README.md Outdated
amitslog and others added 3 commits August 24, 2026 18:29
Co-authored-by: Brad Sickles <brad.sickles@gmail.com>
* Replace local Shamir sidecar with a vault-utils one-shot

Move bootstrap into a Go library and CLI so isolation can be tested with
go test (HTTP 403), and Compose unseal is a one-shot instead of a
long-running sidecar.

* Start Postgres from .env and drop extra comments

./setup.sh was skipping Postgres when credentials were already enabled
in .env, so bootstrap failed looking up the database host.

* Fix isolation CI: use docker run stdout as the container ID

Image pull noise on stderr was mixed into CombinedOutput, so docker port
failed on GitHub Actions.

* Trim comments and replace em dashes

Keep operator-facing behavior. Drop essay comments from Compose, CI, and
local scripts.

* Align local bootstrap with vault-utils as the only path

Compose runs bootstrap once by default. CI isolation is go test.
tenant-offboard is in the image. Remove the bash sidecar and bash
local bootstrap scripts.

* Move shared trees under internal/ and local/, and stop treating local-dev passwords as Vault -dev.

* Remove bash bootstrap and mirrored scripts, and run lint and conformance as Go tests.

Vault bootstrap is only vault-utils. Compose keeps setup, snapshot, and reset. Isolation then credentials no longer 404s on database roles.

* Restructure vault-utils into subcommands with a pluggable key store

Bootstrap only initializes a cluster (init, unseal, configure, tokens,
revoke root) and persists key material through a KeyStore interface so
cloud platforms can plug in secret managers. Tenants are created
explicitly with tenants create. Policy templates use Go text/template.
compose.yml carries inline digest-pinned images. Snapshot take, list,
verify, and restore move from bash into the binary.

* Removed scripts, dropped postgres

* Remove the shellcheck CI job; no shell scripts remain

---------

Co-authored-by: Brad Sickles <brad.sickles@gmail.com>
* Add aws-vault-ec2-cluster connections, IAM, and security groups.

This is the Nullstone AWS module skeleton so a workspace can attach VPC, snapshot S3, and unseal KMS before ASG and NLB work.

* Address review: rename and relocate aws-ec2-vault-cluster.

Move the module under aws/aws-ec2-vault-cluster so naming matches other Nullstone AWS modules, and apply the connection and variable comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants