Auditing Kubernetes Secret-Read Permissions After the Rackspace Spot Credential Leak

Auditing Kubernetes Secret-Read Permissions After the Rackspace Spot Credential Leak

pr0h0••34 min read•tech
AI Usage (92%)
On this page

How a Leaked Platform Credential Becomes a Kubernetes Secret Exposure

The part of a breach notice that matters to a platform team is usually not the part the headline covers. This post uses the reported Rackspace Spot credential leak as a worked example for auditing Kubernetes secret-read permissions: who can read Secrets directly, who can reach them indirectly through workloads, and which credentials need rotation because a read may already have happened.

"Leaked credentials" tells you which door was open. It says nothing about which rooms the visitor entered, what they carried out, and — the part that determines your weekend — what is still valid right now. That gap is the whole problem with a Kubernetes Secret exposure. Revoking a cloud console login, rotating a platform API key, or disabling a service principal does not invalidate a database password that was already read out of etcd two weeks earlier. A Kubernetes Secret is not a reference to a credential that lives elsewhere. It is the credential, stored as an object your cluster hands to anyone it authorizes. Revoke the reader and you have removed one path to the value. You have not changed the value.

So my position going into this: after a report like the Rackspace Spot one, the productive question is not "was this an RBAC misconfiguration?" It is "what could that credential reach, by which authorization path, and which of the things it could reach are still live?" The first question is a diagnosis you may never be able to make from outside the vendor. The second is an audit you can run this week.

Revoking a Login Does Not Revoke the Password It Read

Kubernetes authorization is a chain of decisions, and each link has its own lifetime:

  • the external platform credential (long-lived, often non-expiring)
  • the platform's authorization of that credential (a control-plane API, a token exchange, a generated kubeconfig)
  • the cluster access mechanism (a client certificate, a bearer token, an OIDC identity, a cloud-IAM-to-RBAC mapping)
  • the Kubernetes identity that results (system:serviceaccount:ns:sa, a user in a group, a cloud role mapped into RBAC)
  • the RBAC decision (get secrets/foo in namespace bar)
  • the API response (the object, base64-encoded)

Break any link and you stop future reads. Only rotating the underlying credential at its issuing system stops past reads from being useful. Those are two different remediation tracks and they usually sit with two different teams — which is exactly why one gets done and the other doesn't.

What This Kubernetes Secret-Read Audit Covers

Using the publicly reported Rackspace Spot incident as context, this post builds an audit you can actually run:

  1. Establish the reported facts and, explicitly, the unknowns.
  2. Map the credential-to-Secret trust boundary before touching a cluster.
  3. Inventory direct Secret permissions — Roles, ClusterRoles, bindings, scope, additivity.
  4. Verify effective access with authorization checks rather than reading manifests and guessing.
  5. Audit indirect access, which is where most real exposures hide: pod creation, workload controllers, exec, service-account tokens.
  6. Replace broad grants with tested, task-specific ones.
  7. Rotate the chain, not just the entry credential.
  8. Collect evidence without creating a second secret store in your log pipeline.
  9. Turn all of it into a regression test.

Everything below uses synthetic fixtures and a disposable namespace. Where I show output, it is the expected result of running the command against that fixture — not a capture from Rackspace's environment.

What the Rackspace Spot Coverage Establishes—and What It Leaves Unknown

The Reported Timeline in the Supplied Coverage

Two items are in scope:

  • MLQ.ai, 22 November 2026 — reports that Rackspace said attackers used leaked credentials to breach its Spot cloud platform and read customer Kubernetes secrets.
  • SC Media, 23 November 2026 — reports that Rackspace disclosed a security breach of the Spot cloud platform.

That is the extent of what the supplied material supports. Both items are secondary coverage. Neither is a vendor advisory, a forensic report, a customer notification, or a CVE record, and the supplied excerpts are headlines plus short summaries. No affected-version range is given. No incident identifier is given. No credential type is named. No customer count is stated.

I am deliberately not filling those gaps. Any post that tells you "the attackers obtained cluster-admin via a wildcard ClusterRoleBinding" is inventing the interesting part.

Reported Claims Versus Unknowns

ItemWhat the supplied coverage saysStatus
Platform affectedRackspace SpotReported by both items
Entry mechanism"Leaked credentials"Reported, type unspecified
Customer impactCustomer Kubernetes Secrets were readReported by MLQ.ai summary
Kubernetes authorization path—Not stated
Access duration—Not stated
Number of customers affected—Not stated
Specific Secret objects or namespaces—Not stated
Kubernetes or product vulnerabilityNot referencedUnknown; do not assume one
Remediation performed—Not stated in the excerpts

Two things I will not do with this table: infer cluster-admin from "read customer Kubernetes secrets," and infer a Kubernetes vulnerability from "read." Neither follows. A single namespaced get on one Secret produces exactly that sentence.

What Would Confirm the Mechanics

If Rackspace publishes an advisory or customers receive notifications, these records would settle the mechanics:

  • Provider identity events — which credential, issued when, to whom, used from where.
  • Control-plane audit logs — verb, user.username, objectRef, responseStatus.code, sourceIPs, timestamps for secrets requests.
  • Cluster access records — whether the platform credential mapped to a Kubernetes user, a service account, or a provider-managed admin path.
  • Object inventory — which Secret names and namespaces appear in those events.

