UI Gateway Check
The Ilum UI serves the web interfaces of the modules (Airflow, Grafana, Jupyter, MLflow and others) through its Nginx
gateway under /external/<module>/. With the gateway check on, Nginx asks ilum-core before it passes a request to a
module (auth_request to GET /api/dev/reactive/auth/check?module=<module>). The request reaches the module only when it
carries a valid Ilum session or API token and the user holds the module's permission.
Without the check, module routes are open to anyone who reaches the UI, and the module's own sign-in is the only protection. The check is off by default and on in governed mode.
How it works
- Session cookie. ilum-core sets the HTTP-only cookie
ilum_sessionon sign-in and token refresh, and the UI asks for it again when it starts with a stored session. For an internal or LDAP session the cookie holds a short token signed by ilum-core with the lifetime of the access token. For an OAuth2 session it holds the identity provider's ID token and is renewed with it. Sign-out removes the cookie. Module pages open in frames and new tabs, which never carry the UI'sAuthorizationheader, so the gateway relies on this cookie. The cookie isSecurewhen the browser reached Ilum over HTTPS (see HTTPS). - Check. ilum-core takes the session cookie first, then an Ilum bearer token in
Authorization, then an API token inX-API-KEY, and answers200,401or403with no body. The cookie is accepted on this check only: the Ilum API still requires theAuthorizationheader. - Outcome. On
200the request goes to the module. On401(no valid session or token) a page the browser opens is redirected to the Ilum sign-in page, and any other request (a module's API call,git,curl) gets401. On403(no permission) the gateway shows its 403 Forbidden page. - Only the request headers go to ilum-core, never the body, so uploads and WebSocket connections pass unchanged once the check succeeds.
- The
ilum_sessioncookie is removed from every request the gateway passes to a module, so module servers never see an Ilum credential the browser did not send them on purpose.
Earlier releases could gate module routes with access_* cookies (ilum-ui.nginx.config.http_cookie). These cookies
carried no signature, so any client could set them. They are no longer set or read. http_cookie.enabled: true now
turns on the gateway check, and a module key set to false (for example http_cookie.gitea.enabled) keeps that module
unchecked.
Enabling the check
ilum-ui:
nginx:
config:
gatewayAuth:
enabled: true
The check needs the UI and ilum-core of the same release: older UI versions do not ask for the session cookie when they start with a stored session.
Permissions per module
| Route | Module name | Permission |
|---|---|---|
/external/jupyter/ | jupyter | NOTEBOOK_READ |
/external/jupyterhub/ | jupyterhub | NOTEBOOK_READ |
/external/gitea/ | gitea | GITEA_READ |
/external/airflow/ | airflow | AIRFLOW_READ |
/external/grafana/ | grafana | GRAFANA_READ |
/external/prometheus/ | prometheus | GRAFANA_READ |
/external/n8n/ | n8n | N8N_READ |
/external/superset/ | superset | SUPERSET_READ |
/external/history-server/ (and the history servers of workspaces) | history-server | HISTORYSERVER_READ |
/external/minio/, /external/object-storage/, /rustfs/console/, /rustfs/api/ | object-storage | OBJECT_STORAGE_READ or MINIO_READ |
/external/mlflow/ | mlflow | MLFLOW_READ |
/external/kestra/ | kestra | KESTRA_READ |
/external/mageai/ | mageai | MAGE_READ |
/external/nifi/ | nifi | NIFI_READ |
/external/streamlit/ | streamlit | STREAMLIT_READ |
/external/pipeline-studio/ | pipeline-studio | PIPELINESTUDIO_READ |
/external/langfuse/ | langfuse | LANGFUSE_READ |
/external/openmetadata/ | openmetadata | OPENMETADATA_READ |
/external/clickhouse/ | clickhouse | SQL_EXECUTE |
/external/ranger/ | ranger | USER_EDIT_ACCESS |
Two routes are not checked: /external/hydra/ is the OAuth2 sign-in itself, and /external/api/ (the module
management API) checks the same Ilum bearer token itself and requires MODULE_READ or MODULE_EDIT. The Spark UI of
running jobs (/sparkui/) is checked per job, see Spark UI of running jobs.
Permissions come from the user's roles, groups and own permissions, as everywhere in Ilum (see Authorization). A disabled user has none.
Spark UI of running jobs
The Open Spark UI action of a running job on a Kubernetes cluster opens the Spark UI of the job's driver through the
gateway at /sparkui/<prefix>/<job id>/<hash>/<port>/<namespace>/proxy/<application id>/. The Spark UI shows the job's
configuration and environment, so with the gateway check on, Nginx asks ilum-core about each request
(GET /api/dev/reactive/auth/check/spark-ui, with the driver address Nginx read from the path). The route opens when:
- the user holds
JOB_READ, and - the user owns the job (submitted it, or owns its schedule or service group), or the job's cluster admits the user to
start Spark work on it: a group of the user is on the cluster's
submitGroups, the user holdsCLUSTER_ACCESS_MANAGE, or the list is empty whilesecurity.clusterAccess.unrestrictedWhenEmptyis on (see Cluster Access Lists). This is the rule of job submission, so in governed mode an empty list admits administrators only.
The address must be the job's own driver: the namespace of the job's cluster, and a Kubernetes Service named after the
job that selects the job's driver and serves the Spark UI on that port. Any other address is refused with 403, so the
gateway opens no other service through this route. Every part of the address must be a DNS label; other paths do not
reach the route. Allowed answers are cached like those of the module routes.
Finished jobs open in the Spark History Server, which is checked as the module history-server. Without the gateway
check the route is open, as in earlier releases.
The Spark UI can also kill a job's jobs and stages, which would let everyone who may open it stop another user's work. In
governed mode ilum-core starts every job with spark.ui.killEnabled=false, so the Spark UI has no kill links and refuses kill
requests; jobs are stopped through Ilum, which checks the user's permissions. See
Spark UI kill links.
Modules with their own sign-in
JupyterHub, Ranger, and the modules that sign in through the Ilum OAuth provider (Grafana, Airflow, Superset) ask for their own sign-in after the check. Browsers carry the session cookie through these flows, so they keep working unchanged.
Clients that call a module through the gateway without a browser session are refused with 401: git over HTTP to
Gitea, MLflow tracking clients, scripts that call the Airflow REST API with the module's own credentials. Such clients
can send an Ilum API token with the module's permission in X-API-KEY, call the module inside the cluster, or the module
can be left unchecked:
ilum-ui:
nginx:
config:
gatewayAuth:
exclude: [gitea]
The module's own sign-in still applies to an excluded module.
Caching
The gateway keeps an allowed answer of ilum-core for cacheSeconds (10 by default) per module and credential, so a page
that loads many files asks ilum-core once. Refusals are not kept: a new sign-in or a new permission counts at once. A
removed permission or a disabled user still opens a module for at most cacheSeconds. The cache keys hold session
tokens, so the cache lives on a memory volume of the UI pod. Set cacheSeconds: 0 to ask ilum-core on every request.
Sign-out removes the session cookie from the browser. The token itself stays valid until it expires, as it does for the Ilum API.
HTTPS
ilum-core marks the session cookie Secure when the request came over HTTPS: on a TLS connection to ilum-core, or
behind an ingress that terminates TLS and sends X-Forwarded-Proto: https (the gateway passes the header on). Sign-in,
token refresh, the session renewal of the UI and sign-out follow this rule. Over plain HTTP the cookie stays without
Secure, because the browser would not send it back.
Behind a proxy that terminates TLS but sends no X-Forwarded-Proto, mark the cookie Secure on every response:
ilum-core:
security:
sessionCookie:
alwaysSecure: true
With this setting the UI must be served over HTTPS only: over plain HTTP the browser drops the cookie and every module route asks for the sign-in again.
Ranger admin UI
With Apache Ranger on, the gateway serves the Ranger admin UI at /external/ranger/. The route is always
checked, also with gatewayAuth.enabled: false, and requires USER_EDIT_ACCESS, the permission that edits roles, groups
and permissions in Ilum. Ranger then asks for its own sign-in.
Ranger serves its UI and REST API under /external/ranger (ranger.contextName in ilum-ranger.admin.siteProperties),
so the gateway passes the path unchanged. Clients inside the cluster use http://ilum-ranger:6080/external/ranger; see
Apache Ranger.
Object storage on Ceph RGW
When the platform storage is Ceph RGW (rookCeph.enabled, or rookCeph as the active object-storage provider), the
gateway has no /external/object-storage/ and no /external/minio/ route. RGW ships no console, and these routes would
expose its S3 API through the UI.
Custom Nginx configuration
A location added with ilum-ui.nginx.config.extraLocation is not checked unless it asks for the check itself, with a
module name from the table above:
location /external/my-tool/ {
auth_request /_ilum/gateway-auth/grafana;
proxy_set_header Cookie $ilum_gateway_upstream_cookie;
proxy_pass http://my-tool:8080/;
}
An unknown module name is refused with 403. A server block of its own (nginx.config.default: false with
nginx.config.custom) can no longer use the $access_* variables of earlier releases: Nginx does not start with them.
Configuration
| Name | Description | Default |
|---|---|---|
ilum-ui.nginx.config.gatewayAuth.enabled | Check every module route with ilum-core | false (true in governed mode) |
ilum-ui.nginx.config.gatewayAuth.exclude | Module names left unchecked | [] |
ilum-ui.nginx.config.gatewayAuth.cacheSeconds | Seconds an allowed answer is kept per module and credential; 0 keeps none | 10 |
ilum-ui.nginx.config.http_cookie.enabled | Switch of earlier releases; true turns on the check | false |
ilum-core.security.sessionCookie.alwaysSecure | Mark the session cookie Secure also when the request does not say it came over HTTPS | false |
Troubleshooting
- A module page goes to the sign-in page although the user is signed in: the browser has no
ilum_sessioncookie. Sign out and in again. With OAuth2, an ID token longer than 4000 characters does not fit in a cookie: ilum-core logsGateway session cookie not set. Fewer claims in the ID token (for example fewer groups) fix it. - Refusals in the ilum-core log:
Gateway refused <path> to <user>: module <module> needs <permission>for403, andGateway refused <path>: no valid Ilum session or token for module <module>for401. A refused Spark UI logs the reason, for exampleneither the job's owner nor admitted to cluster <cluster>. - The Spark UI answers
403for the user's own job: the session cookie was set by an earlier release and carries no user id. Reload the UI or sign in again. - Module routes ask for the sign-in again on every page over HTTPS: check that the ingress sends
X-Forwarded-Proto: https, or setalwaysSecure. Over plain HTTP,alwaysSecuremust stay off. - Every module answers
500: the UI pod cannot reach ilum-core, so the check fails and the gateway refuses.