Turn on authentication
Make every node check a credential on every call, and issue API keys and tokens to your clients.
By default novad runs with --auth off, so anyone who reaches a node's port may do anything. Turning authentication on makes every node check a credential on every call: from clients, from the HTTP data bridge, and from the other nodes. This page turns on token authentication with keys the nodes hold, issues API keys to applications, and rotates the keys later.
Clients notice the switch. Once a node checks credentials, a call without one fails with unauthenticated. API keys work only once the nodes run jwt: before that, a client given one fails at its first exchange. So switch while you set the cluster up, or plan a short window in which clients move to their keys.
Choose a mode
--auth (or NOVAD_AUTH) sets one mode for every caller of a node, clients and other nodes alike.
| Mode | The caller shows | It may | The node needs | Use when |
|---|---|---|---|---|
jwt | A signed token | Exactly what the token's scope grants | One key source | Production. Each client gets only the buckets and actions it needs. |
mtls | A client certificate | Everything | --tls-cert, --tls-key, --tls-client-ca | Every client is a trusted service you issue certificates to |
basic | The operator's user name and password | Everything | --admin-username, NOVAD_ADMIN_PASSWORD | A small private deployment with one operator |
off | Nothing | Everything | Nothing | Development, or a network only trusted services reach |
Only jwt limits what each caller may do. Use it unless every caller is trusted.
How token authentication works
A token is a signed JSON Web Token (JWT). Its scope claim lists grants such as nova:read:orders:*, and its sub claim names the caller for logs. A node can do up to three things with tokens:
| Job | What it does | What the node needs |
|---|---|---|
| Verify | Checks every call's token and its scope against the bucket, key and action | Public keys, a JWKS URL, an OIDC issuer, or an HMAC secret |
| Sign | Mints the five-minute tokens it shows other nodes | A private key or an HMAC secret |
| Exchange | Trades an application's long-lived API key for a short-lived token | A signer, and the API keys stored in the cluster |
The steps below give every node a private key, so every node does all three.
Before you start
- Turn on TLS first, or put a proxy that terminates TLS in front of the nodes; see Secure the network. Tokens and passwords also work over plaintext, but then anyone on the path can read them.
- Have the
novacommand line on a node's machine. The examples use the node directory/var/lib/nova.
Turn on token authentication
Create a signing key
nova auth key create --id k1 --dir /var/lib/novaCreated key k1 in /var/lib/nova/auth/var/lib/nova/auth/
active-key names the key that signs: k1
keys/
k1.private.pem readable by its owner only
k1.public.pemcreate makes an Ed25519 key. nova auth key import takes an existing unencrypted PKCS8, RSA (2048 bits or more) or EC private key instead. A key ID is 1 to 128 letters, digits, underscores or hyphens. Copy the auth/ directory to every node's --dir, so every node signs and verifies with the same key.
Generate the root API key
The first API key has nova:admin and lets you create the others:
nova credential generate --seed-out /etc/nova/root.jsonapi_key: nova_sk_de1a873c2d8c9154_0AoL…
key_id: de1a873c2d8c9154
seed: /etc/nova/root.jsonThe key prints once; store it in your secret manager. The seed file holds only the secret's hash, so it is safe to copy to every node:
{
"key_id": "de1a873c2d8c9154",
"scope": "nova:admin",
"secret_hash": "503d724225823dd305be89ef21b8f50479a5a99d283f3df3cafd86efe02ddf68"
}Restart the nodes with authentication on
Add these flags to every node. Stop every node, then start them all. Do not switch one node at a time: a node still on off shows the others no credential, so the nodes already on jwt refuse its calls.
novad … --auth jwt --root-credential-file /etc/nova/root.jsonThe startup table shows auth jwt. A call without a credential is now refused, and the root key works:
nova --addr nova-1:7780 ls
NOVA_API_KEY=nova_sk_de1a873c2d8c9154_0AoL… nova --addr nova-1:7780 healthnovactl: client: unauthenticated: auth: no credential
SERVING node=01a2047e-3bea-78eb-8836-38ec749af4dd zone=az-1 version=… leading=0Give each application its own API key
With the root key set in NOVA_API_KEY, create a key with only the grants an application needs:
export NOVA_ADDR=nova-1:7780
nova credential create --name orders-app --scope 'nova:append:orders:* nova:read:orders:*'
nova credential listapi_key: nova_sk_bf352328bb0a6d86_Vr5u… (shown once — only the secret's hash is stored)
key_id: bf352328bb0a6d86
name: orders-app
scope: nova:append:orders:* nova:read:orders:*
bf352328bb0a6d86 orders-app active 2026-11-22T18:22:36Z nova:append:orders:* nova:read:orders:*
de1a873c2d8c9154 root active 2026-11-22T18:22:04Z nova:adminA grant is nova:<action>:<bucket>:<key>, and a trailing * matches a prefix. The actions are append, read, list, create, delete and trim. The full grammar is in Scopes. Outside its grants, the key is refused:
novactl: client: authorize: client: api-key exchange: rpc error: code = PermissionDenied desc = exchange: the credential covers nothing in bucket "billing"How clients get tokens
The exchange
An SDK or the nova command line given an API key trades it for a token, and trades again before the token expires. The token's sub is the key ID, and its scope is the key's grants, narrowed to what the client asks for. A token lives 15 minutes unless the client asks otherwise, and at most one hour. With the root key in NOVA_API_KEY:
nova token exchange --bucket orders --ttl 10meyJhbGciOiJFZERTQSIsImtpZCI6ImsxIiwidHlwIjoiSldUIn0.eyJleHAiOjE3OTUzNzIzNTcs…Its claims, decoded: the root key's nova:admin, narrowed to every action in orders.
{
"exp": 1795372357,
"iat": 1795371757,
"scope": "nova:append:orders:* nova:read:orders:* nova:list:orders:* nova:create:orders:* nova:delete:orders:* nova:trim:orders:*",
"sub": "de1a873c2d8c9154"
}nova credential revoke bf352328bb0a6d86 stops a key at once: its next exchange fails with exchange: the credential is revoked. Tokens it already received keep working until they expire, which is why they are short.
Minting offline
On a machine that holds the signing key, nova token mint signs a token directly, for a service that cannot hold an API key. Nothing can revoke such a token, so give it a short life:
nova token mint --dir /var/lib/nova --scope 'nova:read:orders:*' --subject reporting --ttl 1hA node refuses whatever the token's scope does not grant:
novactl: rpc error: code = PermissionDenied desc = dataplane: no grant covers append on orders/euRotate signing keys
Add the new key everywhere
Create the key on one node, then copy k2.private.pem and k2.public.pem into every node's auth/keys/. Keep k1, so the tokens it signed stay valid. Then restart the nodes one at a time: nodes read keys only at startup, and every node must verify k2 before any node signs with it.
nova auth key create --id k2 --dir /var/lib/nova
nova auth key list --dir /var/lib/novaCreated key k2 in /var/lib/nova/auth
k1 sign, verify
k2 verifySign with the new key
On every node, activate it, then restart the nodes one at a time.
nova auth key activate --dir /var/lib/nova k2
nova auth key list --dir /var/lib/novak1 verify
k2 sign, verifyNew tokens carry "kid":"k2" in their header, and a token signed with k1 before the switch still works. Export the keys again for any Gateway or other verifier, and restart it.
Remove the old key
Wait until the last token signed with k1 has expired: one hour after the switch for exchanged tokens, longer for any you minted. Then delete k1.* from every node and restart them again.
Where keys come from
Without key flags, a node reads auth/ under its --dir. Flags, then NOVAD_* variables, then the YAML file replace that directory as a whole: public keys from the environment, for example, do not pick up a private key from disk.
The novad reference lists every authentication flag.
Use your own token issuer
If your application already issues tokens, the nodes can verify them instead. Your issuer then puts Nova grants in the scope claim. Give a node exactly one source:
A node with a JWKS URL or an OIDC issuer can verify but not sign. It then needs --peer-service-token-file (or NOVAD_PEER_SERVICE_TOKEN), a token with nova:node from your issuer to show other nodes, and it refuses to start without one. Its exchange answers Unimplemented, or HTTP 501, so clients need tokens from your issuer.
The root credential
The root credential is optional. Without one, an operator mints an admin token offline with nova token mint --admin --subject <name> to create API keys. Set at most one of:
A node creates the root credential only if its key ID is not stored yet. It never overwrites a stored one, so later changes and a revocation stay. To rotate the root key, generate a new one, switch to it, then revoke the old ID.
Peers and the Gateway
A signing node mints itself a token with nova:node that lives five minutes, and shows it on every call to another node. That grant opens the other node's fleet listener and admits the calls nodes make of each other. Among them, a node may read, trim and delete records on another node, so treat a nova:node token like the signing key. A verify-only node shows the peer service token instead, and reads its file again on every call, so replace the file before the token expires.
The data bridge checks HTTP callers with the node's own mode. The Gateway forwards each caller's token unchanged, and can check it first; see Run the Gateway.
Basic and mutual TLS
Under --auth basic, the operator logs in with the user name and the password from NOVAD_ADMIN_PASSWORD:
NOVAD_ADMIN_PASSWORD=s3cret-pass novad … --auth basic --admin-username ops
nova --addr nova-b:7780 --admin-user ops --admin-password s3cret-pass healthSERVING node=01a20484-3cb1-7871-b8c1-4fa28071e71f zone= version=… leading=0Under --auth mtls, a client certificate signed by --tls-client-ca is the credential. A client without one cannot connect:
novad … --auth mtls --tls-cert server.pem --tls-key server.key --tls-client-ca ca.pem
nova --addr nova-1:7780 --tls-ca ca.pem --tls-cert client.pem --tls-key client.key health
nova --addr nova-1:7780 --tls-ca ca.pem healthSERVING node=01a2048a-8f74-7c61-93b9-1a7d2b0b9f4c zone= version=… leading=0
novactl: rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: remote error: tls: certificate required"Plaintext credentials
A node with jwt or basic and no TLS, listening on an address other than loopback, serves anyway and warns once at startup:
[WARN] novad: credentials over plaintext: bearer tokens and passwords cross a non-loopback listener unencrypted; configure TLS auth=basic listen=:7780 http_listen="" fleet_listen=""The retired --insecure-auth flag is still accepted, does nothing, and is reported once at startup:
[WARN] novad: retired flag accepted for one release flag=--insecure-auth use="nothing: plaintext credentials are accepted; configure TLS to encrypt the wire"If it goes wrong
| Symptom | Likely cause | What to do |
|---|---|---|
unauthenticated: auth: no credential | The client sent no token, API key or login | Set NOVA_API_KEY, NOVA_TOKEN, or the login |
PermissionDenied … no grant covers <action> on <bucket>/<key> | The token's scope lacks that grant | Issue a key or token with the grant |
exchange: the credential covers nothing in bucket | The API key has no grant in that bucket | Create a key with a grant there |
exchange: the credential is revoked | The key was revoked | Give the client a new key |
missing or unknown kid | A verifier lacks the signing key, often after a rotation | Copy the public key to every verifier and restart it |
token signature is invalid | A verifier holds a different key under the same key ID | Give every node and verifier the same key files |
Startup fails: --auth jwt needs one source | No key, or more than one source | Configure exactly one source |
Startup fails: --auth jwt without a signer needs --peer-service-token-file | A verify-only node has no peer token | Give it a nova:node token from your issuer |
Startup fails: --auth mtls needs --tls-client-ca | mTLS without a client CA | Add --tls-client-ca and the server pair |
Exchange answers 501 | The node cannot sign | Give clients tokens from your issuer |