Skip to content

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 admin and stores it in the Secret tenax-initial-admin:

    kubectl -n tenax-system get secret tenax-initial-admin -o jsonpath='{.data.password}' | base64 -d
    

    Log in with it (tenax console opens 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 (for tenax 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 groups claim (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 clientSecret out and use your tenant's issuer (https://login.microsoftonline.com/<tenant-id>/v2.0). Entra does not send email_verified: add the optional claim xms_edov, or set requireVerifiedEmail: 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 from auth.roles (k8s:system:serviceaccount:ci:deployer, group:<group>) or from Kubernetes RBAC on the resource roles of the API group tenax.republic.global in Tenax's namespace, with the role as the verb:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: Role
    metadata: { name: tenax-operator, namespace: tenax-system }
    rules: [{ apiGroups: [tenax.republic.global], resources: [roles], verbs: [operator] }]
    
  • The CLI. tenax login --server https://tenax.example.com opens 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 to tenax-api. People open https://tenax.example.com in a browser, or run tenax login --server https://tenax.example.com once, and log in with their email; they never need a kubeconfig. Their role comes from auth.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 set auth.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 with export TENAX_SERVER=http://127.0.0.1:8080. With auth.provider: cloudflare-access the forward needs no Access login: it reaches a port tenax-api serves only on 127.0.0.1 inside its pod, which only kubectl port-forward can reach, so Kubernetes RBAC (pods/portforward in Tenax's namespace) decides who gets in, with the role auth.portForwardRole (default restorer-admin; empty turns the port off). With auth.provider: tenax the forwarded console asks for a login like any other address (auth.portForwardSkipsLogin restores 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.