Skip to content

feature: Refactor Keycloak secrets handling for agent operator and centralized credential management #397

Closed

Description

@ingpaolodettori-dev

Feature Description

Currently, when deploying with the new agent operator, Keycloak client information (user, password, URLs, client ID/secret) is still stored in the environments configmap. The Keycloak user and password are also duplicated in every namespace as secrets. This architecture creates several operational problems: secrets are only copied at install time, making credential rotation unsafe—if the Keycloak credentials change, access breaks for all existing deployments. Storing sensitive information in configmaps is not secure, and duplicating secrets across namespaces is error-prone.

Proposed Solution

Update the deployment and client registration process to:

  • Store all Keycloak client information, including credentials, in a secret (kagenti-keycloak-client-secret) instead of the environments configmap.
  • Source the Keycloak user and password directly from the keycloak-initial-admin secret in the keycloak namespace rather than duplicating them in every namespace.
  • Refactor the client-registration code so that it dynamically reads credentials from the central secret, enabling safe credential rotation without reinstalling clients.
    This centralizes sensitive data, improves security best practices, and ensures deployments can survive Keycloak credential rotation without disruptions.

Relevant code changes:

  • kagenti/auth/ui-oauth-secret/auth_secret.py: Implements read_keycloak_credentials to load admin credentials from the keycloak-initial-admin secret.
  • kagenti/installer/app/components/keycloak.py: Refactors how the client secret is distributed—writes it to kagenti-keycloak-client-secret (distribution code).
  • Affected areas include admin user/secret bootstrapping and client-registration logic, now reading directly from the keycloak namespace.

Want to contribute?

  • I would like to work on this issue.

Additional Context

See also: PR #396 (Add agent-oauth-secret job to enable client registration with helm chart).
This feature request supports the transition to operator-based deployments and addresses known issues with secret management and Helm chart limitations.

Relevant source code:

For further details, see the in-code docs and references.

Activity

  1. rubambiza commented on Jan 26, 2026

    @rubambiza
    Contributor

    @pdettori , any updates from your bot?

  2. pdettori commented on Jan 26, 2026

    @pdettori
    Member

    I think we should review this issue based on the new design for AuthBridge and integration with the new webhook in rossoctl/cortex#75 and rossoctl/cortex#76

  3. mrsabath commented on Feb 16, 2026

    @mrsabath
    Member
  4. rubambiza commented on Feb 23, 2026

    @rubambiza
    Contributor

    @Alan-Cha (WIP) will push a PR later this week.

  5. added this to the Release v0.7.0 milestone on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions