Join our Newsletter — 33% off our NHI Course
Home› Guides› Securing the data science notebook platform itself: admin…
Guide AI Platforms

Securing the data science notebook platform itself: admin roles, service accounts, keys, logs and lifecycle

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 14 November 2026 12 min read
On this page

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.

LayerWhat it doesMain security question
Control plane (hub, workspace service)Authenticates users, spawns servers, holds the admin APIWho holds admin scopes, and how are API tokens scoped and expired?
Proxy and ingressRoutes browser traffic to each user's serverAre user servers on separate origins, and is the endpoint private?
Spawner and computeStarts per-user containers, pods or VMsIs each user in a separate container or VM, non-root, with no host access?
KernelsRun user code (Python, R, SQL)Are kernels shared between users, and what identity do they run as?
StorageHome directories, shared volumes, object storage mountsCan one user read another's files or a project's shared secrets?
Workload identityCredentials notebooks use for data, model registries and APIsPer-user or per-workspace, short-lived, least privilege?
Images and packagesBase images, conda or pip environmentsWho can change the image, and are package sources controlled?

Tenant and user isolation

Choosing an isolation model

ModelIsolationWhen it fitsTrade-off
Shared server, shared kernelNone between usersNever for more than one personAny user can read every other user's variables and credentials
Per-user server on a shared host, same originProcess and file permissions onlySmall, trusted teams with a read-only environmentBrowser-level separation is weak; JupyterHub makes no guarantees between users without subdomains
Per-user container or pod, per-user subdomainContainer boundary plus browser origin separationMost enterprise deploymentsNeeds wildcard DNS and TLS; container hardening is still required
Per-workspace cluster, project or accountSeparate network, identity and storage boundaryRegulated data, separate business units, external collaboratorsHigher 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 enabling internal_ssl for traffic between hub, proxy and servers.
  • No cross-user server access: users should not hold access:servers on 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 allowsWho should hold it
admin:usersCreate, modify and delete users and their authentication state; the documentation calls it tantamount to superuserPlatform administrators only, through privileged access workflow
admin:serversStart, stop, create and delete any user's servers and their statePlatform operators and automation such as the idle culler, scoped as narrowly as possible
access:serversMake requests to user servers via API or browserEach user for their own server only
tokensRead, create and delete user tokensUsers for their own tokens; administrators rarely
admin-uiSee the admin page (actions still need their own scopes)Support staff with read-only duties
Legacy admin flagExtreme superuser permissionsAvoid; 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

PatternBlast radiusRecommendation
One platform-wide service account for all notebooksEvery user gets every dataset the platform can reachReplace
Per-workspace or per-project workload identityLimited to the project's data and servicesGood default for team projects
Per-user identity (user's own federated credentials passed through)Limited to that user's entitlements; actions attributablePreferred where data access is entitlement-based
Static access keys in environment variables or filesKeys copied into notebooks, Git and outputs; no expiryReplace 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 inherit scope); 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 only list:users, read:users:activity, read:servers and delete: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

  1. Inventory: list every notebook platform, workspace, admin scope holder, service account, token and attached storage mount. Include managed services created by individual teams.
  2. Close the exposure first: move endpoints behind single sign-on and private access, and remove shared kernels and shared servers.
  3. 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.
  4. 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.
  5. Restrict admin scopes: move admin holders to named roles, remove the legacy admin flag, and scope automation tokens.
  6. Lifecycle automation: turn on idle culling and maximum server age, schedule image rebuilds, and tie workspace deletion to project closure.
  7. 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 sourceWhat to captureDetection idea
Control plane (hub or workspace service)Logins, admin actions, token creation, server spawns and deletionsNew admin scope grants; tokens created with broad or inherited scopes; spawns at unusual hours
Cloud audit logsAPI calls by workload identitiesA notebook identity calling services outside its project; access from outside the platform's network
Kubernetes audit and runtimePod creation, exec, policy violations, process eventsPrivileged pods outside the GPU pool; known mining processes or sustained high CPU on idle sessions (T1496.001)
Network and egressOutbound connections from notebook podsConnections to mining pools, paste sites or unapproved storage
Secrets managerReads by notebook identitiesBulk secret reads or reads of another project's path

Metrics that show it is working:

  1. Percentage of notebook workloads running on per-user or per-workspace federated identity (target 100 percent).
  2. Number of static cloud keys found in notebook environments, repositories and outputs (target zero, trending down).
  3. Admin scope holders, and the share reviewed in the last quarter.
  4. Median idle server age and the count of servers older than the maximum age policy.
  5. 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 areaNIST SP 800-53 Rev. 5NIST CSF 2.0MITRE ATT&CK addressed
Admin scopes and least privilegeAC-2, AC-6PR.AA-05T1078.004
Workload identity and keysIA-5PR.AA-01T1552.001, T1552.005, T1528
Isolation and egressSC-7, SC-39PR.PS-01T1059.006, T1496.001
Hardened images and configurationCM-6, CM-7PR.PS-01T1190
Logging and monitoringAU-12, SI-4DE.CM-09T1496.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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.