github.com/pachyderm/pachyderm@v1.13.4/doc/docs/1.9.x/enterprise/saml.md (about) 1 # Overview 2 3 This guide walks you through an example of using Pachyderm's SAML support, including the 4 following: 5 6 1. Activate Pachyderm enterprise and Pachyderm auth. 7 2. Configure Pachyderm's auth system to enable its SAML ACS, receive SAML 8 assertions, and allow you to log in by using the Okta® access management 9 software. 10 3. Log in to both the dash and CLI. 11 12 ## Activation 13 14 When starting out, we **highly** recommend running Pachyderm in Minikube, as 15 mistakes in this configuration could lock you out of your cluster. 16 17 To activate Pachyderm enterprise and Pachyderm auth: 18 19 ``` 20 pachctl enterprise activate <enterprise code> 21 pachctl auth activate --initial-admin=robot:admin 22 ``` 23 24 At this point, Pachyderm is ready to authenticate & authorize users. 25 26 What the `--initial-admin` flag does is this: 27 1. Pachyderm requires there to be at least one cluster admin if auth is 28 activated 29 2. Pachyderm's authentication is built around GitHub by default. Without this 30 flag, Pachyderm asks the caller to go through an OAuth flow with GitHub, and 31 then at the conclusion, makes the caller the cluster admin. Then whoever 32 activated Pachyderm's auth system can modify it by re-authenticating via 33 GitHub and performing any necessary actions 34 3. To avoid the OAuth flow, though, it's also possible to make the initial 35 cluster admin a "robot user". This is what 36 `--initial-admin=robot:<something>` does. 37 4. Pachyderm will print out a Pachyderm token that authenticates the holder as 38 this robot user. At any point, you can authenticate as this robot user by 39 running 40 ``` 41 $ pachctl auth use-auth-token 42 Please paste your Pachyderm auth token: 43 <paste robot token emitted by "pachctl auth activate --initial-admin=robot:admin"> 44 $ # you are now robot:admin, cluster administrator 45 ``` 46 47 The rest of this example assumes that your Pachyderm cluster is running in 48 minikube, and you're accessing it via `pachctl`'s port forwarding. Many of the 49 SAML service provider URLs below are set to some variation of `localhost`, 50 which will only work if you're using port forwarding and your browser is able 51 to access Pachyderm via `localhost` on the port forwarder's usual ports. 52 53 ## Create IdP test app 54 The ID provider (IdP) that this example uses is Okta. Here is an example 55 configuration for an Okta test app that authenticates Okta users 56 with Pachyderm: 57 58  59 60 Once created, you can get the IdP Metadata URL associated with the test Okta 61 app here: 62 63  64 65 ## Write Pachyderm config 66 Broadly, setting an auth config is what enables SAML in Pachyderm 67 (specifically, it enables Pachyderm's ACS). Below is an example config that will 68 allow users to authenticate in your Pachyderm cluster using the Okta app above. 69 Note that this example assumes 70 71 ``` 72 # Lookup current config version--pachyderm config has a barrier to prevent 73 # read-modify-write conflicts between admins 74 live_config_version="$(pachctl auth get-config | jq .live_config_version)" 75 live_config_version="${live_config_version:-0}" 76 # Set the Pachyderm config 77 pachctl auth set-config <<EOF 78 { 79 # prevent read-modify-write conflicts by explicitly specifying live version 80 "live_config_version": ${live_config_version}, 81 "id_providers": [ 82 { 83 "name": "okta", 84 "description": "Okta test app", 85 "saml": { 86 "metadata_url": <okta app metadata URL>, 87 "group_attribute": "memberOf" # optional: enable group support 88 } 89 } 90 ], 91 "saml_svc_options": { 92 # These URLs work if using pachctl port-forward 93 "acs_url": "http://localhost:30654/saml/acs", 94 "metadata_url": "http://localhost:30654/saml/metadata", 95 "dash_url": "http://localhost:30080/auth/autologin", 96 } 97 } 98 EOF 99 ``` 100 101 ## Logging In 102 Currently Pachyderm only supports IdP-initiated authentication. To proceed, 103 configure your Okta app to point to the Pachyderm ACS 104 (`http://localhost:30654/saml/acs` if using `pachctl`'s port forwarding), then 105 sign in via the new Okta app in your Okta dashboard. 106 107 After clicking on the test Okta app, your browser will do a SAML authentication 108 handshake with your pachyderm cluster, and you will arrive at your Pachyderm 109 dashboard fully authenticated. To log in with the Pachyderm CLI, get a One-Time 110 Password from the Pachyderm dash, and then run `pachctl auth login 111 --code=<one-time password>` in your terminal. 112 113 ### Groups 114 If your SAML ID provider supports setting group attributes, you can use groups to manage access in Pachyderm with the `"group_attribute"` in the IDProvider field of the auth config: 115 ``` 116 pachctl auth set-config <<EOF 117 { 118 ... 119 "id_providers": [ 120 { 121 ... 122 "saml": { 123 "group_attribute": "memberOf" 124 } 125 } 126 ], 127 } 128 EOF 129 ``` 130 Then, try: 131 ``` 132 pachctl create repo group-test 133 pachctl put file group-test@master -f some-data.txt 134 pachctl auth set group/saml:"Test Group" reader group-test 135 ``` 136 Elsewhere: 137 ``` 138 pachctl auth login --code=<auth code> 139 pachctl get file group-test@master:some-data.txt # should work for members of "Test Group" 140 ``` 141