Security

Every learner is the administrator of a Kubernetes cluster for the length of a session, so LabCluster assumes learners will try anything their cluster allows and isolates sessions from each other and from the platform. This page lists what is enforced and how to report a problem.

Reporting a vulnerability

Please report security problems privately through GitHub’s Report a vulnerability button on the repository’s Security tab. Do not open a public issue. Include steps to reproduce and the impact you expect. You will get an acknowledgement within a few days, and credit in the fix’s release notes if you would like it.

What is enforced

Identity and access

  • Sign-in is GitHub OAuth only, with the minimal scopes (read:user, user:email). New accounts need a verified email and a public repository, or to be 30 days old.
  • Sign-in sessions are random 256-bit tokens stored server-side in Postgres, sent in an HttpOnly, Secure, SameSite=Lax cookie, and expire after 14 days.
  • Every session route (workspace, status, grade, finish, terminal) returns 404 to anyone but the session’s owner.

Web protections

  • State-changing requests and WebSocket upgrades must come from the same origin (cross-site request forgery protection).
  • A strict Content Security Policy allows scripts, styles and frames only from the site itself, images additionally from GitHub avatars, and no framing by other sites.
  • The terminal proxy strips cookies and credentials before forwarding to the terminal.
  • After sign-in, only same-site paths are accepted as the page to return to.

Fair use

  • One running session per learner, three per 24 hours, and a platform-wide cap, enforced in a single database transaction so concurrent starts cannot overshoot.
  • Sessions end at their time limit plus 10 minutes, are graded, and are deleted.

Session isolation (production)

  • Each session has its own namespace with Pod Security “restricted”, a ResourceQuota (2 CPU, 3 GiB, 10 pods, no LoadBalancers or NodePorts) and a LimitRange.
  • Each session’s API server and etcd run in their own pod, so nothing a learner can reach through their cluster’s API belongs to anyone else.
  • Network policies deny all traffic by default. Inside the namespace, the terminal may reach the control plane; from outside, only the platform namespace may connect; egress is limited to DNS.
  • The control-plane and terminal pods run as non-root with read-only root filesystems, no capabilities and no service account token. Both are verified to pass Pod Security “restricted” admission.
  • The controller fetches each session’s kubeconfig with a random per-session token, and stores it only in a Secret in that session’s namespace.

Platform

  • The website’s service account can only create and read LabSession objects. The controller’s can manage namespaces and the few object types a session needs.
  • Only the Cloudflare Tunnel connector can reach the website; nothing can reach the controller.
  • Platform pods run as non-root with read-only root filesystems under Pod Security “restricted”.

Development mode

labcluster dev runs every session’s control plane and terminal as processes on one machine, with no isolation between them: a learner’s shell could reach other sessions. Use it only on your own machine for your own testing, and never expose it to other people.

Not yet in place

  • Automated abuse detection (for example, flagging accounts that start sessions only to probe the platform).
  • Rate limiting in the application; rely on Cloudflare’s rate-limiting rules in the meantime.

Edit this page on GitHub