Categorygithub.com/mywordpress-io/caddy-vault-storage
modulepackage
0.1.1
Repository: https://github.com/mywordpress-io/caddy-vault-storage.git
Documentation: pkg.go.dev

# README

caddy-vault-storage

This is a Storage backend for Caddy (CertMagic) which allows storing of TLS certificates managed by Caddy in HashiCorp's Vault.

This plugin can be pulled in via Caddy's build system--to review the CertMagic Storage implementation, review the associated repo here: https://github.com/mywordpress-io/certmagic-vault-storage

Usage

Build

Build Caddy using xcaddy with the vault storage plugins:

  • xcaddy build --output bin/caddy --with github.com/mywordpress-io/caddy-vault-storage@<tag> --with github.com/mywordpress-io/certmagic-vault-storage@<tag>

Config

Once built, use the following config block to communicate with Vault:

vault <address> {
    token <value>

    approle_login_path <value>
    approle_logout_path <value>
    approle_role_id <value>
    approle_secret_id <value>

    secrets_path <value>
    path_prefix <value>

    insecure_skip_verify <value>

    lock_timeout <value>
    lock_polling_interval <value>
}

For more information, review Caddyfile.example and Caddyfile.json.

Either 'address' + 'token' -OR- 'address' + 'approle_role_id'+'approle_secret_id' settings are required:

  • If using 'approle' authentication, short-lived tokens are managed on the fly.
  • If using 'token' authentication, management of the token (renewal, revocation, etc.) is up to the caller.
NameTypeRequired?DescriptionDefault
addressurlyesVault address URL-
tokenstringconditionallyVault static Token to authenticate (this or approle_role_id+approle_secret_id are required)-
approle_login_pathstringnoLogin path for approle authenticationauth/approle/login
approle_logout_pathstringnoLogout path for approle authenticationauth/token/revoke-self
approle_role_idstringconditionallyApprole RoleID value for authentication (required if 'token' empty)-
approle_secret_idstringconditionallyApprole SecretID value for authentication (required if 'token' empty)-
secrets_pathstringyesBase path to secrets (KV-V2) mount in Vault-
path_prefixstringnoPrefix path in the KV-V2 mount in Vault-
insecure_skip_verifyboolnoDisable verification of TLS certificate when communicating with Vaultfalse
lock_timeoutdurationnoStorage lock timeout duration5m
lock_polling_intervaldurationnoStorage lock polling interval5s

Additional Help

Report any problems or questions with the plugin using a GitHub issue.

# Structs

No description provided by the author