Console, CLI and access¶
The console and the CLI use the same JSON API (reference), so they share authentication, roles and the audit log.
Logging in¶
By default (auth.provider: tenax) Tenax has its own login page, and nothing in the console or the API answers
without a login.
-
The administrator account. At its first start Tenax generates a password for the user
adminand stores it in the Secrettenax-initial-admin:Log in with it (
tenax consoleopens the console): Tenax asks you to choose your own password at once, then deletes that Secret. Ten wrong passwords within 15 minutes lock the account for 15 minutes. If the password is lost,tenax admin reset-password(through your kubeconfig) generates a new one and signs everyone out. Turn the account off (auth.admin.enabled: false) once single sign-on works. -
Single sign-on. Any OIDC provider works: Google Workspace, Microsoft Entra ID, Okta, Keycloak, Dex, GitLab. Create an OIDC client (a web application) there with the redirect URI
https://<console>/auth/callback(fortenax console:http://127.0.0.1:8080/auth/callback), put its secret in a Secret, and set:auth: oidc: issuer: https://accounts.google.com clientID: 1234-abc.apps.googleusercontent.com clientSecret: { name: tenax-oidc, key: clientSecret } name: Google roles: viewer: ["*@example.com"] restorer-admin: [alice@example.com, "group:tenax-admins"]The identity provider keeps the accounts, passwords and MFA; Tenax keeps none. Tenax needs a verified email, reads groups from the
groupsclaim (auth.oidc.groupsClaim) and gives each person the highest role that matches; someone who matches none cannot log in.No client secret is needed for a public client: the code flow always uses PKCE. With Microsoft Entra ID, register the redirect URI under Mobile and desktop applications, turn on Allow public client flows, leave
clientSecretout and use your tenant's issuer (https://login.microsoftonline.com/<tenant-id>/v2.0). Entra does not sendemail_verified: add the optional claimxms_edov, or setrequireVerifiedEmail: false(accounts without an email then sign in with their user principal name). -
Kubernetes tokens, for CI and scripts:
TENAX_TOKEN=$(kubectl -n ci create token deployer) tenax targets. The role comes fromauth.roles(k8s:system:serviceaccount:ci:deployer,group:<group>) or from Kubernetes RBAC on the resourcerolesof the API grouptenax.republic.globalin Tenax's namespace, with the role as the verb: -
The CLI.
tenax login --server https://tenax.example.comopens the console in your browser; once you log in and allow it, the CLI gets a session for 12 hours.
Restorer-admins give roles to more people on the console's Access page (in the account menu); those add to
auth.roles. Sign out everyone there ends every session within 30 seconds. A session lasts 12 hours.
Roles¶
| Role | Can |
|---|---|
viewer |
See targets, backups, diffs, change summaries, restores and sandboxes. |
operator |
+ back up now, verify now, pause and resume, restore to a sandbox, query and manage sandboxes, read the audit log. |
restorer |
+ restore to a new database or a download. |
restorer-admin |
+ restore in place, pin and unpin backups. |
Roles map from emails and Cloudflare Access groups in the chart:
auth:
provider: cloudflare-access
roles:
viewer: ["*@example.com"]
operator: ["group:sre"]
restorer: [alice@example.com]
restorer-admin: [bob@example.com]
scopes: # optional: limit someone to some orgs or projects
contractor@example.com: { orgs: [acme] }
Tenax verifies the Cf-Access-Jwt-Assertion JWT (team domain and audience) on every request, so a request that
bypasses the tunnel is rejected. When Tenax publishes the console (below) it finds the team domain and the audience
itself; for an Access application you manage, set auth.cloudflareAccess.teamDomain and audience. With auth.provider: none there is no login: the API's network port refuses every request, and only tenax console (a kubectl port-forward through your kubeconfig) gets in, with auth.portForwardRole.
Reaching the console¶
There are two ways in, and they can be used together:
-
For people without cluster access: a public address behind a login. Set a hostname and Tenax publishes the console there through its Cloudflare tunnel: an Access application that lets in the same people as the sandbox routes (
expose.cloudflare.allowEmails/allowGroups), a DNS record and a route totenax-api. People openhttps://tenax.example.comin a browser, or runtenax login --server https://tenax.example.comonce, and log in with their email; they never need a kubeconfig. Their role comes fromauth.roles.auth: provider: cloudflare-access roles: { viewer: ["*@example.com"], restorer: [alice@example.com] } expose: provider: cloudflare cloudflare: { zone: example.com, apiTokenSecret: tenax-cloudflare-api, allowEmails: ["*@example.com"] } cloudflared: { enabled: true, consoleHostname: tenax.example.com }The controller keeps the route in place and stores the application's team domain and audience in the Secret
tenax-console-access, which tenax-api reads; until it exists the console answers "console login not ready". To read the team domain, the API token needs Access: Organizations, Identity Providers, and Groups: Read; without it Tenax reads it from the console's login redirect, or setauth.cloudflareAccess.teamDomain. -
For people with cluster access:
tenax console. It forwards a local port to the console through your kubeconfig and opens it in your browser. It keeps running until Ctrl+C; from another terminal, the other commands use it withexport TENAX_SERVER=http://127.0.0.1:8080. Withauth.provider: cloudflare-accessthe forward needs no Access login: it reaches a port tenax-api serves only on127.0.0.1inside its pod, which onlykubectl port-forwardcan reach, so Kubernetes RBAC (pods/portforwardin Tenax's namespace) decides who gets in, with the roleauth.portForwardRole(defaultrestorer-admin; empty turns the port off). Withauth.provider: tenaxthe forwarded console asks for a login like any other address (auth.portForwardSkipsLoginrestores the shortcut).
The CLI¶
Installing it and connecting it: Install the CLI. All commands: CLI reference.
The audit log¶
Every write (backup now, restore, pin, sandbox changes) and every query is recorded with the user, role, target, outcome and source address, in tenax-api's structured logs and on the console's Audit page.