Support access

This page describes support access to the clients’ accounts end to end: who may view whom, how the client authorizes, how a consultation is opened, limited and ended, and what is recorded. It is meant for technical readers. Using the console is described in Support console; the target user’s side, in the CIRCÉ manual, “Support access” page.

Overview

A support consultation opens CIRCÉ or HERMES ALM with the application identity of a chosen member, in a single tenant, read only. Support sees the data and can download the exports available to that member; it does not see their browser live.

Five actors take part:

Actor Role
subscription holds the policies, the requests and the authorizations; decides whether a consultation is allowed; decides who may end one; holds the journal
the gateway opens the consultation session, enforces the tenant and read-only mode, re-checks the authorization during the session, reports openings, ends and refusals to subscription
Keycloak the identities; the gateway gets the target member’s session from it; subscription reads the operator’s and the target’s roles in it
CIRCÉ and ALM the Support access page and the banner where the user answers requests and authorizes
the support console the subscription-front page from which support and administrators act

The typical path, under the On request policy:

  1. Support requests access from the console; the user receives an e-mail and a banner.
  2. The user authorizes from their own session, for a duration they choose.
  3. Support clicks View as user; the gateway asks subscription whether it is allowed, then opens a tab signed in with the user’s identity.
  4. The gateway re-checks the authorization during the session and ends it at the first end reason.
  5. Every step is recorded in the support journal.
Warning

This access bypasses the target user’s corporate IdP authentication, their MFA and their conditional-access rules. Support authenticates with its own account; the gateway then gets a session of the target from Keycloak.

Who may view whom

The operator is one of two people:

  • an MLA support member: an account of the mla realm, enabled in Keycloak, holding the realm role SUPPORT or ROLE_ADMIN (effective roles, composites and groups included). They may act in every tenant;
  • a tenant administrator: an active member of that tenant with role ADMIN. They may act in that tenant only.

subscription reads the operator from Keycloak at every decision, never from the roles the gateway passes on: an account disabled or stripped of its role loses access at the next check.

The target must meet all of these conditions:

  • an active member of the tenant: account not disabled, tenant with an active status and within its validity period, a role in the tenant, access not suspended;
  • not MLA staff: a user with no client, or whose client has a subdomain listed in application.support-access.staff-clients (mla by default), is never viewed, whatever their realm;
  • in Keycloak: an account found exactly once, enabled, not a service account (service-account-…), and holding no privileged role. The list comes from security-library (ImpersonationTargets), shared with the gateway: the realm roles ROLE_ADMIN, SUPPORT and admin, and any role of the realm-management client. subscription reads the effective roles; the gateway re-checks the tokens issued for the consultation;
  • not the operator themself, and not from a consultation already open (no chaining).

The tenant’s policy

Each tenant has a support access policy:

Policy Value Effect
On request ON_REQUEST Initial value of every tenant. Each user authorizes support themselves, for a limited time.
Always ALWAYS No individual authorization is required. The other conditions still apply.
Never NEVER Every consultation is refused, even when an individual authorization exists.

The policy is changed by a platform administrator or an active administrator of the tenant (PUT /api/v1/support-access/tenants/{tenantId}/policy). Each change writes a SUPPORT_POLICY_CHANGED event with the policy before and after.

Access requests

A request (POST /api/v1/support-access/requests) names the tenant, the target, a suggested duration, an optional reason (2,000 characters at most) and the product to open. subscription accepts it only when the access decision for this operator and this target is CONSENT_REQUIRED or CONSENT_FOR_ANOTHER_REQUESTER: an authorization is missing. In every other case it answers 403 with the reason (or “Access already authorized”).

Rules:

  • the suggested duration runs from 15 minutes to application.support-access.max-grant-duration;
  • the product must have a page in application.support-access.front-urls; {subdomain} there is replaced by the subdomain of the tenant’s client;
  • a request lives seven days. A request from the same operator to the same target still pending is returned as it is; an expired one is closed and replaced;
  • the operator’s e-mail address and language are read from their token, to write to them later.

Once recorded, subscription writes SUPPORT_ACCESS_REQUESTED to the journal and, after the transaction commits, sends the target the “Support access request” e-mail, with a link to the product’s Support access page.

