
Rackspace Spot Breach: How to Protect Kubernetes Secrets from Credential-Based Attacks
According to early reports from BleepingComputer, Rackspace recently warned customers about a significant breach on its Rackspace Spot cloud platform. Attackers gained access using compromised credentials, deployed unauthorized workloads, and—critically—accessed Kubernetes secrets stored in customer clusters. For anyone managing containerized infrastructure, this should feel uncomfortably familiar. Kubernetes secrets are supposed to be the secure vault for sensitive data: API tokens, database passwords, TLS certificates. When that vault gets cracked open, the blast radius is enormous.
This incident isn’t just another headline. It’s a wake-up call about credential hygiene, secrets management architecture, and the gap between what Kubernetes can protect and what it protects by default. Let’s use this breach as the foundation for a technical deep-dive into hardening Kubernetes secrets in production environments—because if Rackspace customers can get burned, so can you.
Table of Contents
- What Went Wrong in the Rackspace Spot Breach
- The Kubernetes Secrets Baseline Problem
- Building Defense-in-Depth for Secrets
- Practical Hardening: RBAC, Encryption, and Rotation
- Detection and Response Strategies
What Went Wrong in the Rackspace Spot Breach
According to the information available, attackers used compromised credentials to breach the Rackspace Spot platform. Once inside, they deployed unauthorized workloads—a classic lateral movement tactic—and accessed Kubernetes secrets in customer clusters. The credential compromise was the entry point, but the architecture allowed the attackers to pivot directly into the crown jewels: secrets that likely contained database credentials, cloud provider tokens, and application-level keys.
This chain of events highlights two uncomfortable truths. First, credentials will get compromised—phishing, credential stuffing, leaked tokens in GitHub repos, or insider threats. Second, once an attacker has a valid credential, your Kubernetes RBAC and secrets encryption posture becomes your last line of defense. If you haven’t designed that defense intentionally, you’re running on defaults—and defaults are rarely secure enough for production.
The Kubernetes Secrets Baseline Problem
Kubernetes secrets are stored in etcd, the distributed key-value store that backs your cluster state. By default, those secrets are base64-encoded but not encrypted at rest. If an attacker compromises your etcd data or gains API server access with sufficient permissions, they can retrieve every secret in your cluster. Base64 is obfuscation, not encryption—it’s trivial to decode.
Many security-focused engineers are surprised to learn this. When you run kubectl create secret generic db-password --from-literal=password=SuperSecret123, you’re creating an object that looks secure in your YAML manifests but sits in etcd as plaintext (or barely obfuscated). For anyone looking to level up their Kubernetes security knowledge systematically, platforms like Coursera offer structured courses on cloud-native security that cover these architectural gaps in detail.
The second baseline problem is RBAC scope creep. Many clusters grant overly broad permissions—service accounts with cluster-admin roles, or developers with get secrets permissions across all namespaces. When credentials for one of those accounts are compromised, the attacker inherits those excessive privileges.
Building Defense-in-Depth for Secrets
Defense-in-depth means layering multiple controls so a single failure doesn’t lead to total compromise. For Kubernetes secrets, that means combining encryption at rest, strict RBAC, secrets rotation, and external secrets management. Let’s walk through each layer with working examples you can implement today.
Enable Encryption at Rest for etcd
The first step is enabling encryption at rest for secrets in etcd. This requires configuring the Kubernetes API server with an EncryptionConfiguration. Here’s a minimal working example:
# /etc/kubernetes/encryption-config.yaml
apiVersion: apiserver.config.k8s.io/v1
kind: EncryptionConfiguration
resources:
- resources:
- secrets
providers:
- aescbc:
keys:
- name: key1
secret: BASE64_ENCODED_32_BYTE_KEY_HERE
- identity: {} # Fallback to unencrypted for migration
Generate a 32-byte random key and base64-encode it: head -c 32 /dev/urandom | base64. Then update your API server manifest (usually /etc/kubernetes/manifests/kube-apiserver.yaml on control plane nodes) to include the flag:
--encryption-provider-config=/etc/kubernetes/encryption-config.yaml
After restarting the API server, all new secrets will be encrypted. To encrypt existing secrets, run:
# Force rewrite of all secrets to apply encryption
kubectl get secrets --all-namespaces -o json | kubectl replace -f -
Now, even if an attacker dumps your etcd data, they’ll find encrypted blobs instead of plaintext passwords. This single step would have significantly raised the bar for the Rackspace attackers.
Implement Least-Privilege RBAC
RBAC controls who can read, create, or modify secrets. The principle: grant only the minimum permissions necessary. Never use cluster-admin for application service accounts. Here’s a locked-down Role that allows a pod to read only its own namespace’s secrets:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: production
name: secret-reader
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
resourceNames: ["db-password", "api-token"] # Explicit allow-list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: read-secrets
namespace: production
subjects:
- kind: ServiceAccount
name: app-service-account
namespace: production
roleRef:
kind: Role
name: secret-reader
apiGroup: rbac.authorization.k8s.io
Notice the resourceNames field. This restricts access to specific secrets by name, not all secrets in the namespace. If your application only needs two secrets, don’t give it permission to read twenty. For security teams looking to build practical hands-on expertise with RBAC policies and cloud security, DataCamp offers interactive labs that let you test these configurations in live environments.
kubectl auth can-i --list --as=system:serviceaccount:namespace:sa-name to see exactly what permissions a service account has. You’ll often find surprising privileges you didn’t realize were granted.Practical Hardening: RBAC, Encryption, and Rotation
Beyond encryption at rest and RBAC, secrets rotation is critical. Compromised credentials lose value if they expire quickly. Many breaches succeed because stolen credentials remain valid for months or years. Kubernetes doesn’t rotate secrets automatically—you need to build that into your operational workflow.
Automate Secrets Rotation
Use external secrets managers like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault, integrated via operators like External Secrets Operator. These tools provide dynamic secrets with short TTLs, automatic rotation, and audit logging. Here’s a simplified External Secrets Operator example:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: db-credentials
namespace: production
spec:
refreshInterval: 1h # Fetch and rotate every hour
secretStoreRef:
name: vault-backend
kind: SecretStore
target:
name: db-password # Kubernetes secret name
creationPolicy: Owner
data:
- secretKey: password
remoteRef:
key: database/prod/password
property: value
This configuration pulls secrets from Vault every hour, automatically updating the Kubernetes secret. If a credential is compromised, your rotation window limits the exposure to hours, not months.
Implement Network Policies
Even with strong RBAC, an attacker who deploys an unauthorized workload—as happened in the Rackspace breach—can try to access secrets via the API server. Network policies can restrict pod-to-API-server communication. Here’s an example that blocks all pods except those labeled trusted=true:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: restrict-api-access
namespace: production
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- podSelector:
matchLabels:
trusted: "true"
ports:
- protocol: TCP
port: 443
This won’t stop a determined attacker with valid credentials, but it adds friction and reduces the attack surface for lateral movement.
Detection and Response Strategies
Prevention is essential, but detection is where you catch the breaches you couldn’t prevent. Enable Kubernetes audit logging to track all API server requests, especially get and list operations on secrets. Configure your audit policy to log at the RequestResponse level for secrets:
apiVersion: audit.k8s.io/v1
kind: Policy
rules:
- level: RequestResponse
resources:
- group: ""
resources: ["secrets"]
- level: Metadata
omitStages:
- RequestReceived
Ship these logs to a SIEM or log aggregator. Alert on anomalies: service accounts accessing secrets they’ve never touched before, mass secret enumeration, or API calls from unexpected source IPs. In the Rackspace case, unauthorized workload deployment should have triggered immediate alerts—if that telemetry was in place.
Runtime security tools like Falco can detect suspicious behavior inside running containers, such as attempts to read /var/run/secrets/kubernetes.io/serviceaccount/token (the mounted service account token) or unexpected outbound connections. These signals, combined with audit logs, give you a fighting chance to detect and respond before exfiltration happens.
Conclusion: Treat Secrets Like the Keys to the Kingdom
The Rackspace Spot breach is a stark reminder that Kubernetes secrets are only as secure as the architecture you build around them. Compromised credentials are inevitable—phishing works, tokens leak, and misconfigurations happen. What separates a contained incident from a catastrophic breach is whether you’ve layered encryption at rest, least-privilege RBAC, secrets rotation, and robust detection.
Start with the fundamentals: enable etcd encryption, audit your RBAC policies, and integrate an external secrets manager for dynamic rotation. Then layer in network policies, audit logging, and runtime detection. These aren’t exotic best practices—they’re production-grade hygiene that every Kubernetes operator should implement before the first production workload goes live.
The attackers in the Rackspace breach found a path from compromised credentials to Kubernetes secrets because the defensive layers weren’t strong enough. Don’t let your infrastructure be the next case study. Build defense-in-depth today, before the breach notification goes out tomorrow.