Skip to content

Commit bc1d72e

Browse files
author
Jeff Ploughman
committed
Picture
1 parent 4619c69 commit bc1d72e

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
**/releases
33
**/*.crt
44
**/*.pem
5+
**/test
6+
**/test/*
57
**/config.sh
68
**/build.sh

DELEGATED.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ I have built 2 Vault plugins - [the trustee plugin](https://github.com/immutabil
88

99
There are a handful of ways the Trustee plugin can be used effectively in conjunction with the JWT-Auth plugin. I will start with a very simple use case:
1010

11+
![Delegated Authentication](./doc/delegated.png?raw=true "Delegated Authentication Flow")
12+
13+
It must be pointed out: **the Web Service above can use a completely separate Vault for the Trustee plugin than it uses for authentication (JWT-Auth plugin).** This is because the Trustee's address is all the JWT-Auth plugin needs to **trust** to validate the JWT.
14+
1115
## Governance by Proxy
1216

1317
Imagine that you have an identity in Active Directory: You have a user ID and you are the member of a handful of Active Directory groups. One of these groups is `pay-master-group`. Your membership in this group means that you are allowed to cut checks from a bank account (`123412341234`) that holds millions of dollars.

doc/delegated.png

78.9 KB
Loading

test/jwt-auth.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ setup() {
44
if [ ! -f jwtRS256.key ]; then
55
ssh-keygen -t rsa -b 4096 -P "" -f jwtRS256.key
66
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
7-
echo {\"sub\":\"goober\",\"groups\": [\"test\"]} | jwt -key jwtRS256.key -alg RS256 -sign - > jwt.json
7+
echo {\"sub\":\"goober\",\"group\": [\"test\"]} | jwt -key jwtRS256.key -alg RS256 -sign - > jwt.json
88
fi
99
}
1010

1111
@test "test configure jwt-auth" {
12-
run vault write auth/jwt-auth/config [email protected] ttl=60m max_ttl=300m
12+
run vault write auth/test/jwt/config [email protected] trustee_list="0xF7353BEd87798F6fB95493D2b5D6025761a66f51" ttl=60m max_ttl=300m
1313
[ "$status" -eq 0 ]
1414
}
1515

1616
@test "test map policies to role" {
1717
run vault policy write test test.hcl
1818
[ "$status" -eq 0 ]
19-
run vault write auth/jwt-auth/map/claims/test value=test
19+
run vault write auth/test/jwt/map/claims/test value=test
2020
[ "$status" -eq 0 ]
21-
run vault write auth/jwt-auth/map/users/goober value=goober
21+
run vault write auth/test/jwt/map/users/goober value=goober
2222
[ "$status" -eq 0 ]
2323
}
2424

2525

2626
@test "test auth as goober" {
27-
results=$(vault write -format=json auth/jwt-auth/login [email protected] | jq .auth)
27+
results=$(vault write -format=json auth/test/jwt/login [email protected] | jq .auth)
2828
username=$(echo $results | jq .metadata.username | tr -d '"')
2929
[ "$username" == "goober" ]
3030
}

0 commit comments

Comments
 (0)