Version 1.8. This version is supported as outlined in the Anthos version support policy, offering the latest patches and updates for security vulnerabilities, exposures, and issues impacting Anthos clusters on VMware (GKE on-prem). Refer to the release notes for more details. This is the most recent version.

Hardening your cluster's security

With the speed of development in Kubernetes, there are often new security features for you to use. This document describes how to harden your Anthos clusters on VMware (GKE on-prem) clusters.

This document prioritizes high-value security mitigations that require your action at cluster creation time. Less critical features, secure-by-default settings, and those that can be enabled after cluster creation are mentioned later in the document. For a general overview of security topics, review Security.

Checklist

The following deployment checklist highlights best practices for hardening your Anthos clusters platform deployment. For more information about each practice, see the sections in this document.

Deployment checklist Description
Identity and access control

Use vSphere account privileges:
Use a vSphere administrator account with minimal privileges.

Secure Google Cloud service accounts:
Minimize Google Cloud service account privileges.

Configure OpenID Connect (OIDC):
Configure OpenID Connect for user authentication.

Use Kubernetes namespaces and RBAC to restrict access:
Use namespaces with RBAC for administrative isolation and least privilege roles and entitlements.

Data protection

Encrypt vSphere virtual machines:
Set vSphere to encrypt the volumes used by Anthos clusters on VMware.

Manage secrets:
Encrypt secrets at rest.

Network protection

Restrict network access to the control plane and nodes:
Set up controls to isolate and protect the control plane networks and nodes.

Use network policies to restrict traffic:
Implement network policies to restrict intra-cluster traffic.

Declarative security

Use Anthos Config Management policy controller:
Install Anthos Config Management Policy Controller for declarative security policy within your clusters.

Maintenance

Upgrade Anthos:
Make sure that you're running the latest version of Anthos for your platform.

Monitor security bulletins:
Check Anthos security bulletins for the latest advice and guidance on versioning.

Monitoring and logging

Set options for Anthos clusters logging:
Ensure logging is enabled and integrated into a SIEM solution.

Identity and access control

Use vSphere account privileges

The vCenter user account that you use to install Anthos clusters on VMware must have sufficient privileges. For example, a user account that is assigned the vCenter's Administrator role has privileges for complete access to all vCenter objects and provides an Anthos clusters on VMware cluster administrator with full access.

The principle of least privilege is recommended, granting only the necessary privileges to successfully install Anthos. We have predefined the minimum set of privileges needed to perform the installation, as well as the commands needed to grant these permissions.

Secure Google Cloud service accounts

Anthos clusters on VMware requires three Google Cloud service accounts:

  • A predefined service account for accessing the Anthos clusters on VMware software. You create this when you purchase Anthos.
  • A register service account to be used by Connect for registering Anthos clusters on VMware clusters with Google Cloud.
  • A Cloud Logging service account for collecting cluster logs for use by Cloud Logging.

During installation, you bind Identity and Access Management roles to these service accounts. Those roles grant the service accounts specific privileges within your project and can be generated for you during installation.

Configure OpenID Connect

You can only configure authentication at cluster creation time. To configure user authentication for your clusters, use OpenID Connect (OIDC).

Anthos clusters on VMware supports OIDC as one of the authentication mechanisms for interacting with a user cluster's Kubernetes API server. With OIDC, you can manage access to Kubernetes clusters by using the standard procedures in your organization for creating, enabling, and disabling user accounts.

For specific OIDC support, see the following documentation:

Use Kubernetes namespaces and RBAC to restrict access

To give teams least-privilege access to Kubernetes, create Kubernetes Namespaces or environment-specific clusters. Assign cost centers and appropriate labels to each namespace for accountability and chargeback. Only give developers the level of access to their Namespaces that they need to deploy and manage their applications, especially in production.

Map the tasks that users need to complete against the cluster and define the permissions required to complete each task. To grant cluster- and namespace-level permissions, use Kubernetes RBAC.

Beyond the permissions for Google Cloud service accounts used to install Anthos clusters on VMware, IAM does not apply to Anthos clusters on VMware clusters.

For more information, see the following documentation:

Data protection

Encrypt vSphere virtual machines

Anthos clusters on VMware cluster nodes run on virtual machines (VMs) in your vSphere cluster. Google strongly recommends that you encrypt all data at rest. To do so on vSphere, follow the VMware vSphere security PDF and best practice guidance for encrypting VMs.

