惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
U
Unit 42
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
博客园 - Franky
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
[EN] Best Practices for Managing Secrets in Kubernetes
Carlos Nogue · 2026-04-25 · via DEV Community

Managing secrets in Kubernetes requires careful attention. The default implementation has significant security limitations. Encoding secrets in base64 offers no real protection, it’s a strategy that exposes sensitive data to serious risks.

Essential Practices for Cluster Administrators

1. Encrypt Secrets at Rest

It is critical to encrypt secret data stored in etcd, Kubernetes’ internal database.

· Immediate action: Configure an encryption provider on the Kubernetes API server. You can do this using an encryption configuration file. For managed clusters (EKS, AKS, GKE), simply enable the managed encryption option.
· Advanced approach (KMS): For stronger security and control, use a Key Management Service provider (AWS KMS, Google Cloud KMS, Azure Key Vault). This enables envelope encryption, where keys are managed externally, reducing the risk of direct etcd access.

2. Control Access with Least Privilege (RBAC)

RBAC is the primary tool for controlling who or what can access secrets.

· Avoid unnecessary privileges: Never grant list, watch, or get permissions on secrets to users or service accounts that don’t explicitly need them. Remember that list permission can be used to view secret content.
· Use namespaces for isolation: Isolate secrets by namespace and use RoleBindings instead of ClusterRoleBindings to restrict access scope.

3. Protect etcd and Cluster Components

Beyond encryption, other measures help secure etcd, the cluster’s core datastore.

· Secure communication: Configure TLS between etcd nodes to protect data in transit.
· Sanitize storage: When decommissioning etcd persistent storage, use secure wiping methods (wipe or shred) to prevent data recovery.

4. Monitor and Audit Access

Auditing can help to detecting unauthorized access.

· Configure audit logs in Kubernetes to generate alerts for suspicious events: example, a single user reading many secrets in a short time.
· Integrate with a SIEM (Security Information and Event Management) tool for deeper analysis.

Essential Practices for Developers

1. Never Hardcode or Share Manifests with Secrets

Avoid storing literal values in code or sharing YAML manifests with plain‑text secrets, even in private repositories. The risk of exposure is too high.

2. Adopt Advanced Secret Management Tools

Instead of relying solely on native Secret resources, use tools that raise the security bar:

· External Secrets Operator (ESO): Synchronizes secrets from an external vault to Kubernetes. The cluster becomes a consumer, not the primary source of sensitive data.
· Secrets Store CSI Driver: Mounts secrets as a volume directly into a pod, avoiding storage in etcd or the Kubernetes API. The application reads the secret from the filesystem.
· HashiCorp Vault: A complete solution for high‑compliance environments, managing the full lifecycle of secrets with advanced access and auditing features.

3. Adopt Secure GitOps
If you store manifests in Git (standard GitOps practice), never commit secrets in plain text. Use encryption tools:

· Sealed Secrets : Encrypts the secret inside the Git repository. Only the controller in the cluster can decrypt it.
· Mozilla SOPS (Secrets OPerationS): Encrypts secret files, which can be versioned in Git, using keys from services such as AWS KMS, GCP KMS, Azure Key Vault, or PGP.

4. Automate Secret Rotation

· Automate with cloud provider : Use automated rotation from your cloud secrets manager (AWS Secrets Manager) combined with ESO. When a secret changes, ESO updates it in the cluster, and the pod can be configured to refresh the environment variable without restarting.
· Handle application restarts : For changes that require pod restarts, use tools like rolloutRestartTargets (from the Vault Secrets Operator) to orchestrate the process automatically.

Myths vs. Reality

It is important to distinguish between encoding and encryption.

Myth - What Kubernetes does not do by default

  1. "A Secret in Kubernetes is encrypted by default."

    Reality: No. A Secret is simply a base64‑encoded string, which offers zero security. Anyone with access to the cluster can decode it.

  2. "If my RBAC is configured, my data is safe."

    Reality: RBAC alone is not enough. Direct access to etcd (or its backups) or to the Kubernetes API (kubectl get secret) exposes all data in plain text, regardless of RBAC.

Summary and Recommendations

Build a robust secret management strategy by starting with the fundamentals and increasing complexity as needed.

Step 1 - Foundation (for everyone)

· Enable encryption at rest for etcd on your managed cluster.
· Implement RBAC with least privilege.
· Educate your team to never store secrets as plain text in Git.

Step 2 - Evolution (for most teams)

· Adopt an external secret manager. Start with the External Secrets Operator (ESO), which is simpler and offers an excellent balance between security and usability.

Step 3 - Advanced (for high compliance)

· If you operate under strict compliance regimes (SOC2, HIPAA) or in multi‑cloud environments, invest in HashiCorp Vault.
· For teams deeply invested in GitOps, use Sealed Secrets or SOPS to encrypt manifests before versioning.

References