06 Security Access And Sovereignty

Security, Access, And Sovereignty

Klok security is built from tenant/domain boundaries, role-aware GUI behavior, service principals, scoped secrets, broker ACLs, and searchable observability.

Sources Of Truth

  • GitLab root groups: tenants and source repositories.
  • Keycloak: identity, groups, roles, and runtime clients.
  • Vault: client secrets and project secrets.
  • Pulsar: topics and namespaces. Its grants are described in Git, in each tenant's Pulsar file in klok/environment/klok-environment-setup, and applied by a person.
  • OpenSearch: logs, observability, audit, and ODL-style data.
  • Admin GUI database: cached metadata and provisioning status.

User Roles

Six roles, KlokAdmin, KlokDeveloper, TenantAdmin, TenantDeveloper, DomainAdmin and DomainDeveloper, each come from a Keycloak group, such as /tenants/<tenant>/admins. Access: Roles, Groups, And Tenants says what each role may do, lists the groups, explains how your tenant is chosen, and shows how to give someone access.

GUI pages and actions should check both role and scope. Do not show or execute admin-only functions for users who lack the required role.

Runtime Identity

Each deployed integration project has its own runtime identity:

Keycloak client id: the deployment's name, for example klok-egress-ai
Pulsar role:        service-account-<client id>
Vault path:         secret/<tenant>/integration/<name>/env

The client attaches the client scope pulsar and nothing else; one client per running deployment, never shared, never used by a person. A person sets the identity up; the steps are in Onboarding A Tenant, section New Integration Project, and the model is Service Identities in the Klok framework development guide.

Broker Grants

Grants are given to service roles, never to people, in the words publish and consume. Write narrow, consume wide: a project holds publish and consume on its own tenant's namespaces and nothing else. A topic of another domain or tenant is a consume grant on exactly that topic, approved by its owner; nobody holds publish in another tenant's namespace. Every grant, and every topic, is an entry in the owning tenant's Pulsar file (pulsar_tenant_<tenant>.yml) in klok/environment/klok-environment-setup. A developer requests it in klok.dev and an owner approves it there, after which klok.dev merges it and applies it to the broker; a merge request in GitLab, applied by klok.dev's Ensure or by Ansible, is the same path by hand (Topics On The Klok Broker). The broker creates no topics by itself. A grant or topic made only in the broker is drift. The framework development guide's Broker Access And Tenant Isolation page has the whole model.

Digital Sovereignty

Digital sovereignty means the organization can understand, operate, migrate, and govern its integrations without being trapped by opaque point-to-point dependencies or hidden vendor payloads.

Klok supports this through:

  • Owned information models.
  • Git-based source and documentation.
  • Explicit tenant and domain boundaries.
  • Open observability and context metadata.
  • Controlled cross-tenant access.
  • Secrets kept outside code and prompts.