NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle+0 views

When it comes to Kubernetes and cluster security, what basic measures do you implement?

Practice

AI answer

I start with baseline hardening and least privilege:

  • Enable RBAC and grant only the permissions that are necessary; restrict access to cluster-admin.
  • Secure the API server: allow network access only from trusted addresses, and enable authentication and action auditing.
  • Apply Pod Security Standards (usually restricted wherever possible): do not run containers as root, prohibit privileged mode and unnecessary capabilities, and restrict access to hostPath and host namespaces.
  • Configure NetworkPolicy and verify that the CNI in use actually supports it.
  • Store secrets securely, restrict access to them, enable encryption of data in etcd, and do not put secrets in images or unencrypted manifests.
  • Use trusted and verified images, scan for vulnerabilities, update nodes and components, and set container resource requests and limits.
  • Enable auditing and monitoring, regularly review the configuration, and ensure readiness to restore from backups.

I validate these measures in the context of the specific environment: policies that are too strict can disrupt applications, so I roll them out gradually and test them.