This must be done prior to the installation of Anthos.

Manage secrets

To provide an extra layer of protection for sensitive data, such as Kubernetes Secrets stored in etcd, configure a secrets manager that is integrated with Anthos clusters on VMware clusters.

If you are running workloads across multiple environments, you might prefer a solution that works for both Google Kubernetes Engine and Anthos clusters on VMware. If you choose to use an external secrets manager, such as HashiCorp Vault, set it up prior to integrating your Anthos clusters on VMware clusters.

You have several options for secrets management:

  • You can use Kubernetes Secrets natively in Anthos clusters on VMware. We expect clusters to be using vSphere encryption for VMs as described earlier, which provides basic encryption-at-rest protection for secrets. Secrets are not further encrypted by default.
  • You can use an external secrets manager, such as HashiCorp Vault. You can authenticate to HashiCorp using either a Kubernetes service account or a Google Cloud service account.

For more information, see the following documentation:

Network protection

Restrict network access to the control plane and nodes

Limit exposure of your cluster control plane and nodes to the internet. These choices cannot be changed after cluster creation. By default, Anthos clusters on VMware cluster nodes are created using RFC 1918 addresses, and it is best practice to not change this. Implement firewall rules in your on-premises network to restrict access to the control plane.

Use network policies to restrict traffic

By default, all Services in a Anthos clusters on VMware cluster can communicate with each other. For information about controlling Service-to-Service communication as needed for your workloads, see the following sections.

Restricting network access to services makes it much more difficult for attackers to move laterally within your cluster and offers services some protection against accidental or deliberate denial of service. There are two recommended ways to control traffic:

  • To control L7 traffic to your applications' endpoints, use Istio. Choose this if you're interested in load balancing, service authorization, throttling, quota, and metrics.
  • To control L4 traffic between Pods, use Kubernetes network policies. Choose this if you're looking for the basic access control functionality managed by Kubernetes.

You can enable both Istio and Kubernetes network policy after you create your Anthos clusters on VMware clusters. You can use them together if you need to.

For more information, see the following documentation:

Declarative security

Use Anthos Config Management policy controller

Kubernetes admission controllers are plugins that govern and enforce how a Kubernetes cluster is used. Admission controllers are an important part of the defence-in-depth approach to hardening your cluster.

The best practice is to use Anthos Config Management's Policy Controller. Policy Controller uses the OPA Constraint Framework to describe and enforce policy as CRDs. The constraints that you apply to your cluster are defined in constraint templates, which are deployed in your clusters.

For information about how to use Policy Controller constraints to achieve many of the same protections as PodSecurityPolicies, with the added ability to test your policies before enforcing them, see Using constraints to enforce Pod security.

For more information, see the following documentation:

Maintenance

Upgrade Anthos

Kubernetes regularly introduces new security features and provides security patches.

You are responsible for keeping your Anthos clusters on VMware clusters up to date. For each release, review the release notes. Additionally, plan to update to new patch releases every month and minor versions every three months. Learn how to upgrade your clusters.

You are also responsible for upgrading and securing the vSphere infrastructure:

Monitor security bulletins

The Anthos security team publishes security bulletins for high and critical severity vulnerabilities.

These bulletins follow a common Google Cloud vulnerability numbering scheme and are linked from the main Google Cloud bulletins page and the Anthos clusters on VMware release notes. Each security bulletin page has an RSS feed where users can subscribe to updates.

When customer action is required to address these high and critical vulnerabilities, Google contacts customers by email. In addition, Google might also contact customers with support contracts through support channels.

For more information, see the following documentation:

Monitoring and logging

Set options for Anthos clusters logging

Anthos clusters on VMware includes multiple options for cluster logging and monitoring, including cloud-based managed services, open source tools, and validated compatibility with third-party commercial solutions:

  • Cloud Logging and Cloud Monitoring, enabled by in-cluster agents deployed with Anthos clusters on VMware
  • Prometheus and Grafana, disabled by default
  • Validated configurations with third-party solutions

Whichever logging solution you choose based on business requirements, we strongly advise logging forward-relevant events and alerts to a centralized security information and event management (SIEM) service for management of security incidents.

For more information, see the following documentation: