List All Setup Keys
Returns a list of all setup keys.Unique setup key identifier
Setup key as a masked secret (full key only shown on creation)
Setup key name identifier
Expiration date (ISO 8601 format)
Key type:
reusable or one-offWhether the key is currently valid
Whether the key has been revoked
Number of times this key has been used
Last time the key was used (ISO 8601 format)
Key state:
valid, overused, expired, or revokedGroup IDs to auto-assign to peers using this key
Usage limit (0 = unlimited)
Whether peers enrolled with this key are ephemeral
Allow extra DNS labels to be added to the peer
Get a Setup Key
Retrieve details about a specific setup key.The unique identifier of the setup key
Example
Create a Setup Key
Generate a new setup key for peer enrollment.Setup key name
Key type:
reusable or one-offExpiration time in seconds (86400-31536000, i.e., 1 day to 1 year)
Group IDs to auto-assign to peers registered with this key
Usage limit (0 = unlimited)
Whether peers should be ephemeral
Allow extra DNS labels to be added to peers
Update a Setup Key
Update setup key configuration.The unique identifier of the setup key
Revoke or un-revoke the setup key
Group IDs to auto-assign (replaces existing groups)
Delete a Setup Key
Permanently delete a setup key.The unique identifier of the setup key
Example
Deleting a setup key does NOT remove peers that were enrolled with it. It only prevents future enrollments.
Key Types
Reusable Keys
Can be used multiple times until expired or revoked:- Server deployments
- Container orchestration
- IoT device fleets
- Development environments
One-Off Keys
Can only be used once:- Individual device enrollment
- Temporary access
- High-security environments
Key States
Valid
Key is active and can be used
Expired
Key has passed its expiration date
Revoked
Key has been manually revoked
Overused
Key has exceeded its usage limit
Ephemeral Peers
Peers enrolled with ephemeral keys are automatically cleaned up:- Automatically removed when disconnected
- Don’t persist in the network
- Ideal for temporary access or testing
Using Setup Keys
Linux/macOS
Windows
Docker
Kubernetes
Auto-Groups
Peers enrolled with a setup key are automatically added to specified groups:- Automatic policy application
- Simplified network segmentation
- Role-based access control
Security Best Practices
Limit expiration - Use the shortest reasonable expiration period
Use one-off keys - For individual devices when possible
Set usage limits - Prevent unlimited use of reusable keys
Revoke unused keys - Regularly audit and revoke old keys
Rotate keys - Create new keys periodically for ongoing deployments
Secure storage - Store keys in secrets managers, not version control
Monitor usage - Track
used_times and last_used to detect anomalies