MinIO Operator STS is a native IAM Authentication for Kubernetes. MinIO Operator offers support for Secure Tokens (a.k.a. STS) which are a form of temporary access credentials for your MinIO Tenant. In essence, this allows you to control access to your MinIO tenant from your applications without having to explicitly create credentials for each application.
For an application to gain access into a MinIO Tenant, a PolicyBinding
resource is required, granting explicit access to the applications by validating the kubernetes Service Account authorization token.
The service account token is validated as follows:
AssumeRoleWithWebIdentity
API MinIO Operator provides.PolicyBinding
in the Tenant namespace.In step 2 the TokenReview
API call attempts to authenticate a token to a known user, TokenReviewStatus is the result of the TokenReview
request.
Audiences are audience identifiers chosen by the authenticator that are compatible with both the TokenReview and token.
An identifier is any identifier in the intersection of the TokenReviewSpec audiences and the token's audiences.
A client of the TokenReview API that sets the spec.audiences
field should validate that a compatible audience identifier is returned in the status.audiences field to ensure that the TokenReview server is audience aware.
If no audiences are provided, the audience will default to the audience of the Kubernetes apiserver.
This PR ensures the Operator STS service request the Service Account JWT to belong to the audiencests.min.io
in the TokenReviewRequest.
This PR ensures the examples and documentation provided guides in how to create Service accounts with "disabled auto mount services tokens", by doing this the pods where the service account is used no longer mounts the service account automatically in the path /var/run/secrets/kubernetes.io/serviceaccount
.
For illustrative purposes, here is how you disable auto mount of service account tokens at the service account level.
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: namespace-name
name: service-account name
automountServiceAccountToken: false
Additionally documentation and examples show how to request an audience-specific token with audience sts.min.io
, by asking for an ServiceAccount Token to be audience specific.
For illustrative purposes, here is how you request an audience specific service account token in a pod:
apiVersion: batch/v1
kind: Job
metadata:
name: job-name
namespace: job-namespace
spec:
template:
spec:
serviceAccountName: service-account-name
volumes:
- name: sa-token
projected:
sources:
- serviceAccountToken:
audience: "sts.min.io"
expirationSeconds: 86400
path: token
containers:
- name: mc
...
volumeMounts:
- name: sa-token
mountPath: /var/run/secrets/sts.min.io/serviceaccount
readOnly: true
This setup prevents privilege escalation and token leakage by combining multiple defense-in-depth mechanisms that ensure service account tokens are only usable by their intended audience, short-lived, and not exposed unnecessarily.
Problem: A ServiceAccount token is often valid for multiple audiences (e.g., the default Kubernetes API server). Without scoping, it can be replayed to other internal systems, which may unintentionally trust it.
Mitigation: Now we enforce that tokens are explicitly created for the sts.min.io audience using the Kubernetes TokenRequest API, and the MinIO Operator:
Sends audiences: ["sts.min.io"] in the TokenReview.
Verifies that the token was issued with this audience via status.audiences.
Effect: Even if a token is stolen or misused, it will fail validation if used outside the sts.min.io STS endpoint (e.g., reused at the API server or another service).
Disabling auto-mounted service account tokens
Problem: By default, Kubernetes mounts long-lived service account tokens into all pods at /var/run/secrets/kubernetes.io/serviceaccount
, making them vulnerable to theft if the container is compromised.
Mitigation: No we guide users to set automountServiceAccountToken: false
in their ServiceAccount definitions.
Effect: Prevents automatic token injection into all pods, reducing the attack surface.
Problem: Long-lived tokens can be reused indefinitely if leaked. Mitigation: You use projected service account tokens with: - audience: "sts.min.io" - A short expirationSeconds (e.g., 86400 = 24 hours, or even shorter)
Effect: Even if the token is leaked, it is:
The issue affects MinIO Operator versions v5.0.x and above, when the STS feature was first introduced.
The risk is minimal, as:
Fix released in v7.1.0
{ "nvd_published_at": null, "cwe_ids": [ "CWE-522" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2025-04-21T22:51:11Z" }