Module
OpenAEV
How-to guide

Configure single sign-on

Let people log in to OpenAEV with your identity provider through OpenID Connect or SAML, send them to their tenant, map their groups and keep an emergency access.

OpenAEVFor administrators and platform engineers

Single sign-on (SSO) lets people log in to OpenAEV with their account in your identity provider (IdP), through OpenID Connect (OIDC) or SAML 2.0, instead of a password stored in OpenAEV. OpenAEV creates the account at the first login, attaches it to a tenant and keeps its groups in line with the IdP at every login. Providers are set in the configuration of the platform, not in the interface. This page explains what a login does, then configures a provider, its tenant and its group mapping.

Before you start

  • You can change the configuration of the openaev service and restart it. With xtm-docker, see Change the stack without editing docker-compose.yml.
  • openaev.base-url (OPENAEV_BASE-URL) is the public address of OpenAEV: the addresses your IdP calls back are built from it. See the openaev block of the configuration reference.
  • You have administrator access to your IdP, to register OpenAEV as an application.
  • The groups that logins will map to exist, each with a name used by no other group of its tenant, or of the platform for a platform group. See Map groups.
  • Local login stays on for an emergency access. See Keep an emergency access.

Choose a strategy

StrategyKey and defaultHow the user logs inHow many
Localopenaev.auth-local-enable, trueEmail and password formOne
OpenID Connectopenaev.auth-openid-enable, falseA button, then the login page of the IdPSeveral providers
SAML 2.0openaev.auth-saml2-enable, falseA button, then the login page of the IdPSeveral providers

The three switches are independent. With local login and SSO both on, the login page shows the form, with one button per provider below it. Prefer OIDC or SAML in production, and keep local login for the emergency account.

What a login does

IDENTITY PROVIDEROPENAEV LOGINIdentity providerOpenID Connect or SAML 2.0AccountFound or created by emailTenanttenant_id, else the default tenantMapped groupsAdded or removed at each loginAdmin groupOf the provider's tenant, withroles_admin or all_admin
  1. Identity provider → Account: email, names
  2. Account → Tenant: attached
  3. Identity provider → Mapped groups: group claim
  4. Identity provider → Admin group: role claim
A single sign-on login creates or updates the account, attaches it to a tenant and syncs its mapped groups

OpenAEV trusts the IdP: it asks for no password, and creates the account the first time someone logs in. Five rules explain what you will see:

  1. The email identifies the user. With OIDC, OpenAEV reads the email claim and refuses the login without one; it takes the names from given_name and family_name. With SAML, the email is the NameID of the assertion, and the names come from the attributes you name. A new account has no password. The names are refreshed at every login.
  2. The account joins one tenant. When it logs in through a provider and is not a member of its tenant, the account is attached to the tenant of that provider, tenant_id, or to the default tenant without it. It then joins the groups of that tenant that have Auto assign on.
  3. Mapped groups follow the IdP. At every login, OpenAEV reads the groups of the user from the claims or attributes in groups_path. A group of the mapping is added when its IdP value is there, and removed when it is not any more. Groups outside the mapping, added by hand or by Auto assign, are never touched.
  4. A missing group is skipped. When the mapped group does not exist, the login goes on without it, unless the rule has autoCreate. A group created that way belongs to the tenant of the rule's tenantId, or to the platform without it, and has no role: it gives nothing until you give it one.
  5. Administrators join the Admin group of the tenant, only if you ask. With roles_admin, a user whose roles, read from roles_path, contain one of its values is put in the Admin group of the provider's tenant, tenant_id or the default tenant. They leave it at the next login when their roles no longer do. With all_admin set to true, every user of the provider joins it. Without either, the Admin group is never touched. When the tenant has no group named Admin, the role is ignored, with a warning in the log.

Single sign-on never makes an account a platform administrator. An account that carries the administrator flag from an earlier version loses it at its first login without an administrator role, when roles_admin or all_admin is set; the bootstrap admin keeps it.

Warning

A rule with a tenantId looks its group up by name in that tenant only. A rule without one looks it up among the platform groups only, never in a tenant. Every tenant has groups named Admin, Manager and Observer: a rule that names Manager without a tenantId looks for a platform group called Manager, and skips it, or creates it with autoCreate. Set tenantId on every rule that maps to a tenant group.

Configure a provider

Each provider has an identifier you choose, the <id> of its keys, in lower case. Set the keys as environment variables of the openaev service: the key in upper case, each dot replaced by an underscore, dashes kept. openaev.provider.grandmeridian.tenant_id becomes OPENAEV_PROVIDER_GRANDMERIDIAN_TENANT_ID.

