|
1 | | -# Configuring OKTA SSO with Gravwell |
| 1 | +# Configuring Okta SSO with Gravwell |
2 | 2 |
|
3 | | -OKTA is a managed identity provider that provides cloud hosted identity and authentication services; if your organization uses OKTA for identity management, integrating with Gravwell is an incredibly easy process. |
| 3 | +Okta is a managed identity provider that provides cloud hosted identity and authentication services; if your organization uses Okta for identity management, integrating with Gravwell is an incredibly easy process. |
4 | 4 |
|
5 | 5 | In this document, we assume the following: |
6 | 6 |
|
7 | 7 | * The Gravwell instance has a valid DNS name of gravwell.example.com. |
8 | 8 | * The Gravwell instance is publicly available with valid SSL certificates. |
9 | 9 | * You are an Okta admin and can establish a new application and assign users to it. |
10 | 10 |
|
11 | | - |
12 | 11 | ## Creating The Okta Application |
13 | 12 |
|
14 | 13 | The first step is to log into the Okta management console and click on `Applications`, then click `Create App Integration` to begin setting up a Gravwell integration. |
15 | 14 |
|
16 | 15 |  |
17 | 16 |
|
18 | | -Name your application and upload an image so that users know what they are interacting with; feel free to grab our logo and use it. |
| 17 | +Name your SAML 2.0 application and upload an image so that users know what they are interacting with; feel free to grab our logo and use it. Proceed to step 2 (`Configure SAML`). |
19 | 18 |
|
20 | | - |
| 19 | + |
21 | 20 |
|
22 | 21 | Make sure to set the appropriate fully qualified URL for your SSO URL and SP Entity ID URL; given the domain of `gravwell.example.com` the appropriate URLs are `https://gravwell.example.com/saml/acs` and `https://gravwell.example.com/saml/metadata`. |
23 | 22 |
|
24 | | - |
| 23 | + |
25 | 24 |
|
26 | | -Next configure Attribute Statements so that user information such as names, emails, and groups can be transmitted from Okta to Gravwell during account creation. The `uid` and `mail` attributes are mandatory, but we suggest adding `givenName` and `surName` too. Also add the Group Attribute Statements to describe which groups will be sent from Okta to Gravwell; you can filter which groups are sent using a prefix, postfix, or even a regular expression. For this example we are sending all groups. |
| 25 | +Finalize this step and use the defaults for step 3 (`Feedback`). |
27 | 26 |
|
28 | | - |
| 27 | +## Setting Okta SAML Attributes |
29 | 28 |
|
30 | | -If you wish to double check the configuration XML click `Preview the SAML Assertion`, it may look something like this: |
| 29 | +Next configure Attribute Statements so that user information such as names, email addresses, and groups can be forwarded from Okta to Gravwell. |
31 | 30 |
|
32 | | -``` |
33 | | -<?xml version="1.0" encoding="UTF-8"?> |
34 | | -<saml2:Assertion ID="id12345678901234567890" IssueInstant="2023-08-08T22:22:08.424Z" Version="2.0" |
35 | | - xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"> |
36 | | - <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://www.okta.com/exk6ukjm9vpaGcPe8697</saml2:Issuer> |
37 | | - <saml2:Subject> |
38 | | - <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">kris.watts@gravwell.io</saml2:NameID> |
39 | | - <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> |
40 | | - <saml2:SubjectConfirmationData NotOnOrAfter="2023-08-08T22:27:08.424Z" Recipient="https://gravwell.example.com/saml/acs"/> |
41 | | - </saml2:SubjectConfirmation> |
42 | | - </saml2:Subject> |
43 | | - <saml2:Conditions NotBefore="2023-08-08T22:17:08.424Z" NotOnOrAfter="2023-08-08T22:27:08.424Z"> |
44 | | - <saml2:AudienceRestriction> |
45 | | - <saml2:Audience>https://gravwell.example.com/saml/metadata</saml2:Audience> |
46 | | - </saml2:AudienceRestriction> |
47 | | - </saml2:Conditions> |
48 | | - <saml2:AuthnStatement AuthnInstant="2023-08-08T21:38:53.551Z" SessionIndex="id12345678.123456789"> |
49 | | - <saml2:AuthnContext> |
50 | | - <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef> |
51 | | - </saml2:AuthnContext> |
52 | | - </saml2:AuthnStatement> |
53 | | - <saml2:AttributeStatement> |
54 | | - <saml2:Attribute Name="uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
55 | | - <saml2:AttributeValue |
56 | | - xmlns:xs="http://www.w3.org/2001/XMLSchema" |
57 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">user.dude@example.com |
58 | | - </saml2:AttributeValue> |
59 | | - </saml2:Attribute> |
60 | | - <saml2:Attribute Name="givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
61 | | - <saml2:AttributeValue |
62 | | - xmlns:xs="http://www.w3.org/2001/XMLSchema" |
63 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">User |
64 | | - </saml2:AttributeValue> |
65 | | - </saml2:Attribute> |
66 | | - <saml2:Attribute Name="surName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
67 | | - <saml2:AttributeValue |
68 | | - xmlns:xs="http://www.w3.org/2001/XMLSchema" |
69 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Dude |
70 | | - </saml2:AttributeValue> |
71 | | - </saml2:Attribute> |
72 | | - <saml2:Attribute Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
73 | | - <saml2:AttributeValue |
74 | | - xmlns:xs="http://www.w3.org/2001/XMLSchema" |
75 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">user.dude@example.com |
76 | | - </saml2:AttributeValue> |
77 | | - </saml2:Attribute> |
78 | | - <saml2:Attribute Name="groups" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
79 | | - <saml2:AttributeValue |
80 | | - xmlns:xs="http://www.w3.org/2001/XMLSchema" |
81 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">group1 |
82 | | - </saml2:AttributeValue> |
83 | | - <saml2:AttributeValue |
84 | | - xmlns:xs="http://www.w3.org/2001/XMLSchema" |
85 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">group2 |
86 | | - </saml2:AttributeValue> |
87 | | - </saml2:Attribute> |
88 | | - </saml2:AttributeStatement> |
89 | | -</saml2:Assertion> |
90 | | -``` |
| 31 | +Locate the newly created application in your list of Okta applications. Open the application and navigate to the `Sign On` tab. Find the `Attribute statements` block. |
| 32 | + |
| 33 | + |
| 34 | +Configure Okta SAML attributes using either Option A or Option B as described below. The `uid` and `mail` attributes are mandatory, but we suggest adding `givenName` and |
| 35 | +`surName` too. Set the `groups` attribute to select which Okta groups to forward from Okta to Gravwell. Both options (A and B) show how to send **all** groups. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +### (Option A) Attribute Statements |
91 | 40 |
|
92 | | -After finalizing your application integration, Okta will show a `Sign On Methods` screen containing a SAML 2.0 Metadata URL. Copy the URL (you will need it for your `gravwell.conf` configuration). |
| 41 | +Okta's attribute statements have migrated to using the [Okta Expression Language (EL)](https://developer.okta.com/docs/reference/okta-expression-language). |
| 42 | +The following example would forward all groups from Okta and grant admin access to members of Okta group `foo-admin-group`. |
93 | 43 |
|
94 | | -Next go to your Okta application and assign people and groups to the application; the group assignments can control which groups are passed to Gravwell as well as which users can log into the application. |
| 44 | + |
95 | 45 |
|
96 | | - |
| 46 | +### (Option B) Legacy Configuration |
| 47 | + |
| 48 | +If you do not want to use EL for SAML attributes, you can still use Okta's legacy configuration as follows. |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +## Okta App Assignments |
| 53 | + |
| 54 | +Next go to your Okta application and assign people and groups to the application to allow sign-on access to Gravwell. |
| 55 | + |
| 56 | + |
97 | 57 |
|
98 | 58 | ## Set up Gravwell configuration block |
99 | 59 |
|
| 60 | +You will need the metadata URL provided in the Gravwell Okta app -> `Sign On` tab -> `Metadata URL` block. |
| 61 | + |
100 | 62 | On the system running the Gravwell webserver, create a file named `/opt/gravwell/etc/gravwell.conf.d/sso.conf` and paste the following into it: |
101 | 63 |
|
102 | 64 | ``` |
|
0 commit comments