Skip to content

Instantly share code, notes, and snippets.

@GuyBarros
Created July 26, 2019 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GuyBarros/3a9901a22bd52ae0f4f5e1f7154468a1 to your computer and use it in GitHub Desktop.
Save GuyBarros/3a9901a22bd52ae0f4f5e1f7154468a1 to your computer and use it in GitHub Desktop.
startigng of vault notifier
Steps to make a Control Group Notifier
1) list all Tokens
curl -X LIST \
http://eu-guystack-vault-561637873.eu-west-2.elb.amazonaws.com:8200/v1/auth/token/accessors \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Host: eu-guystack-vault-561637873.eu-west-2.elb.amazonaws.com:8200' \
-H 'Postman-Token: a2b45f2e-2d68-43be-b6ad-921bae752963,0b36602c-6c4d-41f8-9497-9a40bd2f9fe7' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'X-Vault-Token: petems' \
-H 'cache-control: no-cache'
2) iterate over token accessors search for policy [ "control-group" ]
curl -X POST \
http://eu-guystack-vault-561637873.eu-west-2.elb.amazonaws.com:8200/v1/auth/token/lookup-accessor \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 46' \
-H 'Content-Type: application/json' \
-H 'Host: eu-guystack-vault-561637873.eu-west-2.elb.amazonaws.com:8200' \
-H 'Postman-Token: 2d2a6183-d86a-47e6-bc77-1a13c569d459,2c3441ca-650e-47f6-ba8a-ddce6ffe60ba' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'X-Vault-Token: petems' \
-H 'cache-control: no-cache' \
-d '{
"accessor": "oDGfWCagIH8wNphBp54qhiA6"
}'
3) look up the Control group request info and see if it has been authorized
curl -X POST \
http://eu-guystack-vault-561637873.eu-west-2.elb.amazonaws.com:8200/v1/sys/control-group/request \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 46' \
-H 'Content-Type: application/json' \
-H 'Host: eu-guystack-vault-561637873.eu-west-2.elb.amazonaws.com:8200' \
-H 'Postman-Token: 5608459a-0afb-4601-8076-26c0abeb914b,f3705feb-cd2c-4993-9971-247fa9f11eeb' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'X-Vault-Token: s.MnSz2xIjKd4QrtMPR8tb51cS' \
-H 'cache-control: no-cache' \
-d '{
"accessor": "PEzHRt6pHiaPBcnlKZaojg2d"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment