Skip to content
NebulaCtrldocs

Security model

What NebulaCtrl secures, what you secure when you self-host it, and how the control plane, the agents, your identity provider and your Git providers trust each other.

NebulaCtrl is a control plane that decides what runs in your clusters and stores the secrets those workloads need. Its security model has two halves: what the software enforces, and what you must secure around it. This page draws the line between them.

How the pieces trust each other

flowchart LR
subgraph You["You operate"]
  Proxy["Reverse proxy<br/>TLS"]
  CP["Control plane<br/>container"]
  DB[("PostgreSQL")]
  ENV[".env<br/>master key"]
  IdP["OIDC provider"]
end
Browser["Browser<br/>session cookie"] --> Proxy
CI["CI<br/>API token"] --> Proxy
Git["Git providers<br/>signed webhooks"] --> Proxy
Proxy --> CP
CP --> DB
ENV -.-> CP
CP <--> IdP
subgraph Cluster["Each cluster"]
  Agent["Agent<br/>dials out"]
end
Agent -->|"HTTPS, bearer token"| Proxy
  • People sign in at your OIDC provider. The control plane never sees a password. A browser holds a session cookie; a script holds an API token.
  • Git providers push events to the control plane as webhooks. Each delivery is signed or carries a secret, and unsigned deliveries are refused. A GitHub App's delivery is checked against the secret of the connection on the host that sent it. A Forgejo or GitLab delivery is checked against the secret of one hook and acts only for that hook's project.
  • Agents dial the control plane over HTTPS with a bearer token. The control plane never connects to a cluster, so clusters need no inbound rule for it.
  • Nodes talk to each other only inside a WireGuard mesh, including across clusters.

The control plane is the root of trust for your clusters. Whoever controls it, or holds an admin API token, can choose what runs in the environment namespaces of every cluster bound to it.

What NebulaCtrl provides

AreaWhat it enforces
AuthenticationOne external OIDC provider. Authorization code flow with PKCE, state and nonce. An unverified or missing email is refused, and an unverified email never replaces a verified one on a person's account. Identity is issuer plus sub. Sessions are random 32-byte values, stored hashed, HttpOnly and SameSite=Lax. Over https:// the cookie is named __Host-nebula_session, so another subdomain cannot overwrite it. A session ends after 7 days without a request, or sooner when the organization sets a shorter limit under Settings > Security & policy > Sessions, and after 30 days whatever its activity.
Second factorAn organization setting that refuses sessions without a second factor, judged from the provider's amr claim. It accepts any listed factor, or only a hardware key or passkey. API tokens carry no second factor and are not affected.
AuthorizationFour roles, checked on every request against the organization's current membership. Organizations are isolated from each other. API tokens can be limited to projects, to the networks you allow and to a maximum lifetime, can be rotated, and a token can always revoke itself. Production changes need an admin's approval.
Recent sign-inCreating a token, changing the security policy or the session timeout, making someone an admin, changing the recovery window and Delete now need a browser session that signed in at the provider within the last 15 minutes. The console asks the person to Confirm it's you, sends them to the provider with a forced fresh sign-in, and brings them back to repeat the action. The sign-in time is the ID token's auth_time, or the time of sign-in when the provider sends none. API tokens are not asked: a token carries its role without a person present.
Secrets at restEnvelope encryption with AES-256-GCM for every stored secret. API tokens, session tokens and the SCIM token are stored only as hashes. See Secrets and sealing.
AuditAn append-only record of state-changing actions, with the actor and what changed. Reading a secret value is recorded by key, including through an API token's call for a service's resolved variables. See the audit log.
Web surfaceA CSRF header on cookie-authenticated writes, no CORS, a strict Content Security Policy, X-Frame-Options: DENY, no-store on API responses, and request bodies capped at 1 MiB. A shell file upload may carry about 10 MiB, and only on a request that presents a credential.
Abuse limitsPer-address rate limits on sign-in, cluster enrollment and mesh registration. Open event streams are capped per credential and re-check their credential every 30 seconds.
Outbound callsFor hosts you name in the console, such as Git providers, registries, object stores, mail servers and webhooks, the control plane resolves the name first and refuses to connect to loopback, link-local, private and reserved addresses, including the reserved IPv4 blocks and IPv6 addresses that embed one of these IPv4 addresses. This blocks requests aimed at cloud metadata endpoints. A webhook URL must be https:// and a redirect from it is not followed. Mail is sent only over TLS or after STARTTLS, with a certificate that must verify; there is no unencrypted option. The one exception to the address rule is a private SSH target that you explicitly authorize for a cluster install.
Agent linkSingle-use enrollment tokens that expire in an hour, then a bearer token stored hashed. An enrollment token never coexists with an enrolled agent: re-applying the manifest on an enrolled cluster spends it, and replacing the agent revokes the old token first. An admin can rotate the agent token from the console without re-enrolling; the old token stops working 10 minutes after the agent confirms. Removing a cluster stops its tokens working.
Cluster scopeThe agent reads cluster inventory and gets full access only inside the namespaces of environments bound to its cluster. A separate access broker with its own credential grants that access, and it alone reads the kubelet's statistics, calling each node's kubelet directly with a permission limited to those statistics and verifying the kubelet's certificate. It returns only the counters of pods in the environment namespaces. The agent's own namespace enforces the restricted Pod Security level and refuses inbound traffic except the registry port and the agent's calls to the broker. Admission policies bound what the broker can do.
Build isolationA build runs a repository's Dockerfile, so its job is held to one fixed pod shape that an admission policy enforces: images pinned by digest, one non-root user, a fixed command and environment, and CPU, memory and disk limits on every container. Only the BuildKit container runs without the runtime's default syscall filter, which rootless BuildKit needs. The containers that hold the Git token and the registry credential run with the full restricted profile. A quota caps what builds take from a node. Run builds on a dedicated node to keep them off the nodes that run your services.
Registry isolationThe cluster's own registry holds every project's images behind an authenticating proxy, and the registry itself listens only inside its pod. Each build gets a credential for the one repository it builds, which also holds its build cache. Each environment namespace gets a read-only credential for the repositories it runs. Only the agent deletes, nothing lists the catalog, and a request with no credential is refused once the agent has given every namespace one. See Update a cluster agent.
Shell accessAdministrators and owners, and API tokens with the Admin role. A protected environment also needs the organization's Allow shell in protected environments policy, off by default. The browser opens the session socket with a single-use ticket that expires in 30 seconds, and only from the console's own origin. The agent's side authenticates with its cluster token and can attach only to a session of its own cluster, and it can exec only in the namespaces the broker authorized, into pods of NebulaCtrl services. The control plane re-checks the credential, role and policy every minute, allows 5 open shells per credential, and ends a session after one hour or 15 idle minutes.
DeletionA delete keeps the resource, its data, volumes and backups for the organization's recovery window, 48 hours by default and at most 7 days, before a purge removes them. Delete now and changing the window need the admin role.
Generated domainsAn organization proves ownership of its generated domain base once: its Cloudflare token sees the base's zone, or a TXT record under the base carries the proof. A proved base belongs to one organization.
NetworkA WireGuard mesh for all node-to-node traffic. Cluster nodes get a default-deny ufw policy, fail2ban, unattended upgrades and key-only SSH login when a key exists. K3s runs with secrets encryption on.
ContainerThe control plane runs as an unprivileged user, with a read-only filesystem, no Linux capabilities and no-new-privileges. The bundled database is not published on any port.

