Enrollment Tokens and Ephemeral Machines
Create automatically approved, short-lived machine identities with predefined projects, secret grants, enrollment limits, and optional network and hostname restrictions.
Enrollment tokens create short-lived machine identities for CI jobs, autoscaling services, serverless functions, preview environments, and other workloads that appear and disappear automatically. Each machine is approved as it enrolls, receives the projects and secret grants defined by the token, and stops authenticating when its lifetime ends.
The enrollment token registers machines; it does not read secrets. After enrollment, each machine uses its own Ed25519 private key to sign requests, and the token is no longer part of the secret-read path.
#Choose the right machine type
Use the lifecycle that matches the workload:
Machine type | Best suited to | How access begins | Lifetime |
|---|---|---|---|
A long-running server, workstation, or trusted host | A bootstrap command registers the host, then a person approves it and configures access | Continues until disabled or revoked | |
One time-bounded engagement, incident, or contractor host | A single bootstrap command registers the host, then a person approves it and configures access | One hour to twelve months, with optional extensions | |
Ephemeral machine | CI, autoscaling, serverless, short-lived containers, and preview deployments | An enrollment token approves the machine and applies its projects and secret grants automatically | One minute to 90 days, fixed when the machine enrolls |
A single enrollment token can create many ephemeral machines from the same policy. Each enrollment still creates a separate machine ID and keypair, so reads remain attributable to the individual machine.
#How enrollment works
Create an enrollment token with a project and secret scope, a token lifetime, a machine lifetime, and a maximum number of enrollments.
Store the displayed token or enrollment command in the deployment system that will create the machines.
At startup, the workload generates an Ed25519 keypair locally.
The workload sends the public key and its enrollment details to SikkerKey.
SikkerKey checks the token, its restrictions, the referenced projects and secrets, and the vault machine allowance.
SikkerKey creates an approved ephemeral machine and applies the projects and secret grants stored on the token.
The machine signs each read with its private key until its machine lifetime ends.
The token lifetime and machine lifetime are independent. When the token expires, is exhausted, or is revoked, it stops creating new machines. Machines it already created continue until their own expiration unless you disable or revoke them separately.
#Create an enrollment token
Open Enrollment Tokens from the Vault section of the dashboard.
Select the plus button.
Enter a name and, optionally, a description that identifies the deployment or fleet.
Select at least one project. Selecting a project initially selects all of its current secrets.
Open each selected project on the right and clear any secrets the workload does not need. The dashboard requires at least one project and one secret grant.
Select Continue.
Set the token lifetime, machine lifetime, and maximum number of enrollments.
Add any source CIDR, hostname pattern, or machine-name pattern you want to enforce.
Review the scope summary and select Create token.
Selecting a project grants all of its current secrets by default. Open the project before continuing and reduce the selection to the secrets the workload actually needs.
Limits
Setting | Allowed value | What it controls |
|---|---|---|
Token lifetime | 5 minutes to 90 days | How long the token accepts new enrollments |
Machine lifetime | 1 minute to 90 days | How long each machine created by the token can authenticate |
Maximum enrollments | 1 to 10,000 | How many successful machine registrations the token can create |
Projects | 1 to 50 | The projects each enrolled machine joins |
Secret grants | 1 to 500 in the dashboard | The specific secrets each enrolled machine can read |
Token settings are fixed after creation. To change the project scope, secret grants, lifetime, restrictions, or capacity, create a replacement token and revoke the old one after the new deployment is ready. Secrets created later are not added to an existing token automatically.
#Add enrollment restrictions
Restriction | Behavior | Example |
|---|---|---|
Source CIDR | Allows enrollment only when the request comes from the specified network range. It is checked during enrollment. |
|
Hostname pattern | Requires the hostname reported by the workload to match a regular expression. |
|
Name pattern | Generates a consistent, unique dashboard name for each machine. A token name pattern takes priority over a name requested by an SDK. |
|
A name pattern supports {uuid} for eight random lowercase letters and numbers, or {uuidN} for 4 to 32 characters. For example, worker-{uuid12} can create a name such as worker-f4k9m2q7r1dx.
The vault IP Allowlist also applies during enrollment and during later secret reads. The token’s source CIDR is an additional enrollment restriction. After enrollment, project availability, the machine’s explicit grants, and any policy attached to a secret are checked on every read.
#Copy the token and enrollment commands
After creation, SikkerKey shows the plaintext token and ready-to-run Linux, macOS, and Windows commands. This is the only time the plaintext is available from the dashboard.
curl -sSL https://api.sikkerkey.com/v1/VAULT_ID/enroll/TOKEN | shirm https://api.sikkerkey.com/v1/VAULT_ID/enroll/TOKEN/ps | iexCopy the token or complete command before closing the result. Sensitive clipboard copies are cleared after 30 seconds when the browser permits it. If the value is lost, create a replacement token; the stored token cannot be revealed later.
Keep an enrollment token in your CI or hosting platform’s protected secret store. Do not commit the plaintext token or a command containing it to a repository.
#Enroll a machine with the command
The enrollment script:
checks for
opensslandcurl;generates an Ed25519 keypair on the machine;
sends only the public key, token, and hostname to SikkerKey;
stores the identity under
~/.sikkerkey/vaults/{vaultId}/on Linux and macOS, or under%USERPROFILE%\.sikkerkey\vaults\{vaultId}\on Windows;applies restrictive file permissions on Linux and macOS; and
records the machine ID, name, service address, key location, and expiration in the identity file.
The machine is approved immediately and can use the token’s grants as soon as enrollment completes. No separate approval or access-configuration step is required.
Running another enrollment command for the same vault replaces the identity files on that host and creates another machine record. The earlier machine remains in the dashboard until it expires or you revoke it.
#Enroll without writing an identity to disk
Serverless functions and read-only containers can enroll directly through a SikkerKey SDK. The SDK creates the keypair in memory, registers an ephemeral machine, and uses the in-memory private key for signed reads. The private key disappears when the process ends.
Node.js
import { SikkerKey } from '@sikkerkey/sdk'
const sk = SikkerKey.bootstrap(
process.env.SIKKERKEY_VAULT_ID,
process.env.SIKKERKEY_ENROLLMENT_TOKEN,
).inMemory()
const value = await sk.getSecret('sk_example')Python
import os
from sikkerkey import SikkerKey
sk = SikkerKey.bootstrap_in_memory(
os.environ["SIKKERKEY_VAULT_ID"],
os.environ["SIKKERKEY_ENROLLMENT_TOKEN"],
)
value = sk.get_secret("sk_example")Memory-only bootstrap is also available in the Go, .NET, Kotlin/JVM, and PHP SDKs. Use a short machine lifetime for cold-started workloads, choose a maximum-enrollment count that covers expected starts and concurrency, and use a unique name pattern so instances are easy to distinguish in the dashboard.
Each new process or cold start can consume another token use and create another machine. A warm process reuses its in-memory identity according to the behavior of its SDK.
#Understand token status
Status | Meaning |
|---|---|
Active | The token is within its lifetime and still has enrollment uses available. |
Exhausted | All allowed enrollments have been used. |
Expired | The token lifetime has ended. |
Revoked | A vault member stopped the token manually. |
The Enrollment Tokens table shows the token name and description, status, used and maximum enrollments, enrolled machine count, machine lifetime, token expiration, and creation time. Search by name or description. Revoked tokens are hidden by default; select Show revoked to include them.
Open Configure to review the token’s projects, secret grants, restrictions, machine lifetime, remaining uses, and machines enrolled through it. The machine list shows current status and last-seen activity, with additional rows available through Load more.
#Revoke a token
Open Enrollment Tokens.
Open the token’s row menu and select Revoke, or open Configure and select Revoke token.
Enter an optional reason.
Review the confirmation and select Revoke Token.
Revocation takes effect immediately for new enrollments and cannot be reversed. It does not disable or revoke machines already created by that token. Open Machines and revoke those machine identities separately when they must stop immediately.
#Manage enrolled machines
Ephemeral machines appear in All Machines with an ephemeral badge and their remaining lifetime. From the machine row you can:
rename the machine;
open History to review name changes and audit activity;
disable it before expiration and enable it again while its lifetime remains active; or
revoke it immediately, removing its registration, project memberships, and secret grants.
The machine lifetime is fixed at enrollment. When a workload needs a different lifetime, enroll a replacement through an appropriately configured token.
#Expiration and cleanup
Time | Result |
|---|---|
At the machine expiration | Authentication stops. The dashboard records the machine as expired during the next cleanup pass. |
During the next 30 days | The expired machine remains available for status, attribution, and history review. |
After 30 days | Automatic cleanup removes the machine record, project memberships, and secret grants. |
An expired or disabled machine no longer counts as an active machine for the vault’s machine allowance. A retained record can still appear in token and machine views until automatic cleanup removes it.
A token’s own expiration is separate. It simply stops accepting new enrollments and receives an expiration entry in the Audit Log. Existing machines keep their individual lifetimes.
#Permissions
Permission | Access provided |
|---|---|
View enrollment tokens | View token status, configuration, scope, restrictions, usage, and enrolled machines. |
Manage enrollment tokens | Create and revoke enrollment tokens. |
View machines | View enrolled ephemeral machines and their history. |
Manage machines | Rename, disable, enable, or revoke enrolled machines. |
Vault owners receive full access. Organization members receive these permissions through their vault role. When a member creates a token, its projects must also be within that member’s project access.
#Troubleshoot enrollment and access
Symptom | What to check |
|---|---|
The token is no longer visible in plaintext | Plaintext is shown only when the token is created. Create a replacement token and revoke the old one if its value was not saved. |
Continue is unavailable while creating a token | Enter a name and select at least one project and one secret. Open the selected project to verify its grants. |
Enrollment is rejected | Check whether the token is active and has uses remaining, then check the vault IP Allowlist, token source CIDR, hostname pattern, referenced projects and secrets, and the vault machine allowance. |
The machine has an unexpected name | A token name pattern overrides the name requested by the enrollment script or SDK. |
The machine cannot read a granted secret | Check its expiration and enabled state, the vault IP Allowlist, project availability, the explicit grant, and any access policy attached to the secret. |
Many expired machines remain visible | Expired records are retained for 30 days for review. Use status filters to narrow the Machines view while automatic cleanup completes. |
A revoked token’s machines still work | Token revocation stops future enrollments only. Revoke the individual machines from All Machines for immediate cutoff. |