Vault Plugin Auth Kerberos

[DEPRECATED] Plugin for Hashicorp Vault enabling Kerberos authentication
Alternatives To Vault Plugin Auth Kerberos
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Nomad13,381103291an hour ago753September 14, 20221,423mpl-2.0Go
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
Consul Template4,61515583 days ago118August 18, 2022142mpl-2.0Go
Template rendering, notifier, and supervisor for @HashiCorp Consul and Vault data.
22 days ago2May 05, 201813agpl-3.0Go
High performance, distributed and low latency publish-subscribe platform.
Kubernetes External Secrets2,589
10 months ago10mitJavaScript
Integrate external secret management systems with Kubernetes
Gomplate2,111327 hours ago81September 13, 202231mitGo
A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
6 days ago41July 19, 202229mpl-2.0Go
Launch a subprocess with environment variables using data from @HashiCorp Consul and Vault.
15 days ago37apache-2.0Go
Cloud native secrets management for developers - never leave your command line for secrets.
Vault Ui1,299
5 years ago3October 04, 201750otherJavaScript
Vault-UI — A beautiful UI to manage your Vault, written in React
Hvac1,0721921159 days ago61September 23, 2021138apache-2.0Python
:lock: Python 3.X client for HashiCorp Vault
Vault Guides936
12 days ago4April 06, 202157mpl-2.0Shell
Example usage of HashiCorp Vault secrets management
Alternatives To Vault Plugin Auth Kerberos
Select To Compare

Alternative Project Comparisons

[DEPRECATED] Vault Plugin: Kerberos Auth Backend

⚠️ This repo is no longer maintained: It has been taken over by Hashicorp as an official plugin which you can find here

This is a standalone backend plugin for use with Hashicorp Vault. This plugin allows for users to authenticate with Vault via Kerberos/SPNEGO.

You can find binaries on the Release page.



You can authenticate by posting a valid SPNEGO Negotiate header to /v1/auth/kerberos/login.

    import kerberos
    import winkerberos as kerberos
import requests

service = "HTTP/vault.domain"
rc, vc = kerberos.authGSSClientInit(service=service, mech_oid=kerberos.GSS_MECH_OID_SPNEGO)
kerberos.authGSSClientStep(vc, "")
kerberos_token = kerberos.authGSSClientResponse(vc)

r ="https://vault.domain:8200/v1/auth/kerberos/login",
                  json={'authorization': 'Negotiate ' + kerberos_token})
print('Vault token:', r.json()['auth']['client_token'])


  1. Install and register the plugin.

Put the plugin binary (vault-plugin-auth-kerberos) into a location of your choice. This directory will be specified as the plugin_directory in the Vault config used to start the server.

plugin_directory = "path/to/plugin/directory"
$ vault write sys/plugins/catalog/auth/kerberos sha_256="$(shasum -a 256 'vault-plugin-auth-kerberos' | cut -d ' ' -f1)" command="vault-plugin-auth-kerberos -client-cert server.crt -client-key server.key"
  1. Enable the Kerberos auth method:
$ vault auth enable -passthrough-request-headers=Authorization -allowed-response-headers=www-authenticate kerberos
Success! Enabled kerberos auth method at: kerberos/
  1. Use the /config endpoint to configure Kerberos.

Create a keytab for the kerberos plugin:

$ ktutil
ktutil:  addent -password -p [email protected] -e aes256-cts -k 1
Password for [email protected]:
ktutil:  list -e
slot KVNO Principal
---- ---- ---------------------------------------------------------------------
   1    1            [email protected] (aes256-cts-hmac-sha1-96)
ktutil:  wkt vault.keytab

The KVNO (-k 1) should match the KVNO of the service account. An error will show in the vault logs if this is incorrect.

Different encryption types can also be added to the keytab, for example -e rc4-hmac with additional addent commands.

Then base64 encode it:

base64 vault.keytab > vault.keytab.base64
vault write auth/kerberos/config [email protected] service_account="your_service_account"
  1. Add a SPNs (Service Principal Names) to your KDC for your service and service account. This should map the vault service to the account it is running as:
# for Windows/Active Directory
setspn.exe -U -S HTTP/vault.domain:8200 your_service_account
setspn.exe -U -S HTTP/vault.domain your_service_account
  1. Configure LDAP backend to look up Vault policies. Configuration for LDAP is identical to the LDAP auth method, but writing to to the Kerberos endpoint:
vault write auth/kerberos/config/ldap @vault-config/auth/ldap/config
vault write auth/kerberos/groups/example-role @vault-config/auth/ldap/groups/example-role

In non-kerberos mode, the LDAP bind and lookup works via the user that is currently trying to authenticate. If you're running LDAP together with Kerberos you might want to set a binddn/bindpass in the ldap config.


If you wish to work on this plugin, you'll first need Go installed on your machine.

For local dev first make sure Go is properly installed, including setting up a GOPATH. Next, clone this repository into $GOPATH/src/ You can then download any required build tools by bootstrapping your environment:

$ make bootstrap

To compile a development version of this plugin, run make or make dev. This will put the plugin binary in the bin and $GOPATH/bin folders. dev mode will only generate the binary for your platform and is faster:

$ make
$ make dev

Put the plugin binary into a location of your choice. This directory will be specified as the plugin_directory in the Vault config used to start the server.

plugin_directory = "path/to/plugin/directory"

Start a Vault server with this config file:

$ vault server -config=path/to/config.json ...

Once the server is started, register the plugin in the Vault server's plugin catalog:

$ vault write sys/plugins/catalog/kerberos \
        sha_256=<expected SHA256 Hex value of the plugin binary> \
Success! Data written to: sys/plugins/catalog/kerberos

Note you should generate a new sha256 checksum if you have made changes to the plugin. Example using openssl:

openssl dgst -sha256 $GOPATH/vault-plugin-auth-kerberos
SHA256(.../go/bin/vault-plugin-auth-kerberos)= 896c13c0f5305daed381952a128322e02bc28a57d0c862a78cbc2ea66e8c6fa1

Enable the auth plugin backend using the Kerberos auth plugin:

$ vault auth-enable -plugin-name='kerberos' plugin

Successfully enabled 'plugin' at 'kerberos'!


If you are developing this plugin and want to verify it is still functioning (and you haven't broken anything else), we recommend running the tests.

To run the tests, invoke make test:

$ make test

You can also specify a TESTARGS variable to filter tests like so:

$ make test TESTARGS='--run=TestConfig'
Popular Vault Projects
Popular Hashicorp Projects
Popular Security Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.