Inference, clearly labelled: if the platform held a credential capable of acting inside customer clusters, the most likely shapes are a control-plane component with elevated in-cluster permissions (likely) or a provider-issued admin credential (untested). Which applies to Spot is not established by the supplied coverage, and the two have very different customer-side implications.

Everything from here is defense. Where I say "recommended," it is a control I would want, not a claim about what Rackspace lacked.

Establish the Credential-to-Secret Trust Boundary Before Running Audit Commands

An Investigation Model for the Access Chain

Draw the chain as text before you run a single command:

external platform credential
  └─> platform authorization service        (does this credential act for a tenant?)
        └─> cluster access mechanism        (cert / token / OIDC / provider IAM mapping)
              └─> Kubernetes identity       (user, group, or system:serviceaccount:ns:name)
                    └─> authorization decision   (RBAC, webhook, node authorizer)
                          └─> Secret API request (get / list / watch)

This is an investigation model, not the confirmed Rackspace attack path. The reason to draw it first is that provider-side access frequently does not appear as a RoleBinding your static review will find. Three common shapes:

  • A control-plane component runs with its own service account and reads Secrets on behalf of a platform feature. The binding exists, but its subject looks like internal infrastructure and nobody owns it.
  • The provider issues a per-tenant credential that maps to an RBAC group via an authenticator. The group binding exists; the mapping from platform credential to group membership does not, and is invisible in cluster manifests.
  • The provider exposes a management API that proxies with elevated credentials and never presents the customer's identity to the API server at all.

Managed offerings differ widely here — cloud IAM roles mapped into RBAC, access entries, authenticator webhooks, provider-managed admin groups. Whether Spot uses any of these is not stated in the supplied coverage. The audit below is written so it still produces useful findings regardless of which shape you're in, because it starts from what identities can read Secrets rather than which manifests I expect to find.

Safe Operating Boundaries

⚠️

Never print Secret values during an audit. Not into a terminal, not into a ticket, not into a findings doc, not into a chat thread. If a value reaches your notes, your notes are now part of the incident.

Rules I hold to:

  • Authorized cluster only. A disposable lab cluster, or an explicitly approved production audit account with read access to RBAC objects.
  • Verify the context, every session. kubectl config current-context before anything stateful.
  • Explicit namespace, always. Never run a Secret-touching command with -A or without -n.
  • Synthetic Secrets only. Lab fixtures with placeholder values like ROTATED_PLACEHOLDER_1, never real credentials, never copies of production objects.
  • No production kubeconfigs collected into an audit bundle. If you need to prove a context was used, record the context name and the cluster's server host, not the file.
  • Never kubectl get secrets -o yaml. That command is a data exfiltration primitive with a friendly name.

A base64-encoded value is not encryption and it is not redaction. It is a two-second decode. Encryption at rest (EncryptionConfiguration) is also not relevant to the exposure question: it prevents someone with raw etcd or backup access from reading the value, and does nothing whatsoever against an authorized API read.

Build an Evidence Baseline First

Snapshot the authorization configuration before you change anything, so you can diff later and so a reviewer can verify your starting point.

baseline-snapshot.sh
set -euo pipefail
out="./audit-$(date -u +%Y%m%dT%H%M%SZ)"
mkdir -p "$out"

kubectl config current-context            | tee "$out/context.txt"
kubectl version -o yaml                   > "$out/version.yaml"
kubectl get --raw /version                > "$out/server-version.json"
kubectl get namespaces -o name            > "$out/namespaces.txt"

kubectl get roles,rolebindings -A -o yaml > "$out/rbac-namespaced.yaml"
kubectl get clusterroles,clusterrolebindings -o yaml > "$out/rbac-cluster.yaml"