A user sees only the requests addressed to them, and an operator only their own (GET /api/v1/support-access/requests?tenantId=).

Declining. The target may decline a request (POST /api/v1/support-access/requests/{requestId}/decline, answer 204). Only the target, an active member of the tenant, may (403 otherwise); an unknown, already resolved or expired request answers 404. The request is closed and marked declined, the journal receives SUPPORT_ACCESS_DECLINED, and the operator receives the “Support access request declined” e-mail. They may ask again afterwards.

The access decision

The gateway asks subscription whether an operator may view a target (POST /api/v1/support-access/check) on opening and during the session. The console and the creation of a request use the same decision. subscription checks in this order and answers with the first reason that applies:

Reason Cause
CHAINING The call already comes from a consultation.
INVALID_IDENTITY The target or the operator is not named.
SELF The operator is the target.
TENANT_NOT_FOUND Unknown tenant.
TARGET_NOT_ACTIVE_MEMBER The target is not an active member of the tenant.
TARGET_IS_MLA_STAFF The target is MLA staff.
IDENTITY_PROVIDER_UNAVAILABLE Keycloak did not answer, while reading the operator or the target.
ACTOR_NOT_AUTHORIZED The operator is disabled in Keycloak, or is neither an MLA support member nor an active administrator of the tenant.
TARGET_PRIVILEGED_OR_DISABLED The target is disabled, not found, a service account, or holds a privileged role in Keycloak.
POLICY_NEVER The tenant’s policy is Never.
ALLOWED Always policy: allowed, with no end date.
CONSENT_REQUIRED On request policy and no authorization running.
CONSENT_FOR_ANOTHER_REQUESTER Authorizations exist, but none for this operator nor for the whole support.
ALLOWED An authorization covers the operator: allowed until its end.

The answer carries allowed, until (the end of the authorization used, empty under Always), reason and the tenant’s name.

The consultation session

Opening. View as user sends the gateway (POST /api/impersonation) the tenant, the target and the product’s address. The gateway asks subscription for the decision, then returns a single-use entry address (…/impersonation/enter?ticket=…); the console opens its tab only on that gateway address. The gateway then opens the target’s session with Keycloak, through the gateway-impersonation client of the target’s realm, and reports the opening to subscription (IMPERSONATION_STARTED, with a session reference).

Tokens are kept per gateway web session: a consultation neither replaces nor closes the session the target user opened themself.

Limits during the consultation (gateway):

  • the tenant is enforced: a request to another tenant is refused;
  • write methods are refused, except an explicit list of viewing or export POST requests: those of application.impersonation.read-only-requests and those the services publish themselves in Consul, under support/read-only-requests/<service>. application.impersonation.denied-requests always wins;
  • the authorization is re-checked with subscription at most once every 60 seconds, on a request of the session. This delay cannot be configured: a revocation can therefore take up to 60 seconds to cut an open session;
  • the authorization’s end, known from each check, is compared on every request; a longer authorization given later does not extend the session;
  • when subscription or Keycloak does not answer, each request gets 503 during the grace period; beyond it, the session ends;
  • after 5 refused launches in 10 minutes from the same console session, the gateway answers 429 without asking subscription.

The requests refused during the session are counted by kind (read-only, another tenant, nested consultation) and sent with the end.

Gateway settings (Consul):

Property Default Role
application.impersonation.max-session-duration PT4H longest consultation
application.impersonation.unavailable-grace PT5M grace period while subscription or Keycloak does not answer
application.impersonation.sweep-interval PT1M interval of the sweep of idle or expired sessions
application.impersonation.max-refusals 5 refused launches before 429
application.impersonation.refusal-window PT10M window over which refusals are counted
application.impersonation.published-requests-refresh PT30S re-reading of the requests published in Consul
application.session.valkey.enabled false web sessions and consultation state in Valkey, shared between instances

How the services recognise a consultation

The services receive the target’s token, obtained by the gateway from Keycloak: they apply the target’s permissions and isolation as for the target themself. Nothing in this token grants anything more.

