vault-plugin-headscale

command module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 5 Imported by: 0

README

vault-plugin-headscale

Secret engine to create/remove users and generate preauthkey from a Headscale control plane from Hashicorp Vault

Build

The plugin is a Go binary, built using the repo's Makefile. Binary is generated in \bin

make build

Installation

Follow Vault documentation to enable this plugin on your Vault cluster.

For tests purpose, the plugin is built and added to a developpment Docker image (see docker file) A docker-compose file is provided to run a headscale server and a vault server. The plugin is loaded as a development plugin in the test scenario.

The Makefile target make compose :

  • build the plugin
  • build the vault image with the plugin inside
  • spin the containers up
  • enable the Headscale plugin

Usage

Once the plugin leaded by Vault and enable at /headscale, here's how to configure and use it.

Generate Headscale access key
export HEADSCALE_API_KEY=$(docker exec headscale headscale apikey create -o yaml)
Configure secret engine
export VAULT_ADDR=http://127.0.0.1:8200
export VAULT_TOKEN=root
export HEADSCALE_API_URL="http://headscale:8080"
vault write headscale/config/access api_key="${HEADSCALE_API_KEY}" api_url="${HEADSCALE_API_URL}"
vault read headscale/config/access
Create a user
vault write headscale/user/ name=foo
Get a user
vault read headscale/user/foo 
Generate a key
vault read headscale/creds/foo \
 ephemeral=true \
 reusable=true \
 tags=hello,world \
 expiration=2024-01-01T00:00:00Z

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL