Fedora Account System
Red Hat Associate
Red Hat Customer
A flaw was found in the Red Hat Build of Keycloak Operator. The operator copies the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables from its own process environment into the operands it manages and writes them as literal values into the operand container environment (KeycloakDeploymentDependentResource.getDefaultAndAdditionalEnvVars). When the operator environment is populated from a Kubernetes Secret, the kubelet resolves the Secret and the operator writes the proxy credential in cleartext into the Keycloak StatefulSet pod template. A user who can read workload objects such as StatefulSets but cannot read Secrets in that namespace, which is what the built-in view ClusterRole grants, can read the proxy credential from the StatefulSet spec. Confirmed on OpenShift 5.0.0 (CRC, Kubernetes v1.36.5) and on a k3s API server using default bootstrapped RBAC roles.