Examples of SSO configuration between Anchore and an external Identity Provider
These examples provide simple defaults and identity mappings. More advanced configurations are possible as outlined in the identity mappings documentation.
This is the multi-page printable view of this section. Click here to print.
These examples provide simple defaults and identity mappings. More advanced configurations are possible as outlined in the identity mappings documentation.
The JBoss KeyCloak system is a widely used and open-source identity management system that supports integration with applications via SAML and OpenID Connect. It also can operate as an identity broker between other providers such as LDAP or other SAML providers and applications that support SAML or OpenID Connect.
The following is an example of how to configure a new client entry in KeyCloak and configure Anchore to use it to permit UI login by KeyCloak users that are granted access via KeyCloak configuration.
Anchore supports multiple IDP configurations, each given a name. For this example we’ll choose the name “keycloak” for our configuration. This important as that name is used in several URL paths to ensure that the correct configuration is used for validating responses, so make sure you pick a name that is meaningful to your users (they will see it in the login screen) and also that is url friendly.
Some config choices and assumptions specifically for this example:
https://localhost:3000
. Replace with the appropriate url as needed.keycloak
as the name of this saml/sso configuration within Anchore. This will identify the specific configuration and is used in urls.https://localhost:3000/service/sso/auth/keycloak
http://localhost:3000/service/sso/auth/keycloak
See SAML Clients in KeyCloak documentation
For this example, set the following values in “Add Client” screen (these are specific to the settings in this example described above):
http://localhost:3000/service/sso/auth/keycloak
- This will be the SP Entity ID used in the Anchore configuration laterIn the next screen, Client Settings
Name - “Anchore Enterprise”. This is only used to display a friendly name to Keycloak users in the KeyCloak UI. Can use any name you like.
Enabled - Select on
Include Authn Statement - Select on
Sign Documents - Select on
Client Sign Authn Requests - Select Off
Sign Assertions - Select off
Encrypt Assertions - Select off
Client Signature Required - Select off
Force Post Binding - Select off. Anchore requires the HTTP Redirect Binding to work, so this setting must be off to enable that.
Force Name ID Format - Select on
Name ID Format - Select username or email (transient uses a generated UUID per login and persistent use the Keycloak user’s UUID)
Root URL - Leave empty
Valid Redirect URIs - Add http://localhost:3000/service/sso/auth/keycloak
Base URL - Leave empty
Master SAML Processing URL - http://localhost:3000/service/sso/auth/keycloak
Fine Grain SAML Endpoint Configuration
http://localhost:3000/service/sso/auth/keycloak
Save the configuration
Download the metadata xml to import into Anchore
idp-metadata.xml
You’ll need the following information from keycloak in order to configure the SAML record within Anchore:
The name to use fo the configuration, in this example keycloak
Metadata XML downloaded or copied from the previous section
In the Anchore UI, create an SSO IDP Configuration:
Login as admin
Select “Configuration” Tab on the top
Select “SSO” on the left-side menu
Click “Let’s Add One” in the configuration listing
http://localhost:3000/service/sso/auth/keycloak
(NOTE: this must match the Client ID you used for the Client in the KeyCloak setuphttp://localhost:3000/service/sso/auth/keycloak
keycloakusers
for this example, but can be any account name (existing or not) that you’d like the users to be members of. See Mappings for more information on how thisread-write
for this example so that the users have full access to the account to analyze images, setup policies, etc.You should now see a ‘keycloak’ option in the login screen for the Anchore Enterprise UI. This will redirect users to login to the KeyCloak instance for their username/password and will create a new user in Anchore in the keycloakusers
account with read-write role.
Some config choices and assumptions specifically for this example:
http://localhost:3000
. Replace with the appropriate url as needed.okta
. This will identify the specific configuration and is used in urls, and can be any url-safe string you’d like.http://localhost:3000/service/sso/auth/okta
.
This is constructed with the UI endpoint and path /service/sso/auth/{IDP Config Name}http://localhost:3000/service/sso/auth/okta
. This could be different but for simplicity we use the same value.See Okta SAML config to see how to create a new application authorization server. The following steps are used during specific steps of that walk-thru
Single sign on URL
, this is the URL Okta will direct users to. This must be a URL in the Anchore Enterprise UI
based on the name you chose for the configuration. In our example: http://localhost:3000/service/sso/auth/okta
Use this for Recipient URL and Destination URL
checkbox as well.
a1. Set the Audience URI(SP Entity ID)
to a URI that will identify the anchore installation. This can be the same as
the single-sign-on URL for simplicity. We’ll need to enter this value later in the Anchore config as well.Default RelayState
emptyName ID format
can be left “Unspecified” or set to an email or username format.https://<youraccount>.okta.com/app/<appid>/sso/saml/metadata
You’ll need the following information from okta to enter in the Anchore UI:
okta
in this caseIn the Anchore UI, create an SSO Idp Configuration:
And…
Enter the values:
okta
- This is the name of the configuration and will be referenced in login and sso URLs, so we use the value
chosen at the beginning of this examplehttp://localhost:3000/service/sso/auth/okta
oktausers
read-write
, the standard user type that has most abilities except user management.Save the configuration, configuration is complete when you see a login with ‘okta’ option on the login screen. Users can now log in to your Anchore deployment using this Okta endpoint.
See: Mapping Users and Roles in SSO for more information on using the account and role defaults, IDP attribute values and understanding how identities are mapped into Anchore’s RBAC system.