teleport/examples/workflows
Jakub Nyckowski bea2e89df5
Run GCI as make fix-imports (#17956)
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-11-04 15:46:46 +00:00
..
access-plugin.yaml API workflows example (#6827) 2021-08-30 11:46:29 -07:00
config.toml API workflows example (#6827) 2021-08-30 11:46:29 -07:00
go.mod Bump go.mod to use Go 1.18 (#13771) 2022-06-29 02:14:12 +00:00
go.sum update api versions in examples go.mod (#11574) 2022-03-31 14:15:53 +00:00
main.go Run GCI as make fix-imports (#17956) 2022-11-04 15:46:46 +00:00
README.md API workflows example (#6827) 2021-08-30 11:46:29 -07:00
requester.yaml API workflows example (#6827) 2021-08-30 11:46:29 -07:00

Example workflows plugin

This example plugin demonstrates how to create a workflows plugin to automatically approve/deny new access requests based on a simple Allow List.

Demo

This demo can be used to quickly get the example plugin up and running.

Create resources

# create the access-plugin user and role
$ tctl create -f access-plugin.yaml
# generate an identity file for the access-plugin
$ tctl auth sign --ttl=8760h --format=file --user=access-plugin --out=access-plugin-identity

Edit the config file

Open config.toml and replace the addr with your own Auth or Proxy server address.

Run the plugin

Start up the plugin and keep it running.

$ go run main.go

Make an access request

Open another terminal and execute the following commands to make a new access request.

# create the requester role
$ tctl create -f requester.yaml
# create a new user named alice using this role
$ tctl users add alice --roles=requester
# login as alice
$ tsh --proxy=proxy.example.com login --user=alice
# request the admin role as alice
$ tsh --proxy=proxy.example.com request new --roles=admin

Since alice is on the Allow List in cofig.toml with allowed role requester, the request should be automatically approved by the plugin.