sha256sum "$out"/*.yaml | tee "$out/SHA256SUMS"

Expected shape of the server version record on a lab cluster:

{
  "major": "1",
  "minor": "31",
  "gitVersion": "v1.31.4",
  "platform": "linux/amd64"
}

Managed distributions append build suffixes to gitVersion; capture it verbatim rather than normalizing, because the suffix is often the only indicator of which provider build you audited.

Store the bundle in a location with access control and an audit trail of its own. It contains no Secret data — Roles and bindings are configuration — but it does disclose your identity topology and namespace names, which is useful reconnaissance in aggregate.

One honest limitation to write at the top of the bundle: this is a snapshot, not proof of historical access. It tells you what was authorized at 09:14 UTC. It cannot tell you what was read on the day of the incident. For that you need audit logs, and if they were not collected, they cannot be manufactured later.

Understand Which Kubernetes Permissions Expose Secret Data

get, list, and watch Are All Secret Reads

Three verbs, three different exposures, one common mistake: treating only get as a read.

VerbWhat the caller receivesWhy it matters
get on secrets/<name>The full object including dataDirect credential disclosure
get on secrets (collection, no name)Nothing by default — collection GET is not a thingLow risk alone
list on secretsEvery Secret object in scope, with dataBulk credential disclosure; also a complete inventory
watch on secretsFuture and current objects, streamedContinuous disclosure; catches rotations as they happen

list is not "permission to see object names." A list response is a full SecretList; each item carries its data map. Granting list on secrets in a namespace is functionally equivalent to granting get on every Secret in that namespace, present and future.

watch is worse in a subtle way: it is a live feed. An attacker with watch who is patient receives the rotated credential too. This is the single most under-appreciated reason to rotate an entire credential chain rather than one value.

Roles, Bindings, Scope, and Additivity

The model, stated precisely:

  • A Role is a namespaced set of rules. A ClusterRole is cluster-scoped — but note the word scoped, not scoped to everything. A ClusterRole is a portable rule set.
  • A RoleBinding grants a Role or a ClusterRole to subjects within one namespace. Binding cluster-admin with a RoleBinding does not make the subject a cluster admin; it makes them an admin of that namespace. This trips people up in both directions.
  • A ClusterRoleBinding grants a ClusterRole cluster-wide, which for namespaced resources means every namespace, including future ones.
  • Grants are additive. There is no deny rule in RBAC. There is no ordering. There is no "most specific wins." If two bindings grant overlapping access, the union applies.

That last point is the one that usually breaks the review. A perfect, tightly scoped Role permitting get on one Secret is worth exactly nothing if a forgotten ClusterRoleBinding also grants * on *. Auditing a Role in isolation produces a comfortable and wrong answer.

Two more mechanics worth knowing:

Wildcards. resources: ["*"] covers secrets — and pods/exec, and serviceaccounts/token, and everything (current and future) in that API group. verbs: ["*"] covers impersonate, escalate, and bind. Wildcard rules are effectively unauditable because their meaning changes when the API grows.

Aggregated ClusterRoles. A ClusterRole can declare an aggregationRule; the controller manager populates its rules from any ClusterRole carrying a matching label. The resulting rules are materialized in the object, so a static review will see them — but only if the review reads the populated object rather than the authored one. An aggregated role can silently grow when someone labels a new ClusterRole. Real example: the admin, edit, and view default roles are aggregated. Anything labelled rbac.authorization.k8s.io/aggregate-to-edit: "true" extends edit for every namespace in the cluster.

resourceNames Is a Narrow Tool, Not a Boundary

resourceNames restricts a rule to specific object names. It works for get. It is awkward for list and watch, because those requests are not name-addressed — you must also constrain the request with a field selector:

kubectl get secret reporting-api-key -n payments-lab     # get by name: allowed by resourceNames
kubectl get secrets --field-selector metadata.name=reporting-api-key -n payments-lab
kubectl get secrets -n payments-lab                       # unrestricted list: not covered by resourceNames

A rule like this allows the first form and the selector-constrained list, and denies the plain list:

rules:
  - apiGroups: [""]
    resources: ["secrets"]
    resourceNames: ["reporting-api-key"]
    verbs: ["get", "list", "watch"]

Also: resourceNames cannot restrict create or deletecollection, since those have no name at authorization time. If you see resourceNames paired with create, the name list is doing nothing.

And the point that undoes most "we used resourceNames" claims: RBAC cannot subtract. resourceNames on one rule does not remove access granted by another rule, another binding, an authorization webhook, or the node authorizer. It is a scoping tool for a single grant, not a policy layer.

Inventory Kubernetes Identities and RBAC Bindings Without Exporting Secret Contents

Scoped Queries for RBAC Objects

These commands read authorization configuration. None of them retrieve a Secret object.

Find ClusterRoles whose rules touch secrets or *:

find-secret-clusterroles.sh
kubectl get clusterroles -o json | jq -r '
.items[]
| select(.metadata.name | startswith("system:") | not)
| select(any(.rules[]?; (.resources // []) | any(. == "secrets" or . == "*")))
| .metadata.name as $n
| .rules[]
| select((.resources // []) | any(. == "secrets" or . == "*"))
| [$n, (.verbs | join("|")), (.resources | join(",")), (.apiGroups | join(","))]
| @tsv'

Expected fixture output:

app-operator	get|list|watch	secrets	
platform-debug	*	*	*

The empty fourth column is the core API group, printed as blank by join. Worth noticing: wildcards in the core group are where Secrets live.

Now enumerate bindings with their subjects in one namespace:

namespace-bindings.sh
kubectl get rolebindings.rbac.authorization.k8s.io -n payments-lab -o json | jq -r '
.items[]
| .metadata.name as $b
| "(.roleRef.kind)/(.roleRef.name)" as $r
| (.subjects // [] | map("(.kind)/(.namespace // "-")/(.name)") | join(", ")) as $s
| [$b, $r, $s] | @tsv'

Expected fixture output:

reporting-reads-one-secret	Role/secret-reader-one	ServiceAccount/payments-lab/reporting-sa
platform-debug	ClusterRole/cluster-admin	Group/-/platform-oncall
default-sa-admin	ClusterRole/cluster-admin	ServiceAccount/payments-lab/default

Read that output the way a reviewer should: platform-debug grants cluster-admin rules but only inside payments-lab, which is namespace-admin. default-sa-admin is the finding — the namespace's default service account, which every Pod in the namespace gets unless it specifies otherwise, is a namespace admin.

Trace Subjects Back to an Owner

Every subject needs a named human or a named automated owner. Categories to sweep:

Subject kindWhere it comes fromWhat to check
UserClient cert CN, OIDC sub, authenticatorIs this a person, a shared account, or a bot?
GroupOIDC groups claim, cert O, authenticator webhookGroup membership lives outside the cluster — you cannot enumerate it from here
ServiceAccountsystem:serviceaccount:<ns>:<name>Which workload actually uses it? Is it the default SA?
system:authenticatedEvery authenticated identityA binding to this group is a binding to the internet-adjacent population
system:serviceaccountsEvery SA in the clusterCross-namespace blast radius
Provider-mapped identityIAM role, access entry, provider groupMapping lives in the provider's control plane, not in RBAC

Two entries deserve a flag, not a fix-on-sight: a Group subject whose membership you cannot enumerate, and any ServiceAccount whose workload you cannot identify. Both are "unknown purpose" findings, and unknown purpose is how a temporary debugging grant survives three years.

The Findings Table

SubjectIdentity sourceBindingEffective scopeSecret verbsJustificationOwnerAction
system:serviceaccount:payments-lab:reporting-saNamespaced SAreporting-reads-one-secretpayments-labget on reporting-api-keyReporting job reads one keypayments-teamKeep
system:serviceaccount:payments-lab:defaultDefault SAdefault-sa-adminpayments-lab*None recordedUnassignedRemove; investigate origin
platform-oncall (group)IdP groupplatform-debugpayments-lab*Break-glassPlatform on-call leadKeep; require time-bound binding
system:serviceaccount:kube-system:platform-agentProvider/control-plane componentplatform-agent-reader (ClusterRoleBinding)Cluster-wideget, list, watchUnknownUnassignedEscalate to vendor; document

State the limitation in the table's footnote: static RBAC review cannot enumerate external group membership, cannot see provider-side authorization, and cannot see admission-webhook-driven behavior. It is a floor on what is granted, not a ceiling.

Verify Effective Kubernetes Secret Access with Authorization Checks

kubectl auth can-i for get, list, and watch

Static review tells you what is written down. Authorization checks tell you what the API server will actually decide. Run them for each verb separately:

can-i-matrix.sh
ns=payments-lab
as=system:serviceaccount:payments-lab:reporting-sa

for verb in get list watch; do
printf '%-6s %s
' "$verb" "$(kubectl auth can-i "$verb" secrets -n "$ns" --as "$as")"
done

printf '%-6s %s
' "named"       "$(kubectl auth can-i get secrets/reporting-api-key -n "$ns" --as "$as")"
printf '%-6s %s
' "other-named" "$(kubectl auth can-i get secrets/other-api-key -n "$ns" --as "$as")"
printf '%-6s %s
' "cross-ns"    "$(kubectl auth can-i get secrets/reporting-api-key -n kube-system --as "$as")"

Expected lab output with the remediation Role from later in this post in place:

get    no
list   no
watch  no
named  yes
other-named no
cross-ns no

Two things this output proves and one it doesn't:

  • It proves the API server's authorizer resolves get secrets/reporting-api-key to yes and every broader form to no.
  • It proves the checks are per-verb and per-name — get yes does not imply list yes.
  • It does not prove a past read happened. can-i performs a SubjectAccessReview; it evaluates policy. It reads no object.
💪

kubectl auth can-i returns a non-zero exit code for no. In scripts, capture the string rather than relying on exit status, or wrap it explicitly — a set -e script will abort on the first denied check and look like a broken audit.

Impersonation Limitations

--as and --as-group are subject to impersonation authorization: you need impersonate on users, groups, or serviceaccounts for the target. Three failure modes:

  1. You lack the permission and get a forbidden error, which is easy to misread as "the subject was denied."
  2. You model group membership wrong. Impersonating a username does not reproduce the groups that user actually carries from OIDC. If the real access comes from a group binding, --as someuser returns no and you conclude the access doesn't exist. You must pass --as-group for every relevant group — and you need to know them.
  3. You model the wrong identity type. --as system:serviceaccount:ns:sa is a username, not a service account impersonation. Use --as=system:serviceaccount:ns:sa --as-group=system:serviceaccounts --as-group=system:serviceaccounts:<ns> if you need the group context.

Do not grant broad impersonate rights so that the audit is convenient. That converts a read-only review into a privilege-escalation path.

Reconcile Static Review with Effective Checks

Work the differences in both directions:

Static findingEffective checkLikely explanation
No binding grants listcan-i list → yesA binding you did not enumerate: aggregated ClusterRole, system: prefixed, or provider-injected
Binding grants getcan-i get → noBinding names a subject that doesn't match the real identity (missing group, wrong namespace)
Binding removedcan-i still yesConflicting grant elsewhere — RBAC is additive; the removal was cosmetic
Everything as expectedcan-i yes for a principal you can't identifyAn authorization webhook or provider mapping is adding grants outside manifest review

The third row is the one that produces false confidence during remediation. You remove a RoleBinding, run can-i, see no, and declare victory — without noticing that a ClusterRoleBinding granted the same thing all along. Always re-run the full matrix, not the single check tied to the binding you changed.

Label every output above as an expected lab result. Unless you actually executed it against a disposable cluster, it is an illustration.

Audit Indirect Kubernetes Secret Access Through Workloads and Service Accounts

This is the section most RBAC audits skip, and it is where a real credential exposure usually lives. A principal does not need get secrets if it can make the cluster read the Secret for it.

A Pod Spec Is a Secret Reader

The kubelet needs to fetch Secrets referenced by Pods scheduled on its node — that is how secret volumes and secretKeyRef environment variables materialize. The kubelet's read is authorized by the node authorizer, with NodeRestriction admission limiting it to Secrets referenced by Pods actually bound to that node.

Consequence: create pods in a namespace is a Secret-read primitive in that namespace, for any Secret a Pod spec can reference.

Lab demonstration with a service account that has no Secret permissions at all:

lab/exfil-probe.yaml
apiVersion: v1
kind: Pod
metadata:
name: exfil-probe
namespace: payments-lab
spec:
serviceAccountName: workload-sa
restartPolicy: Never
containers:
  - name: probe
    image: busybox:1.36
    command:
      - sh
      - -c
      - test -s /etc/probe/reporting-api-key && echo READ_OK || echo READ_FAILED
    volumeMounts:
      - name: probe
        mountPath: /etc/probe
        readOnly: true
volumes:
  - name: probe
    secret:
      secretName: reporting-api-key
      optional: false
run-probe.sh
kubectl auth can-i get secrets -n payments-lab --as system:serviceaccount:payments-lab:workload-sa
kubectl apply -f lab/exfil-probe.yaml
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/exfil-probe -n payments-lab --timeout=90s
kubectl logs pod/exfil-probe -n payments-lab

Expected lab output:

no
pod/exfil-probe created
pod/exfil-probe condition met
READ_OK

READ_OK is the whole finding. workload-sa was denied get secrets by the API server and still received the Secret's contents, because the kubelet fetched it. The probe prints a marker, never the value — which is the correct way to prove exposure without becoming a leak.

Cleanup:

kubectl delete pod exfil-probe -n payments-lab

Now audit who can do this:

kubectl auth can-i create pods -n payments-lab --as system:serviceaccount:payments-lab:workload-sa
kubectl auth can-i create pods -n payments-lab --as system:serviceaccount:payments-lab:reporting-sa

Controllers, Mutations, and exec

Each of these is a different path with different prerequisites. Do not flatten them into "workload permissions equal Secret access."

PathPermission requiredPrerequisiteExposes
Create a new Podcreate podsAdmission allows the spec; image pullableAny Secret referenceable in that namespace
Modify an existing Deploymentpatch/update on deploymentsController reconciles the changeSame, via new ReplicaSet Pods
Modify an existing Podpatch on podsOnly mutable fields; most spec fields immutableLimited — not a general path
exec into a running Podcreate pods/execThe Pod is running and holds credentialsWhatever that workload already holds
Select a different SApatch on the workloadTarget SA existsThe target SA's token and its permissions

The exec row is the one people underrate: you don't need to know what a workload does, only that it runs. If it holds a database credential in its environment, exec gets you env.

Service-Account Tokens and Escalation Verbs

Service-account tokens are Secrets-adjacent by design, and the details have changed across versions:

  • Projected tokens (default since 1.21/1.24-era kubelets, and required by 1.24+ where SA token Secrets are no longer auto-created) are short-lived, audience-bound, and rotated by the kubelet. Default expirationSeconds is 3600, minimum 600. Stealing one buys you an hour, not a year.
  • Legacy long-lived token Secrets still work if they already exist, are still Secrets (so any get secrets grant exposes them), and are not invalidated by deleting the Pod. If your cluster predates 1.24 and never cleaned up, these are permanent bearer tokens sitting in the object store.

Escalation verbs to grep for specifically:

VerbOn resourceEffect
impersonateusers, groups, serviceaccountsAct as another identity, including a privileged SA
bindroles, clusterrolesCreate a binding to a role whose permissions you don't have
escalateroles, clusterrolesCreate or update a role with permissions you don't have
createserviceaccounts/tokenMint a token for any SA you can name — including ones you can't impersonate

That last one is a full privilege-escalation primitive and is frequently bundled into "developer" roles without anyone noticing, because it looks like a subresource.

Finally, a common misconception: setting automountServiceAccountToken: false on a ServiceAccount or Pod stops the token from being injected. It does not stop the workload from receiving application Secrets referenced explicitly in volumes or env. Those are injected by the kubelet regardless. Disabling automount is good hygiene; it is not a Secret-access control.

Replace Broad Kubernetes Secret Access with Tested, Task-Specific Permissions

A Minimal Named-Secret Role

lab/reporting-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: reporting-sa
namespace: payments-lab
automountServiceAccountToken: false
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: secret-reader-one
namespace: payments-lab
rules:
- apiGroups: [""]
  resources: ["secrets"]
  resourceNames: ["reporting-api-key"]
  verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: reporting-reads-one-secret
namespace: payments-lab
subjects:
- kind: ServiceAccount
  name: reporting-sa
  namespace: payments-lab
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: secret-reader-one

Note what is absent: no list, no watch, no wildcard, and no binding outside payments-lab. get by name is the minimum that lets a process fetch one credential.

When is a direct Secret read genuinely necessary? When the consumer must fetch a rotating value at runtime and cannot be restarted. That is a narrow case. The common cases have better answers:

  • The application can mount the Secret as a volume and read a file → no Secret API permission needed.
  • The application can take the value as an environment variable → no Secret API permission needed.
  • A controller manages the Secret → the controller needs permissions, the workload does not.
  • An external secret manager injects the value → the workload needs nothing from the Kubernetes API.

If the answer is "the app calls the Kubernetes API to read its own config," the honest question is whether that's worth a permanently credentialed pod.

Before and After Authorization Matrix

Remove conflicting broad grants first. A restrictive Role does not override anything.

kubectl delete rolebinding default-sa-admin -n payments-lab
kubectl auth reconcile -f lab/reporting-rbac.yaml --dry-run=server

Expected matrix after remediation:

CheckBeforeAfterReason
get secrets/reporting-api-key in payments-labyesyesRequired, name-scoped
get secrets/other-api-key in payments-labyesnoNot in resourceNames
list secrets in payments-labyesnoNo list verb granted
watch secrets in payments-labyesnoNo watch verb granted
get secrets/reporting-api-key in kube-systemyesnoRoleBinding is namespaced
create pods in payments-labyes(test separately)Indirect path, not covered by RBAC on secrets

That last row is deliberate. Fixing the direct grant did nothing about the indirect path. Handle it separately.

Constraining Indirect Access

Recommended controls, none of which are evidence about Rackspace:

  • Dedicated namespaces per trust level. A namespace where untrusted workloads run should hold no Secrets you care about. This is the highest-leverage control and the cheapest.
  • Constrain who can create workloads in namespaces that hold sensitive Secrets. create pods there is a privileged operation; treat it like one.
  • Admission policy that restricts secretName references to an allowlist per workload, rejects hostPath mounts of /var/lib/kubelet, and blocks Pods that select service accounts they weren't built for.
  • Separate deployment operators from workload authors. The person who can patch a Deployment in payments-lab can change what Secrets it mounts. That is an authorization decision, not a CI detail.
  • Disable automount on ServiceAccounts that don't call the API, and drop create serviceaccounts/token from developer roles.

Rotate the Full Credential Chain, Not Just the Initial Login

A Rotation Decision Tree

1. Revoke the entry credential.
   └─ Platform API key / console login / service credential disabled.

2. Terminate dependent sessions and refresh paths.
   └─ Outstanding tokens, OIDC refresh tokens, generated kubeconfigs,
      cached provider credentials on build agents.

3. Enumerate every credential that identity could read.
   └─ From the findings table + audit logs, not from memory.

4. For each one: rotate at the issuing system.
   └─ Database password → the database. API key → the upstream service.
      TLS key → reissue. Signing key → the KMS/HSM.

5. Update the Kubernetes reference.

6. Verify the new credential works and the old one is rejected.

7. Document what you could not scope, and why.

Step 4 is where audits stall, because "rotate at the issuing system" means a ticket to a different team for each credential. Step 7 is where they fail silently: if audit logs don't cover the window, you cannot know which Secrets were read, so you must either rotate everything in reach or write down explicitly that you accepted the risk on a defined list.

Kubernetes Rotation Mechanics That Surprise People

  • Updating a Secret does not revoke an external credential. kubectl apply on a Secret changes a string in etcd. The database still accepts the old password. Rotate at the issuer, then update the reference.
  • Mounted Secret volumes propagate; environment variables do not. The kubelet updates mounted Secrets by swapping a symlink, typically within a couple of minutes. env values are fixed at container start and require new Pods. Volume mounts via subPath are a known exception — they do not receive updates.
  • Applications may not reload. Propagation to the filesystem is not the same as the process re-reading the file. Verify per application; assuming a library handles it is how "we rotated it" and "it's still using the old key" both end up true.
  • Projected SA tokens are short-lived; legacy token Secrets are not. Deleting a Pod does not invalidate a legacy token Secret. Delete the Secret.
  • Staged overlap is a choice, not a default. If the old credential is under active abuse, do not stage. Break availability deliberately and say so.

A Staged Rotation Runbook

Synthetic identifiers only.

rotate-and-verify.sh
set -euo pipefail
ns=payments-lab
name=reporting-api-key

## 1. Issue the replacement at the issuer (out of cluster), then write the reference.
kubectl create secret generic "$name" --namespace "$ns" --from-literal=token=ROTATED_PLACEHOLDER_2 --dry-run=client -o yaml | kubectl apply -f -

## 2. Roll consumers that take the value from the environment.
kubectl rollout restart deployment/reporting-consumer -n "$ns"
kubectl rollout status  deployment/reporting-consumer -n "$ns" --timeout=180s

## 3. Confirm the new credential authenticates (synthetic endpoint).
curl -s -o /dev/null -w 'new=%{http_code}
' -H 'Authorization: Bearer ROTATED_PLACEHOLDER_2' https://issuer.example.internal/verify

## 4. Revoke the old credential at the issuer, then confirm rejection.
curl -s -o /dev/null -w 'old=%{http_code}
' -H 'Authorization: Bearer ROTATED_PLACEHOLDER_1' https://issuer.example.internal/verify

Expected output:

secret/reporting-api-key configured
deployment.apps/reporting-consumer restarted
deployment "reporting-consumer" successfully rolled out
new=200
old=401

old=401 is the only line that matters. Everything before it is preparation. A rotation runbook without a demonstrated rejection of the old credential is not a rotation, it is a change.

Where the exposed credential might have been read by a workload rather than directly, add the workload-side check: exec into a restarted Pod and confirm the process is using the new value without printing either value — compare a hash, or check a health endpoint's "credential version" field if your application exposes one.

Collect Kubernetes Audit Evidence Without Turning Logs into Another Secret Store

Audit Policy at Metadata Level

Kubernetes auditing has four levels: None, Metadata, Request, RequestResponse. For Secrets, the choice is not a matter of taste:

LevelWhat is recorded for a Secret requestSafe?
NoneNothingNo evidence
MetadataWho, what verb, which object reference, status, source IP, timestampsYes
RequestAbove plus the request bodyNo — a create/update body contains data
RequestResponseAbove plus the response bodyNo — a get response is the credential
⚠️

Request and RequestResponse on secrets writes Secret values into your log pipeline. A GET has no request body, so a Request policy looks harmless — until the first create or patch and your credential lands in Elasticsearch with a 30-day retention.

audit-policy-secrets-metadata.yaml
apiVersion: audit.k8s.io/v1
kind: Policy
omitStages:
- RequestReceived
rules:
# Read-heavy, low-value noise; keep it out.
- level: None
  users: ["system:kube-proxy"]
  verbs: ["watch"]
  resources:
    - group: ""
      resources: ["endpoints", "services"]

# Secrets and their RBAC-adjacent neighbours: metadata only, always.
- level: Metadata
  resources:
    - group: ""
      resources: ["secrets", "serviceaccounts"]
    - group: "rbac.authorization.k8s.io"
      resources: ["roles", "rolebindings", "clusterroles", "clusterrolebindings"]

# Escalation-relevant subresources.
- level: Metadata
  resources:
    - group: ""
      resources: ["serviceaccounts/token", "pods/exec"]

# Default for everything else.
- level: Metadata

Rules are evaluated in order; first match wins. Note that omitStages: [RequestReceived] halves the volume — you lose the "request arrived" event and keep the completion event, which carries responseStatus. For a Secrets audit, the completion event is the one you want.

Managed control planes often do not let you configure --audit-policy-file at all. Providers expose audit logging through their own controls — a cloud audit log, a control-plane log export, a managed policy. The same principles apply; the configuration step differs. Whether Spot exposes customer-configurable audit policy is not established by the supplied coverage.

Correlating Kubernetes and Identity Events

Four streams, joined on time and identity:

  1. Provider identity events — credential issuance, use, and revocation for the platform credential.
  2. Kubernetes audit events — Secret requests.
  3. Workload change events — Pod and Deployment creates in the window.
  4. Downstream authentication logs — did any credential actually get used against the database or API?

Synthetic redacted events, with the differences that matter:

Authorized direct read

{
  "kind": "Event",
  "level": "Metadata",
  "stage": "ResponseComplete",
  "requestURI": "/api/v1/namespaces/payments-lab/secrets/reporting-api-key",
  "verb": "get",
  "user": { "username": "system:serviceaccount:payments-lab:reporting-sa" },
  "sourceIPs": ["10.0.4.19"],
  "objectRef": {
    "resource": "secrets",
    "namespace": "payments-lab",
    "name": "reporting-api-key",
    "apiVersion": "v1"
  },
  "responseStatus": { "code": 200 },
  "stageTimestamp": "2026-11-25T09:14:02.121Z"
}

Denied request — identical except responseStatus.code is 403 and reason is Forbidden. A wall of 403s during an incident window is not a comfort; it is someone enumerating.

List request — the critical difference:

{
  "verb": "list",
  "requestURI": "/api/v1/namespaces/payments-lab/secrets?limit=500",
  "user": { "username": "system:serviceaccount:payments-lab:default" },
  "objectRef": { "resource": "secrets", "namespace": "payments-lab", "apiVersion": "v1" },
  "responseStatus": { "code": 200 }
}

There is no name. The event proves a successful list of the namespace's Secrets. It does not tell you which Secrets were in the response, because the response body was not logged — and you should be glad it wasn't. Reconstructing the exposure set from a list event requires a point-in-time object inventory from etcd backups or a snapshot, not from the audit log.

The Limits of the Evidence

  • Missing historical logging cannot be repaired. If audit logging was off during the window, you have no direct evidence. Decide from the worst case, not from absence.
  • Source addresses may be intermediaries. A NAT gateway, a CI runner, or a provider's egress proxy makes sourceIPs nearly useless for attribution.
  • Absence of a logged direct read does not exclude workload-mediated exposure. The kubelet's read is a separate identity (system:node:...) and may be logged with a different shape or filtered out entirely.
  • A single watch event can cover an unbounded number of object disclosures over its lifetime, and the stream does not itemize them.

Alerts worth having, framed as policy failures rather than anomalies:

  • Any get/list/watch on secrets by a principal not in the approved findings table.
  • list on secrets returning more than N objects in a namespace that has no enumerating consumer.
  • Creation or modification of any RoleBinding/ClusterRoleBinding granting secrets or *.
  • Any use of impersonate, bind, or escalate.
  • create on serviceaccounts/token outside known controllers.
  • New Pod creation in a namespace that holds sensitive Secrets, by a principal that has never created one there.

Turn the Kubernetes Secret-Read Audit into a Repeatable Regression Test

A Compact Verification Matrix

The audit is only worth doing once if it isn't re-runnable. Below is a command-driven matrix over approved identities and namespaces. It tests policy, never values.

#CheckCommand shapeExpectedFailure condition
1Required named read allowedauth can-i get secrets/<approved> -n <ns> --as <sa>yesno → outage after remediation
2Unrelated Secret deniedauth can-i get secrets/<other> -n <ns> --as <sa>noyes → over-grant survived
3Unrestricted list deniedauth can-i list secrets -n <ns> --as <sa>noyes → bulk exposure path
4Watch deniedauth can-i watch secrets -n <ns> --as <sa>noyes → live feed of rotations
5Cross-namespace deniedauth can-i get secrets/<approved> -n <other-ns> --as <sa>noyes → ClusterRole via RoleBinding or CRB
6Pod creation constrainedauth can-i create pods -n <ns> --as <sa>noyes → indirect Secret read
7Token minting constrainedauth can-i create serviceaccounts/token -n <ns> --as <sa>noyes → full escalation
8No wildcard Secret grantsjq sweep over ClusterRoles and Rolesemptyany output → wildcard rule
9No unowned Secret bindingsfindings table reviewed0 unassignedany → ownership gap
10Rotation verifiedold credential rejected at issuer401/403200 → rotation incomplete

Fixture failure output, so a broken run is recognisable:

FAIL 3  list secrets in payments-lab: expected no, got yes
FAIL 6  create pods in payments-lab: expected no, got yes

Wire this into CI against a disposable cluster that mirrors production RBAC. A pull request that adds a binding touching secrets should fail the pipeline and require a named approver.

Completion Criteria

Five conditions, each independently checkable:

  1. Every principal with Secret-adjacent access has a named owner. Including the ones you found by accident.
  2. Unnecessary grants are removed — and the matrix re-run afterward proves it, rather than proving one binding was deleted.
  3. Required access still works. A permission audit that breaks reporting is a failed audit.
  4. Every downstream credential in reach has been invalidated at its issuer, with a demonstrated rejection.
  5. Logging coverage is documented, including the honest gaps: what was not collected, for how long, and what that means for the exposure estimate.

Record provider-side questions separately from customer-side findings. "Did the platform credential map to a Kubernetes group, and who audits that group?" is not a question your cluster answers, and mixing it into a findings table of RBAC issues makes both look less certain than they are.

The Rackspace Spot Lesson Is an Access-Path Question, Not a Proven RBAC Diagnosis

Going back to the reported incident: leaked credentials were reportedly used against Rackspace Spot, and customer Kubernetes Secrets were reportedly read. The supplied coverage does not establish the credential type, the Kubernetes authorization path, the affected customer count, the access duration, or which Secret objects were touched. Both items are secondary summaries dated 22 and 23 November 2026, not a vendor advisory.

So I am not going to tell you this was a wildcard ClusterRoleBinding, a cluster-admin service account, or a Kubernetes defect. Any of those could produce the reported outcome. None of them is established.

What I will argue is that the diagnosis is the less useful half of the problem. Whether the path was a provider control-plane component, an over-broad binding, or a leaked kubeconfig, the defensible engineering response is the same three things:

  • Effective access, direct and indirect. Not what the manifests say — what can-i resolves to, and what create pods gets you that get secrets doesn't. Most real Secret exposure in a Kubernetes cluster never touches a secrets verb.
  • Downstream revocation. A platform credential revocation stops future reads. Rotating at the issuing system is the only thing that makes past reads worthless. If you cannot scope the exposure, rotate the reachable set and write down what you accepted.
  • Usable evidence. Metadata-level audit logging for Secrets, correlated with identity and downstream authentication events, retained long enough to answer the question during an incident rather than after it. Logs you didn't collect cannot be backfilled.

The uncomfortable part is that all three are things you control and none of them are things a breach notice will confirm for you. Revoking the login is the press release. Rotating the password it read is the fix.

Further Reading and Source Verification

Secondary Coverage of the Rackspace Spot Report

Both items below are secondary news coverage; the supplied material contains headlines and short summaries rather than a vendor advisory or forensic report. Treat specifics accordingly.

No Rackspace advisory, CVE record, or incident identifier is linked here because I could not verify a specific primary source. If one is published, it supersedes everything in the evidence table above.

Kubernetes Documentation to Verify API Behavior

Share this post

More posts

Loading comments…