22[ ![ Travis Build Status] ( https://travis-ci.org/wintoncode/vault-plugin-auth-kerberos.svg?branch=master )] ( https://travis-ci.org/wintoncode/vault-plugin-auth-kerberos )
33
44This is a standalone backend plugin for use with [ Hashicorp Vault] ( https://www.github.com/hashicorp/vault ) .
5- This plugin allows for users to authenticate with Vault via Kerberos.
5+ This plugin allows for users to authenticate with Vault via Kerberos/SPNEGO .
66
77You can find binaries on the [ Release page] ( https://github.com/wintoncode/vault-plugin-auth-kerberos/releases ) .
88
@@ -19,7 +19,7 @@ except:
1919 import winkerberos as kerberos
2020import requests
2121
22- service = " HTTP/vault.domain@YOUR-REALM.COM "
22+ service = " HTTP/vault.domain"
2323rc, vc = kerberos.authGSSClientInit(service = service, mech_oid = kerberos.GSS_MECH_OID_SPNEGO )
2424kerberos.authGSSClientStep(vc, " " )
2525kerberos_token = kerberos.authGSSClientResponse(vc)
@@ -50,7 +50,7 @@ $ vault write sys/plugins/catalog/auth/kerberos sha_256="$(shasum -a 256 'vault-
50502 . Enable the Kerberos auth method:
5151
5252``` sh
53- $ vault auth enable -passthrough-request-headers=Authorization kerberos
53+ $ vault auth enable -passthrough-request-headers=Authorization -allowed-response-headers=www-authenticate kerberos
5454Success! Enabled kerberos auth method at: kerberos/
5555```
5656
@@ -68,6 +68,10 @@ slot KVNO Principal
6868ktutil: wkt vault.keytab
6969```
7070
71+ The KVNO (` -k 1 ` ) should match the KVNO of the service account. An error will show in the vault logs if this is incorrect.
72+
73+ Different encryption types can also be added to the keytab, for example ` -e rc4-hmac ` with additional ` addent ` commands.
74+
7175Then base64 encode it:
7276``` sh
7377base64 vault.keytab > vault.keytab.base64
@@ -77,7 +81,14 @@ base64 vault.keytab > vault.keytab.base64
7781vault write auth/kerberos/config
[email protected] service_account=
" your_service_account" 7882```
7983
80- 4 . Configure LDAP backend to look up Vault policies.
84+ 4 . 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:
85+ ``` sh
86+ # for Windows/Active Directory
87+ setspn.exe -U -S HTTP/vault.domain:8200 your_service_account
88+ setspn.exe -U -S HTTP/vault.domain your_service_account
89+ ```
90+
91+ 5 . Configure LDAP backend to look up Vault policies.
8192Configuration for LDAP is identical to the [ LDAP] ( https://www.vaultproject.io/docs/auth/ldap.html )
8293auth method, but writing to to the Kerberos endpoint:
8394
@@ -175,4 +186,3 @@ You can also specify a `TESTARGS` variable to filter tests like so:
175186``` sh
176187$ make test TESTARGS=' --run=TestConfig'
177188```
178-
0 commit comments