OpenID Connect

Turn on openaev.auth-openid-enable (OPENAEV_AUTH-OPENID-ENABLE), then declare the provider with the Spring Security keys:

KeyValue
spring.security.oauth2.client.provider.<id>.issuer-uriThe issuer of the IdP. OpenAEV reads its discovery document
spring.security.oauth2.client.registration.<id>.client-idThe client ID of the application registered in the IdP
spring.security.oauth2.client.registration.<id>.client-secretIts secret
spring.security.oauth2.client.registration.<id>.scopeopenid,profile,email
spring.security.oauth2.client.registration.<id>.redirect-uri<base URL>/login/oauth2/code/<id>, the address to register in the IdP
openaev.provider.<id>.audienceOptional. Sent as the audience parameter, for an IdP such as Auth0 that needs it to issue an access token for an API

The button sends the user to /oauth2/authorization/<id>.

Spring Security already knows the addresses of GitHub, Google, Facebook and Okta: give the provider the identifier github, google, facebook or okta, and set only its client-id and client-secret. GitHub speaks plain OAuth 2.0, not OpenID Connect: OpenAEV reads the email from the GitHub profile, so a user whose email is not public there cannot log in, with the message You probably need a public email in your github account.

SAML 2.0

Turn on openaev.auth-saml2-enable (OPENAEV_AUTH-SAML2-ENABLE), then declare the provider:

KeyValue
spring.security.saml2.relyingparty.registration.<id>.entity-idThe identifier of OpenAEV in the IdP
spring.security.saml2.relyingparty.registration.<id>.assertingparty.metadata-uriThe address of the metadata XML of the IdP
openaev.provider.<id>.firstname_attribute_keyThe attribute that holds the first name
openaev.provider.<id>.lastname_attribute_keyThe attribute that holds the last name

In the IdP, set the reply address, where assertions go, to <base URL>/login/saml2/sso/<id>, and the NameID to the email address. OpenAEV publishes its own metadata at <base URL>/saml2/service-provider-metadata/<id>, which most IdPs import.

Both strategies then read these keys:

KeyWhat it setsDefault
openaev.provider.<id>.loginThe text of the buttonLogin with <id>
openaev.provider.<id>.tenant_idThe tenant the account joins, and whose Admin group administrators join. It does not apply to the rules of groups_managementThe default tenant
openaev.provider.<id>.groups_pathThe claims or attributes that hold the groups, separated by commasNone: no group is read
openaev.provider.<id>.groups_managementThe group mapping, a JSON array of rulesNone
openaev.provider.<id>.roles_pathThe claims or attributes that hold the rolesNone
openaev.provider.<id>.roles_adminThe role values that put a user in the Admin group of the provider's tenant, separated by commasNone
openaev.provider.<id>.all_adminEvery user of the provider joins the Admin group of its tenantfalse

These keys carry the identifier of your provider, so the configuration reference does not list them.

Map groups

Each rule of groups_management has four fields:

FieldValue
idpGroupThe group value as the IdP sends it: a name, or an object ID with Microsoft Entra ID. Case counts
userGroupThe name of the OpenAEV group
autoCreatetrue to create the group when it does not exist, in the tenant of tenantId or on the platform. Keep false and create the group in its tenant first, with its role
tenantIdThe Tenant identifier of the tenant that holds userGroup. When the rule applies, OpenAEV also attaches the user to this tenant. Without it, userGroup names a platform group. The provider's tenant_id does not stand in for it

The rule removes the user from the same group it adds: the group of that name in the tenant of tenantId, or the platform group of that name without it. A tenantId that names no tenant skips the rule, with a warning in the log. Without groups_path, OpenAEV reads no group, so every mapped group is removed at the next login.

Send users to the right tenant

With one tenant per organization, each login must reach its tenant. Two ways:

  • One provider per organization. Each organization logs in through its own IdP, or its own application in a shared IdP. Set tenant_id on each provider: the button of the provider leads to its tenant. Its rules still need their tenantId to map to the groups of that tenant.
  • One provider for all. Set tenantId on each rule of the mapping: a user in the IdP group of an organization is attached to its tenant and put in its group.

The Tenant identifier of a tenant is in Settings, then Parameters, while you work in it. A tenant_id that names no tenant is ignored, with a warning in the log, and the account joins no tenant. Removing a user from a tenant is done in OpenAEV: a login never detaches an account.

ExampleLog the staff of Grand Meridian in with Microsoft Entra ID

