Access Control

User guide to access control on the ayedo SDP: SSO with Keycloak or Authentik, kubelogin, namespace Kubernetes RBAC, and OpenBao secrets access.

Access Control

The ayedo Software Delivery Platform (SDP) uses central Single Sign-On (SSO) via OpenID Connect (OIDC) combined with Role-Based Access Control (RBAC). This page explains how users and development teams securely access clusters, platform services, and secrets.

Central SSO with Keycloak or Authentik

Depending on your SDP setup, Keycloak or Authentik serves as the central Identity Provider (IdP). Both IdPs support OIDC-based login, group claims, Multi-Factor Authentication (MFA), and identity brokering to existing corporate directories (such as Microsoft Entra ID, Google Workspace, LDAP, or GitLab/Forgejo).

You authenticate against all connected SDP services through the same IdP:

  • Kubernetes API (kubectl via kubelogin)
  • Git & CI/CD (Forgejo or GitLab)
  • Container Registry (Harbor)
  • GitOps (Argo CD)
  • Secrets Management (OpenBao)
  • Observability (Grafana)

Your permissions in each service are governed by group memberships (group claims, typically in the groups claim). Once you are assigned to the appropriate group in the IdP, the corresponding roles take effect automatically on your next login.

Kubernetes Access with kubelogin

For Kubernetes access via kubectl, the SDP uses short-lived OIDC tokens instead of static long-lived certificates. This is handled by the kubectl plugin kubelogin (kubectl-oidc_login).

Using the OIDC kubeconfig

Your provided kubeconfig points to your SDP's OIDC issuer (Keycloak or Authentik) and requests the groups scope:

users:
  - name: developer@acme-production-1
    user:
      exec:
        apiVersion: client.authentication.k8s.io/v1beta1
        command: kubectl
        args:
          - oidc-login
          - get-token
          - --oidc-issuer-url=https://id.example.com/application/o/kubernetes/
          - --oidc-client-id=kubernetes
          - --oidc-extra-scope=email
          - --oidc-extra-scope=groups

When you first run kubectl, your browser opens to sign in with the IdP. Afterward, kubelogin caches the short-lived token locally (~/.kube/cache/oidc-login/) and refreshes it automatically when needed.

Checking Your Identity and Permissions

# Check current identity and groups
kubectl auth whoami

# Check whether an action is permitted in your namespace
kubectl auth can-i create deployments -n acme-production
kubectl auth can-i get secrets -n acme-production

Roles and RBAC in Your Namespace

Access control in Kubernetes follows the Principle of Least Privilege at the namespace level. Development teams receive targeted permissions for their project namespaces via RoleBindings without requiring cluster-wide administration privileges.

Role Typical Namespace Permissions Typical Audience
admin Full access to namespace resources including RoleBindings Team leads, application owners
edit Create, update, and delete workloads, ConfigMaps, and Secrets Application developers
view Read-only access to workloads and status (excluding Secret contents) Auditors, stakeholders, support view

Example: Namespace RoleBinding for an IdP Group

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: acme-developers-edit
  namespace: acme-production
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: edit
subjects:
  - kind: Group
    name: acme-developers
    apiGroup: rbac.authorization.k8s.io

For CI/CD pipelines and automated workflows, do not use personal accounts; instead, use dedicated Kubernetes ServiceAccounts or short-lived workload identities with tightly scoped roles.

Roles in Git, Harbor, Argo CD, and Grafana

Groups from Keycloak or Authentik map consistently to roles across the remaining platform services:

Service Typical Roles / Access Model
Forgejo / GitLab Organization, group, and repository roles (Read, Write, Maintainer/Admin)
Harbor Project roles (Guest, Developer, Maintainer, Project Admin); CLI access via personal CLI secrets or robot accounts
Argo CD Project-scoped RBAC roles (readonly, developer with sync permissions on own Applications)
Grafana Organization roles (Viewer, Editor, Admin) for dashboards, Explore, and alerting

Developer Access to OpenBao and External Secrets

Application secrets are managed centrally in OpenBao and synchronized into Kubernetes Secrets in the target namespace via the External Secrets Operator (ESO). This ensures no credentials ever end up in a Git repository.

Signing In with the bao CLI

Install the OpenBao CLI (bao) and sign in via OIDC:

export BAO_ADDR="https://openbao.example.com"

# OIDC login in the browser
bao login -method=oidc role=developer

# Inspect assigned policies and token TTL
bao token lookup

Alternatively, you can manage secrets via the OpenBao web UI (https://openbao.example.com) by selecting OIDC as the authentication method.

Reading and Writing Secrets in Your Team Path

Your OIDC group determines which paths you can access in OpenBao (for example, secret/acme/*):

# Store an application secret (KV v2)
bao kv put secret/acme/my-app \
  api_key="<your-api-key>" \
  jwt_secret="<your-jwt-secret>"

# Inspect stored keys
bao kv get secret/acme/my-app

Synchronizing into the Cluster via External Secrets

Instead of creating secrets manually with kubectl create secret, reference the OpenBao path declaratively in an ExternalSecret resource within your deployment:

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: my-app-secrets
  namespace: acme-production
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: openbao-backend
    kind: ClusterSecretStore
  target:
    name: my-app-secrets
    creationPolicy: Owner
  data:
    - secretKey: API_KEY
      remoteRef:
        key: acme/my-app
        property: api_key

The External Secrets Operator reads the specified path from OpenBao and keeps the Kubernetes Secret my-app-secrets in the acme-production namespace up to date. For how to integrate this end to end into your deployment workflow, see the Application Deployment Guide.

Best Practices for Teams

  • Enable MFA: Consistently protect all user accounts in the Identity Provider with Multi-Factor Authentication.
  • No Shared Accounts: Every individual works with their own IdP account; automations use dedicated robot accounts, tokens, or ServiceAccounts.
  • Respect Namespace Boundaries: Separate environments (development, staging, production) using dedicated namespaces and separate group permissions.
  • Regular Access Reviews: Promptly remove departing team members from IdP groups — this centrally revokes all OIDC-based access.
  • Add Network Protection: Combine RBAC with NetworkPolicies and optional API whitelisting — see Network Access for details.

Troubleshooting

OIDC Login Fails or Groups Are Missing

  1. Run kubectl auth whoami to check which username and groups you are currently authenticated with.
  2. After group membership changes, clear the local cache under ~/.kube/cache/oidc-login/ and sign in again.
  3. For OpenBao, run bao token lookup to verify that the expected policies are attached to your token.
  4. If permissions are still missing, contact your platform administration or support with your username and the requested group.

Further Reading