What you secure

AreaYour responsibility
The hostPatch the operating system and Docker. Limit who can run docker or sudo: that grants access to .env and the database. The updater service runs as the user who installed NebulaCtrl.
Network edgeTerminate TLS with a valid certificate. Keep the control plane reachable only through your proxy, and tell it which proxies to trust.
The master keyProtect .env and back it up separately from database dumps. Rotate it on your schedule. Losing it loses every sealed secret.
The databaseRestrict who can connect, use TLS to an external server, encrypt storage at rest, and back it up. Only listed secrets are sealed; other data, such as member emails, service configuration and variable names, is stored as plain text.
IdentityRun the OIDC provider securely. Enforce multi-factor authentication there, remove people when they leave, and report a second factor in the amr claim if you require one in NebulaCtrl. Deactivating someone at the provider does not end their NebulaCtrl session, which lasts until it is idle for 7 days or reaches 30 days. Remove them from the organization, or deprovision them over SCIM; that takes effect on their next request and ends any open shell or stream within a minute. The provider must honor prompt=login and max_age=0 for the Confirm it's you step; if it answers from an old sign-in and its auth_time says so, NebulaCtrl refuses that sign-in and tells the person.
AccessChoose who is an owner or admin. Review members and API tokens. Give each token the lowest role, a project scope and an expiry.
ClustersSecure the nodes: patching, physical and cloud access, and who holds SSH keys. Keep agents current, and re-apply the install manifest on a cluster installed before a release added permissions to it, such as the shell's pods/exec. Your workloads, their images and their dependencies are outside what NebulaCtrl checks.
IntegrationsKeep Cloudflare, Tailscale, registry, Git and object store credentials narrowly scoped at their providers.
RecoveryTest restores. Keep audit exports if you need them past the life of the organization.

API tokens are credentials for the control plane

An unrestricted API token carries its role across the whole API, including deploying, creating clusters and servers, and changing members, registries and Git connections. A token with the Deployer role or higher also reads secret values in plain text through a service's resolved variables. A few operations, such as creating tokens or organizations, are refused to every token. A stolen admin token needs no sign-in and no second factor. See Create an API token.

Boundaries

  • NebulaCtrl has no local accounts and no second factor of its own.
  • Sealing protects the database and its backups. It does not protect a running control plane from someone who controls the host, because the process holds the key.
  • Secret values reach your clusters as Kubernetes Secrets in the environment's namespace. Anyone who can read those Secrets in the cluster can read the values.
  • The audit record covers actions taken through NebulaCtrl. Direct changes to the database or to a cluster do not appear in it.
  • A browser shell into an instance is a way to read everything the service can read, secrets included. It is limited to administrators and owners, off by default in protected environments, ends after one hour or 15 idle minutes, and is recorded as a start and an end, with each file listing, download and upload. What is typed is not recorded, so the audit record cannot say what was run in a shell.
  • A session's idle timeout counts requests. An open shell or live event stream is the session in use, so it does not end a session for being idle; signing out, revoking the session and deprovisioning the person do end it, within a minute.
  • A deleted resource keeps its data until the recovery window ends or an admin selects Delete now. With Delete at once the window is zero.

Report a vulnerability

Email [email protected], not a public issue. Include the version, how to reproduce it and what an attacker gains. You get an acknowledgement within 3 business days and an assessment within 10. Fixes ship in the latest release, normally within 90 days, and the changelog names them once the release is out. Good-faith research against an installation you run or are authorized to test is welcome; stop as soon as you reach data that is not yours. The same contact is in /.well-known/security.txt on this site and on get.nebulactrl.dev.

On this page