The Simplest Way to Make Keycloak and Portworx Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using keycloak and portworx together lets teams control container storage with central user logins. Keycloak checks who the user is, and Portworx applies storage rules for that person. This setup stops teams from sharing static storage keys across clusters. Instead, each engineer logs in once and gets the right volume permissions for their daily tasks. You can manage users in one place while keeping cluster disks safe. How keycloak and portworx handle logins and storage rules Keycloak acts a

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Using keycloak and portworx together lets teams control container storage with central user logins. Keycloak checks who the user is, and Portworx applies storage rules for that person.

This setup stops teams from sharing static storage keys across clusters. Instead, each engineer logs in once and gets the right volume permissions for their daily tasks. You can manage users in one place while keeping cluster disks safe.

How keycloak and portworx handle logins and storage rules

Keycloak acts as the central login server for your platform teams. It stores user accounts, group memberships, and role names in one place. When an engineer wants to create or change a storage volume, they log in first. Keycloak checks their password and second factor, then issues a signed token.

That token holds claims about the user and their team groups. The engineer sends this token to the storage API when making a request. Portworx reads the token and checks the signature against the public key from Keycloak. If the signature is valid, the storage engine reads the role claims inside.

Portworx then matches those claims to its own internal storage roles. A developer role might allow creating small test volumes in a single namespace. A platform admin role might allow resizing cluster disks or deleting old snapshots. Every action depends on the group data sent from the login server.

Data flows in a clear loop between the user, the login server, and the cluster. The storage layer does not store user passwords at all. It only trusts the signed tokens that come from your identity server. When a person leaves the company, you remove them in Keycloak to stop their storage rights.

Common pitfalls and how to scope roles and network paths

Many teams fail by giving everyone the same broad admin role at first. They set up the login link, but map all users to the top storage group. One wrong command from a junior user can then wipe out critical production volumes. Shared service accounts for scripts cause similar risks when tokens never expire.

Keycloak + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common issue is token life span. If a token stays valid for days, a stolen token gives an attacker plenty of time. Teams also forget to log which user ran which volume command. Without detailed audit logs, you cannot trace who deleted a disk during an outage.

To fix this, split your storage permissions into small, clear roles based on job needs. Create one group in Keycloak for read-only viewers who just check disk health. Create a second group for app owners who manage volumes in their own namespaces. Keep the full cluster admin group tiny and use it only for major maintenance.

Set token life spans to a few minutes so old tokens expire fast. Force scripts and build tools to use their own scoped accounts with tight limits. Lock down your network paths so the storage API only accepts traffic from trusted cluster nodes. Ensure that Portworx can reach the Keycloak server over an encrypted link to verify keys.

Keeping storage audits and day-to-day operations clean

Good storage security needs ongoing checks as teams grow and change. Review your Keycloak group mappings every quarter to remove old project roles. Check that automated jobs only touch the specific storage pools they need to run.

When teams run databases on container volumes, sensitive records often sit on those disks. Masking rules can rewrite fields like emails, phone numbers, card numbers, or national IDs in query results. Pairing strong identity rules with clear audit trails keeps both volume actions and data queries safe.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does Portworx verify tokens from Keycloak?

Portworx fetches the public signing keys from the Keycloak server endpoint. It uses those keys to check that each incoming user token is real and unaltered.

What happens if a user changes teams in Keycloak?

You update the user group in Keycloak, and the next token carries the new role. Portworx reads the updated token and applies the new storage permissions right away.

Can we use this setup for automated cluster scripts?

Yes, you can create dedicated service accounts in Keycloak for your automation tools. Map each script account to a narrow storage role so it only runs needed tasks.

The query runs. The emails stay hidden.