The gateway adds a read-only marker to every request of the consultation, the header X-SUPPORT-READ-ONLY: true. This marker only suppresses writes; it grants no access or role:

  • CIRCÉ (irrc) creates no profile and does not synchronize the token’s information on a read;
  • the library likewise disables profile synchronization;
  • ALM neither creates nor updates the target’s activity record.

Technical logs, audit events and viewing caches may still be fed.

subscription, for its part, refuses any new consultation asked from a consultation: the gateway tells it so in the check (impersonated), which gives the reason CHAINING.

End reasons

Each session end is an IMPERSONATION_ENDED event with its reason:

Reason Console wording Meaning
EXIT left by the operator Support clicked Exit in the banner.
EXPIRED authorization expired The authorization’s end has passed.
REVOKED authorization revoked subscription refused on a re-check: revocation, policy change, target or operator no longer allowed.
MAX_DURATION maximum duration reached The session reached max-session-duration.
LOGOUT signed out Support signed out, or their own session disappeared.
IDLE session idle The session went without requests until it expired in the gateway’s session store.
UNAVAILABLE service unavailable too long subscription or Keycloak stayed unreachable beyond the grace period.
UNKNOWN end not reported The gateway never reported the end; subscription writes it itself (see below).
TERMINATED ended by … A platform administrator or a tenant administrator ended it from the console.

Orphan sessions. With the in-memory store, a gateway restart loses its sessions, and their end is never reported. Every five minutes (application.support-access.orphan-session-cron), subscription writes an end of reason UNKNOWN, as system, for each opening older than application.support-access.orphan-session-after (5 hours by default) left without an end. This end is dated at the opening plus that delay: an upper bound, not the real time. An opening that carries a session reference is closed only by an end with the same reference. The delay must stay longer than the gateway’s longest session.

Ending a session

The console’s End button calls the gateway (POST /api/impersonation/sessions/{sessionRef}/terminate). Before closing anything, the gateway asks subscription for permission (POST /api/v1/support-access/sessions/{sessionRef}/termination, with the caller’s login and realm).

subscription allows it (ALLOWED) when the caller is an active administrator of the session’s tenant, or an enabled account of the mla realm holding ROLE_ADMIN, read from Keycloak. It refuses otherwise:

Reason Cause
INVALID_IDENTITY Caller not named.
NOT_FOUND No opening carries this reference.
ALREADY_ENDED The session already has a recorded end.
NOT_AUTHORIZED The caller does not have this right. A support member may not end another one’s session.
IDENTITY_PROVIDER_UNAVAILABLE Keycloak could not tell whether the caller is a platform administrator.

When allowed, the gateway closes the target’s Keycloak session, invalidates the consultation’s web session and writes the end (TERMINATED, with terminatedBy and terminatedByRealm). The operator’s next request gets 401 and their tab shows Support consultation ended.

Note

Several gateway instances. With the in-memory session store (the default), a single instance holds a session: an end request received by another instance answers 404. With Valkey (application.session.valkey.enabled), every instance sees the same sessions and a single one closes each session.

Events, journal and audit

Support access events are rows of the access_event table, the same as the access history:

Event Written by When
SUPPORT_POLICY_CHANGED subscription policy change (before, after)
SUPPORT_ACCESS_REQUESTED subscription request created
SUPPORT_ACCESS_GRANTED subscription authorization given
SUPPORT_ACCESS_REVOKED subscription authorization revoked or replaced
SUPPORT_ACCESS_DECLINED subscription request declined by the target
IMPERSONATION_STARTED the gateway consultation opened
IMPERSONATION_ENDED the gateway; subscription for UNKNOWN consultation ended
IMPERSONATION_REFUSED the gateway opening refused, with subscription’s reason

The gateway sends its events to POST /api/v1/support-access/sessions/events (SupportSessionEvent). subscription checks them before writing them: a type among the three IMPERSONATION_*, a known end reason, refused-request counts on an end only, a session reference made of letters, digits, _ and - (64 characters at most), and terminatedBy present if and only if the reason is TERMINATED. An unknown tenant or target answers 404.

Each row keeps, depending on the event: the date, the real actor and their realm, the target and their realm, the tenant and its client, the operator (on session events only), the end of validity, the application opened, the end or refusal reason, the refused requests by kind, the session reference, who ended the session, the policies before and after, and the operator an authorization is bound to. Names are copied into the row: changing or deleting an account does not erase them.

  • Refusals deduplicated. An identical IMPERSONATION_REFUSED (same tenant, target, operator and reason) is recorded only once per application.support-access.refusal-deduplication-window (5 minutes by default).
  • Append-only. A database trigger refuses every update and every deletion of access_event, except the retention purge.
  • Retention. Every night (03:40, Paris time, application.access-event.purge-cron), the events older than application.access-event.retention (90 days by default) are deleted. See also Purge.

The support journal (GET /api/v1/support-access/journal) reads only the SUPPORT_* and IMPERSONATION_* events. For a given tenant it is open to MLA support and to that tenant’s administrators; without a tenant, to MLA support alone. It flags as running (open) each opening whose session reference has no end. Pages hold 500 rows at most.

The export (GET /api/v1/support-access/journal/export) produces support-access.csv, UTF-8 with a BOM, with the columns date, event, actor, actorRealm, user, userRealm, tenant, front, validUntil, endReason, refusalReason, refusedReadOnly, refusedTenant, refusedChaining, policyBefore, policyAfter, sessionRef, terminatedBy, terminatedByRealm. A cell starting with =, +, -, @, a tab or a carriage return is prefixed with an apostrophe, so that a spreadsheet does not run it as a formula.

Live updates and e-mails

After each request created, authorization given, revocation or decline, and once the transaction commits, subscription publishes SUPPORT_REQUEST_CHANGED on the Kafka topic ui_events_topic, with the tenant’s public id, the realm and the login of the target user. A failed send is logged and dropped: the fronts read the state again at regular intervals.

  • CIRCÉ (irrc) and ALM (stress) relay the message to their browsers: the user’s request banner and badge reload at once.
  • subscription also consumes this topic, each instance in a group of its own, and relays it to the console on its GET /api/v1/events stream, as SupportAccessChanged. Platform administrators receive the tenant’s id; the console’s other users (support, tenant administrators) receive the event with no field at all, and their console reads the shown tenant again.

The e-mails (“Support access request”, “Support access authorized”, “Support access request declined”) are handed to the notification service as a SEND_MAIL message on notification_topic, after the transaction commits. An e-mail that cannot be built (product page or client subdomain not configured) is dropped and logged, without undoing the authorization or the decline.

API endpoints

All under /api/v1/support-access:

Endpoint Caller
GET /tenants console user: support sees every tenant, a tenant administrator their own
GET /tenants/{tenantId}/members MLA support, or a tenant administrator
GET /tenants/{tenantId} the tenant’s state: MLA support, or an active member
PUT /tenants/{tenantId}/policy platform administrator, or tenant administrator
GET /tenants/{tenantId}/grants MLA support, or tenant administrator
POST /tenants/{tenantId}/grant, DELETE /tenants/{tenantId}/grant the user themself, an active member
POST /requests, GET /requests?tenantId= operator; target for reading
POST /requests/{requestId}/decline the request’s target
GET /journal, GET /journal/export MLA support; a tenant administrator for their tenant
POST /check the gateway alone
POST /sessions/events the gateway alone
POST /sessions/{sessionRef}/termination the gateway alone

“The gateway alone”: a token of the shared realm, issued to the svc-gateway client, a member of the support-access caller group (see Security).

subscription settings

Property Default Role
application.support-access.max-grant-duration P30D longest authorization and suggested duration
application.support-access.console-url none the console’s address in the e-mails sent to the operator; failing that, the product’s page
application.support-access.front-urls.<product> none each product’s Support access page, {subdomain} replaced by the client’s subdomain
application.support-access.staff-clients [mla] subdomains of the clients whose users are MLA staff
application.support-access.orphan-session-after PT5H age of an opening without an end before the UNKNOWN end; longer than the longest session
application.support-access.orphan-session-cron 0 */5 * * * * schedule of the orphan-session job (- disables it)
application.support-access.refusal-deduplication-window PT5M refusal deduplication window
application.access-event.retention P90D how long access events are kept