Skip to content

Instantly share code, notes, and snippets.

@soeirosantos
Last active January 29, 2020 19:32
Show Gist options
  • Save soeirosantos/d20fb532100b5d06a8f06acfe90210b0 to your computer and use it in GitHub Desktop.
Save soeirosantos/d20fb532100b5d06a8f06acfe90210b0 to your computer and use it in GitHub Desktop.

GKE Security Tips

This is a concise and direct list of tips and best practices for securing your GKE cluster and workloads. While some of them are GKE-specific others are applicable to Kubernetes in general. Please, follow the links for a detailed and in-depth explanation of each topic.

  1. Use Container-Optimized OS - https://cloud.google.com/container-optimized-os/docs/
  2. Enable Automatic Node Upgrades - https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades
  3. Use private cluster and master authorized networks - https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters
  4. Use k8s secrets for sensitive information - https://kubernetes.io/docs/concepts/configuration/secret/
  5. Consider using a secret management tool for sensitive information - https://geekflare.com/secret-management-software/
  6. Use the RBAC API (Roles and RoleBindings) for a finer-grained authorization control - https://kubernetes.io/docs/reference/access-authn-authz/rbac/
  7. Always apply the principle of least privilege to the level of access provided to your users and your application - https://en.wikipedia.org/wiki/Principle_of_least_privilege
  8. Use k8s Network Policies to restrict pod-to-pod communication - https://kubernetes.io/docs/concepts/services-networking/network-policies/
  9. Use k8s Pod Security Policies to control security sensitive aspects of the pod specification (creation and updates) - https://kubernetes.io/docs/concepts/policy/pod-security-policy/
  10. Configure Pod/Container Security Contexts to better define privileges and access control setting - https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

For a much more detailed discussion take a look at the Security Overview and Hardening your Cluster GKE guides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment