Turn on authentication

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.

ModeThe caller showsIt mayThe node needsUse when
jwtA signed tokenExactly what the token's scope grantsOne key sourceProduction. Each client gets only the buckets and actions it needs.
mtlsA client certificateEverything--tls-cert, --tls-key, --tls-client-caEvery client is a trusted service you issue certificates to
basicThe operator's user name and passwordEverything--admin-username, NOVAD_ADMIN_PASSWORDA small private deployment with one operator
offNothingEverythingNothingDevelopment, 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:

JobWhat it doesWhat the node needs
VerifyChecks every call's token and its scope against the bucket, key and actionPublic keys, a JWKS URL, an OIDC issuer, or an HMAC secret
SignMints the five-minute tokens it shows other nodesA private key or an HMAC secret
ExchangeTrades an application's long-lived API key for a short-lived tokenA 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 nova command 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/nova
Created 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.pem

create 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.json
api_key: nova_sk_de1a873c2d8c9154_0AoL…
key_id:  de1a873c2d8c9154
seed:    /etc/nova/root.json

The 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.json

The 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 health
novactl: client: unauthenticated: auth: no credential
SERVING  node=01a2047e-3bea-78eb-8836-38ec749af4dd zone=az-1 version=… leading=0

Give 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 list
api_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:admin

A 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 10m
eyJhbGciOiJFZERTQSIsImtpZCI6ImsxIiwidHlwIjoiSldUIn0.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 1h

A node refuses whatever the token's scope does not grant:

novactl: rpc error: code = PermissionDenied desc = dataplane: no grant covers append on orders/eu

Rotate 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/nova
Created key k2 in /var/lib/nova/auth
k1	sign, verify
k2	verify

Sign 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/nova
k1	verify
k2	sign, verify

New 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.

--jwt-private-key-fileNOVAD_JWT_PRIVATE_KEY_FILE
The signing key's PEM file; its name gives the key ID
--jwt-private-keyNOVAD_JWT_PRIVATE_KEY
The signing key's PEM itself; set it in the environment, never on the command line
--jwt-public-keys-fileNOVAD_JWT_PUBLIC_KEYS_FILE
A JWKS file of verifying keys, each with a kid; keep old keys in it during a rotation
--jwt-signing-key-idNOVAD_JWT_SIGNING_KEY_ID
The key that signs, when several are loaded
--jwt-issuerNOVAD_JWT_ISSUERDefaultunchecked
The required iss claim; minted tokens carry it
--jwt-audienceNOVAD_JWT_AUDIENCEDefaultunchecked
The required aud claim; minted tokens carry it

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:

--jwt-jwks-urlNOVAD_JWT_JWKS_URL
A JWKS URL, fetched at startup and again every hour
--jwt-oidc-issuerNOVAD_JWT_OIDC_ISSUER
An OIDC issuer, whose JWKS the node discovers; tokens must carry it as iss
--jwt-hmac-keysNOVAD_JWT_HMAC_KEYS
Named HS256 secrets as id:secret,…; the first signs and all verify
--jwt-hmac-secret-fileNOVAD_JWT_HMAC_SECRET_FILE
One HS256 secret, without named rotation

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:

--root-credential-fileNOVAD_ROOT_CREDENTIAL_FILE
The seed file from nova credential generate --seed-out
--root-credentialNOVAD_ROOT_CREDENTIAL
The same JSON inline; it holds only a hash, so the environment is safe
--root-api-keyNOVAD_ROOT_API_KEY
The root API key itself, hashed at startup; set it in the environment, never on the command line

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 health
SERVING  node=01a20484-3cb1-7871-b8c1-4fa28071e71f zone= version=… leading=0

Under --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 health
SERVING  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

SymptomLikely causeWhat to do
unauthenticated: auth: no credentialThe client sent no token, API key or loginSet NOVA_API_KEY, NOVA_TOKEN, or the login
PermissionDenied … no grant covers <action> on <bucket>/<key>The token's scope lacks that grantIssue a key or token with the grant
exchange: the credential covers nothing in bucketThe API key has no grant in that bucketCreate a key with a grant there
exchange: the credential is revokedThe key was revokedGive the client a new key
missing or unknown kidA verifier lacks the signing key, often after a rotationCopy the public key to every verifier and restart it
token signature is invalidA verifier holds a different key under the same key IDGive every node and verifier the same key files
Startup fails: --auth jwt needs one sourceNo key, or more than one sourceConfigure exactly one source
Startup fails: --auth jwt without a signer needs --peer-service-token-fileA verify-only node has no peer tokenGive it a nova:node token from your issuer
Startup fails: --auth mtls needs --tls-client-camTLS without a client CAAdd --tls-client-ca and the server pair
Exchange answers 501The node cannot signGive clients tokens from your issuer

See also

On this page