A managed or multi-user notebook platform gives every data scientist a code execution environment with cloud credentials attached, so one weak role assignment, shared kernel or long-lived key can expose every dataset and model the platform can reach. This guide covers the platform layer that sits above a single notebook server: tenant and user isolation, the platform administrator roles, the service accounts and workload identities that notebooks run as, API tokens, logging, and the lifecycle of workspaces, images and compute. It is vendor-neutral and applies to self-hosted multi-user deployments and to managed notebook services alike. It is for platform and MLOps engineers, cloud security teams and identity teams who support data science and AI work.
Single-server settings (tokens, listen addresses, the Jupyter Server authoriser) are covered in the Jupyter Server Security Guide, and the hunt for credentials already sitting in notebooks is covered in How to find secrets in Jupyter notebooks. This page does not repeat them.
Key takeaways
- Kernel access equals everything the kernel can reach. The Jupyter Server documentation describes execute access to kernels and terminals as generally meaning arbitrary code execution, equivalent to all other permissions. Platform security is therefore about what the kernel's identity can reach.
- Isolation is designed, not assumed. The JupyterHub documentation states the default configuration is not suitable for untrusted users and that per-user subdomains are the only reliable way to isolate user servers from each other.
- Give each workspace or user its own workload identity. A single shared service account for all notebooks turns every user into the union of everyone's data access.
- Platform admin scopes are superuser scopes. User administration and server administration rights let an operator act as, or reach the servers of, any user; hold them under privileged access controls.
- Lifecycle closes most of the gaps. Idle culling, maximum server age, image rebuilds and workspace deletion on project end limit both cost and the window for credential theft and cryptomining.
Platform architecture and trust boundaries
Whether self-hosted or managed, multi-user notebook platforms share the same building blocks. Each one is a trust boundary with its own controls.
| Layer | What it does | Main security question |
|---|---|---|
| Control plane (hub, workspace service) | Authenticates users, spawns servers, holds the admin API | Who holds admin scopes, and how are API tokens scoped and expired? |
| Proxy and ingress | Routes browser traffic to each user's server | Are user servers on separate origins, and is the endpoint private? |
| Spawner and compute | Starts per-user containers, pods or VMs | Is each user in a separate container or VM, non-root, with no host access? |
| Kernels | Run user code (Python, R, SQL) | Are kernels shared between users, and what identity do they run as? |
| Storage | Home directories, shared volumes, object storage mounts | Can one user read another's files or a project's shared secrets? |
| Workload identity | Credentials notebooks use for data, model registries and APIs | Per-user or per-workspace, short-lived, least privilege? |
| Images and packages | Base images, conda or pip environments | Who can change the image, and are package sources controlled? |
Tenant and user isolation
Choosing an isolation model
| Model | Isolation | When it fits | Trade-off |
|---|---|---|---|
| Shared server, shared kernel | None between users | Never for more than one person | Any user can read every other user's variables and credentials |
| Per-user server on a shared host, same origin | Process and file permissions only | Small, trusted teams with a read-only environment | Browser-level separation is weak; JupyterHub makes no guarantees between users without subdomains |
| Per-user container or pod, per-user subdomain | Container boundary plus browser origin separation | Most enterprise deployments | Needs wildcard DNS and TLS; container hardening is still required |
| Per-workspace cluster, project or account | Separate network, identity and storage boundary | Regulated data, separate business units, external collaborators | Higher cost and more administration; best for high-sensitivity projects |
Controls that make isolation real
- Separate origins: run each user server on its own subdomain. The JupyterHub security overview explains that on a shared origin servers cannot meaningfully distinguish requests coming from other user servers.
- Read-only environments: where subdomains are not possible, the same documentation recommends disabling user configuration (
Spawner.disable_user_config), running servers from a root-owned read-only environment, and enablinginternal_sslfor traffic between hub, proxy and servers. - No cross-user server access: users should not hold
access:serverson servers other than their own. Sharing features let users serve files to each other, so keep them off for untrusted populations unless per-user domains are enabled. - Container hardening: on Kubernetes, run notebook pods under the Restricted Pod Security Standard where the workload allows it (non-root, no privilege escalation, no host namespaces), and use network policies to block pod-to-pod traffic between users. GPU and system-level drivers sometimes need exceptions: grant them to a dedicated node pool, not the whole cluster.
- Egress control: restrict outbound traffic to package mirrors, data sources and model endpoints. Open egress is how mined cryptocurrency and stolen data leave the platform.
Platform admin roles and privileged access
Most platforms expose fine-grained scopes. JupyterHub is a useful open-source reference because its scope model is documented in detail, and managed services expose equivalent roles under their own names.
| Scope (JupyterHub naming) | What it allows | Who should hold it |
|---|---|---|
admin:users | Create, modify and delete users and their authentication state; the documentation calls it tantamount to superuser | Platform administrators only, through privileged access workflow |
admin:servers | Start, stop, create and delete any user's servers and their state | Platform operators and automation such as the idle culler, scoped as narrowly as possible |
access:servers | Make requests to user servers via API or browser | Each user for their own server only |
tokens | Read, create and delete user tokens | Users for their own tokens; administrators rarely |
admin-ui | See the admin page (actions still need their own scopes) | Support staff with read-only duties |
Legacy admin flag | Extreme superuser permissions | Avoid; the documentation discourages it in favour of specific roles |
- Separate platform and cloud administration: the person who manages notebook users should not also own the cloud account or cluster administrator role underneath.
- Support access: if support staff need to see a user's environment, use a time-bound, logged access request rather than a standing admin role.
- Review: review admin scope holders quarterly and after every reorganisation, as for any privileged role. See the Privileged Access Management Guide.
Service accounts, workload identity and keys
The identity a notebook runs as decides the blast radius of a compromised kernel. Attackers who reach a notebook go for credentials in files (MITRE ATT&CK T1552.001), the cloud instance metadata service (T1552.005) and application access tokens (T1528), then use them as valid cloud accounts (T1078.004).
Identity patterns compared
| Pattern | Blast radius | Recommendation |
|---|---|---|
| One platform-wide service account for all notebooks | Every user gets every dataset the platform can reach | Replace |
| Per-workspace or per-project workload identity | Limited to the project's data and services | Good default for team projects |
| Per-user identity (user's own federated credentials passed through) | Limited to that user's entitlements; actions attributable | Preferred where data access is entitlement-based |
| Static access keys in environment variables or files | Keys copied into notebooks, Git and outputs; no expiry | Replace with federated, short-lived credentials |
- Short-lived credentials: use the platform's workload identity federation so pods or VMs receive tokens that expire, rather than long-lived keys. See the AI Infrastructure Workload Identity Guide.
- Protect the metadata path: on cloud compute, require session-based metadata service access where the provider offers it and block user containers from reaching the node's own metadata credentials.
- Secrets through a manager: give notebooks a scoped path in a secrets manager instead of pasting database passwords and LLM API keys into cells. Scan repositories and outputs for anything that slips through.
- Hub and service tokens: JupyterHub tokens inherit their owner's full permissions by default (the
inheritscope); request limited-scope tokens explicitly, and register automation as a named service with only the scopes its role needs. The idle culler, for example, needs onlylist:users,read:users:activity,read:serversanddelete:servers. - Ownership: every service account, workspace identity and service token needs a named owner and a review date. See the MLOps Security Guide for the downstream pipeline identities.
Implementation: a phased hardening plan
- Inventory: list every notebook platform, workspace, admin scope holder, service account, token and attached storage mount. Include managed services created by individual teams.
- Close the exposure first: move endpoints behind single sign-on and private access, and remove shared kernels and shared servers.
- Fix identity: replace platform-wide service accounts and static keys with per-workspace or per-user federated identities. Pilot with one team, run old and new identities side by side for one sprint, then revoke the old keys. Roll back by re-enabling the old identity for that team only.
- Harden compute: apply container hardening and network policies in audit or warn mode first, review violations for a fortnight, then enforce. Keep GPU exceptions on a separate node pool.
- Restrict admin scopes: move admin holders to named roles, remove the legacy admin flag, and scope automation tokens.
- Lifecycle automation: turn on idle culling and maximum server age, schedule image rebuilds, and tie workspace deletion to project closure.
- Monitor: stream control plane, cloud and Kubernetes audit logs to the SIEM and build the detections below.
Decision guidance
- Self-hosted versus managed: self-hosting gives full control of isolation and identity but you own patching and the control plane. A managed service shifts the control plane to the provider; you still own role assignments, workload identity, network exposure and data access. Use the shared responsibility table in each provider's documentation.
- Small teams: per-user containers on a managed service with per-project identities and SSO cover most risk. Skip per-workspace accounts unless data sensitivity demands it.
- Large or regulated organisations: separate workspaces by data classification, give each its own network and identity boundary, and put external collaborators in their own workspace.
Logging and detection
| Log source | What to capture | Detection idea |
|---|---|---|
| Control plane (hub or workspace service) | Logins, admin actions, token creation, server spawns and deletions | New admin scope grants; tokens created with broad or inherited scopes; spawns at unusual hours |
| Cloud audit logs | API calls by workload identities | A notebook identity calling services outside its project; access from outside the platform's network |
| Kubernetes audit and runtime | Pod creation, exec, policy violations, process events | Privileged pods outside the GPU pool; known mining processes or sustained high CPU on idle sessions (T1496.001) |
| Network and egress | Outbound connections from notebook pods | Connections to mining pools, paste sites or unapproved storage |
| Secrets manager | Reads by notebook identities | Bulk secret reads or reads of another project's path |
Metrics that show it is working:
- Percentage of notebook workloads running on per-user or per-workspace federated identity (target 100 percent).
- Number of static cloud keys found in notebook environments, repositories and outputs (target zero, trending down).
- Admin scope holders, and the share reviewed in the last quarter.
- Median idle server age and the count of servers older than the maximum age policy.
- Percentage of notebook pods passing the enforced container policy without exception.
Lifecycle: workspaces, images and compute
- Idle and long-running servers: the JupyterHub idle culler stops servers idle longer than
--timeout(default 600 seconds) and can cull servers older than--max-age, which is off by default. Set a maximum age so long-running sessions refresh their credentials and images. - Images: build notebook images from a controlled pipeline, pin package sources to an internal mirror, rebuild on a schedule to pick up patches, and restrict who can publish images users can select.
- Joiners and leavers: provision platform access from identity provider groups, and on leaving remove access, delete or transfer home directories and revoke the user's tokens.
- Project closure: delete the workspace identity, storage mounts and secrets paths when a project ends, after exporting what must be kept.
- Updates: apply platform and provider security updates promptly; self-hosted control planes need the same patch cadence as any internet-facing application (T1190).
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | MITRE ATT&CK addressed |
|---|---|---|---|
| Admin scopes and least privilege | AC-2, AC-6 | PR.AA-05 | T1078.004 |
| Workload identity and keys | IA-5 | PR.AA-01 | T1552.001, T1552.005, T1528 |
| Isolation and egress | SC-7, SC-39 | PR.PS-01 | T1059.006, T1496.001 |
| Hardened images and configuration | CM-6, CM-7 | PR.PS-01 | T1190 |
| Logging and monitoring | AU-12, SI-4 | DE.CM-09 | T1496.001 |
Common failure patterns
- One service account for the whole platform: a single compromised notebook reaches every bucket and model registry the platform can read.
- Shared servers for convenience: a team shares one server and kernel, so every member can read the others' credentials and the audit trail shows one user.
- Tokens with inherited scope: automation runs on a token created by an administrator with the default inherited scope, giving a reporting script full superuser rights.
- Privileged pods everywhere: an exception granted for GPU drivers is applied cluster-wide, so every notebook pod can reach the host.
- No maximum age: sessions run for months on old images with credentials issued long ago, and cryptomining hides in long-running jobs.
- Orphaned workspaces: projects end but their identities, storage mounts and secrets stay active with no owner.
Practitioner checklist
- Inventory every notebook platform, workspace, admin scope holder, service account and token.
- Remove shared servers and shared kernels; give each user their own server on a separate origin.
- Replace platform-wide service accounts and static keys with per-workspace or per-user federated identities.
- Hold user and server administration scopes under privileged access controls and remove the legacy admin flag.
- Issue limited-scope tokens for automation and register it as named services.
- Enforce non-root, no-privilege-escalation containers and network policies, with GPU exceptions on a separate node pool.
- Restrict egress to approved package mirrors, data sources and model endpoints.
- Turn on idle culling and a maximum server age; rebuild images on a schedule.
- Delete workspace identities, mounts and secrets paths at project closure.
- Stream control plane, cloud and Kubernetes audit logs to the SIEM and track the five metrics.
Standards and references
- Project Jupyter: JupyterHub Security Overview
- Project Jupyter: JupyterHub Scopes
- Project Jupyter: Using JupyterHub's REST API
- Project Jupyter: Security in the Jupyter Server
- Project Jupyter: jupyterhub-idle-culler
- NIST: SP 800-190 Application Container Security Guide
- NIST: SP 800-53 Rev. 5
- MITRE ATT&CK: Cloud Instance Metadata API
Related NHI Mgmt Group resources: Jupyter Server Security Guide · How to find secrets in Jupyter notebooks · Amazon SageMaker Security Guide · Azure Machine Learning Security Guide · Databricks Security Guide