Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20 from wintoncode/improve_readme
Browse files Browse the repository at this point in the history
Improve Readme
  • Loading branch information
sambott authored Apr 29, 2019
2 parents afc7abe + 139fcf9 commit 01b6457
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Travis Build Status](https://travis-ci.org/wintoncode/vault-plugin-auth-kerberos.svg?branch=master)](https://travis-ci.org/wintoncode/vault-plugin-auth-kerberos)

This is a standalone backend plugin for use with [Hashicorp Vault](https://www.github.com/hashicorp/vault).
This plugin allows for users to authenticate with Vault via Kerberos.
This plugin allows for users to authenticate with Vault via Kerberos/SPNEGO.

You can find binaries on the [Release page](https://github.com/wintoncode/vault-plugin-auth-kerberos/releases).

Expand All @@ -19,7 +19,7 @@ except:
import winkerberos as kerberos
import requests

service = "HTTP/vault.domain@YOUR-REALM.COM"
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)
Expand Down Expand Up @@ -50,7 +50,7 @@ $ vault write sys/plugins/catalog/auth/kerberos sha_256="$(shasum -a 256 'vault-
2. Enable the Kerberos auth method:

```sh
$ vault auth enable -passthrough-request-headers=Authorization kerberos
$ vault auth enable -passthrough-request-headers=Authorization -allowed-response-headers=www-authenticate kerberos
Success! Enabled kerberos auth method at: kerberos/
```

Expand All @@ -68,6 +68,10 @@ slot KVNO Principal
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:
```sh
base64 vault.keytab > vault.keytab.base64
Expand All @@ -77,7 +81,14 @@ base64 vault.keytab > vault.keytab.base64
vault write auth/kerberos/config [email protected] service_account="your_service_account"
```

4. Configure LDAP backend to look up Vault policies.
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:
```sh
# 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
```

5. Configure LDAP backend to look up Vault policies.
Configuration for LDAP is identical to the [LDAP](https://www.vaultproject.io/docs/auth/ldap.html)
auth method, but writing to to the Kerberos endpoint:

Expand Down Expand Up @@ -175,4 +186,3 @@ You can also specify a `TESTARGS` variable to filter tests like so:
```sh
$ make test TESTARGS='--run=TestConfig'
```

0 comments on commit 01b6457

Please sign in to comment.