Example CERT hosts a tenant for each member hotel chain. Grand Meridian Hotels signs its staff in with Microsoft Entra ID, and wants its security engineers to build simulations and its CISO, Hélène Marchetti, to read them.

In the Grand Meridian Hotels tenant, the administrator creates two groups, Grand Meridian managers with the Manager role and Grand Meridian observers with the Observer role. In the Entra admin center, Grand Meridian registers an application with the web redirect URI https://openaev.example.com/login/oauth2/code/grandmeridian and creates a client secret. It adds the email, given_name and family_name optional claims to the ID token, and a groups claim that emits group IDs. The platform engineer of Example CERT adds to the openaev service:

services:
  openaev:
    environment:
      OPENAEV_AUTH-LOCAL-ENABLE: "true"
      OPENAEV_AUTH-OPENID-ENABLE: "true"
      SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_GRANDMERIDIAN_ISSUER-URI: https://login.microsoftonline.com/3f6c2a1e-8b4d-4e2a-9c71-5d0e8f2b7a14/v2.0
      SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GRANDMERIDIAN_CLIENT-ID: 0b7e5c9d-2f41-4a8e-b6d3-91c4e7a20f55
      SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GRANDMERIDIAN_CLIENT-SECRET: ${GRANDMERIDIAN_CLIENT_SECRET}
      SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GRANDMERIDIAN_SCOPE: openid,profile,email
      SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GRANDMERIDIAN_REDIRECT-URI: https://openaev.example.com/login/oauth2/code/grandmeridian
      OPENAEV_PROVIDER_GRANDMERIDIAN_LOGIN: Log in with Grand Meridian
      OPENAEV_PROVIDER_GRANDMERIDIAN_TENANT_ID: 7c1e4b2a-5d3f-4e8b-9a61-2f0c8d4e6b13
      OPENAEV_PROVIDER_GRANDMERIDIAN_GROUPS_PATH: groups
      OPENAEV_PROVIDER_GRANDMERIDIAN_GROUPS_MANAGEMENT: '[{"idpGroup":"8d2f4c1a-6b3e-4f7d-9a21-0c5e7b9d3f48","userGroup":"Grand Meridian managers","autoCreate":false,"tenantId":"7c1e4b2a-5d3f-4e8b-9a61-2f0c8d4e6b13"},{"idpGroup":"c41e9a07-3d5b-4b62-8f1e-2a7d6c90b3e5","userGroup":"Grand Meridian observers","autoCreate":false,"tenantId":"7c1e4b2a-5d3f-4e8b-9a61-2f0c8d4e6b13"}]'

GRANDMERIDIAN_CLIENT_SECRET is in the .env file. Both rules carry the Tenant identifier of the Grand Meridian Hotels tenant, because their groups belong to that tenant: without it, OpenAEV would look for platform groups of those names. After a restart, the login page shows Log in with Grand Meridian under the form. Hélène's first login creates helene.marchetti@grand-meridian.example, attaches it to the Grand Meridian Hotels tenant, and puts it in Grand Meridian observers, because her Entra account is in the second group. When Entra ID drops her from that group, her next login removes her from it.

When a user belongs to more than 200 groups, Entra ID leaves the groups claim out of the token. Emit only the groups assigned to the application to avoid it.

Keep an emergency access

When everyone logs in through SSO, an outage, a wrong setting or an expired certificate of the IdP locks everyone out. Keep openaev.auth-local-enable at true: the bootstrap admin, whose email and password come from OPENAEV_ADMIN_EMAIL and OPENAEV_ADMIN_PASSWORD, can then still log in with the form. Sign in the first time and keep an emergency account explains how to keep that account safe and how to turn local login back on.

Check that it works

Open the login page in a private browser window: it shows the button of each provider, with the text of its login key. Log in through it, then, as an administrator, open Settings, then Security, then Users in the tenant of the provider: the account is listed, and its groups are those of the mapping. An unknown or misspelled group leaves an error naming it in the log of the platform.

What's next

NextConnect a tenant to XTM Hub
OpenAEV
Adversarial exposure validation: scenarios, simulations, atomic tests.

Published

Overview
Use
Build dashboards of your validation results
OverviewCreate the widgets of a dashboard
Check one attack technique with an atomic testConnect OpenAEV to OpenCTI to test security coveragesHow collectors measure what your security tools saw
How injectors deliver your injects
OverviewBuilt-in injectors and their injects
Install the OpenAEV agent on your endpointsReview what your injects discovered
Run a simulation and read its results
OverviewShare simulation results in a report
Set up your profile