Kubernetes Ingress
Last updated
Was this helpful?
Last updated
Was this helpful?
CloudGuard WAF for Kubernetes protects vulnerable applications and APIs running in Kubernetes environments. It integrates with the most popular , , and as well as Istio Ingress Controller, and serves as a secure HTTP/S load balancer for one or more inside Kubernetes .
For Kong and Istio dedicated instructions, click here:
The NGINX Ingress controller and CloudGuard WAF for Kubernetes agent are deployed together with a single Helm chart. The configuration of the NGINX Ingress controller is done with common methods for configuring Ingress using both Kubernetes Ingress resources or NGINX Ingress resources.
This diagram shows an example of a Kubernetes service exposed outside the Kubernetes cluster with an Ingress controller protected with CloudGuard WAF.
AWS Elastic Kubernetes Service (EKS) or Azure Kubernetes Service (AKS)
The kubectl
and wget
command-line tools installed on your bastion or platform that you use to access the Kubernetes cluster
Run the following command depending on your Kubernetes version:
wget https://cloudguard-waf.i2.checkpoint.com/downloads/helm/ingress-nginx/cp-k8s-appsec-nginx-ingress-4.12.1.tgz -O cp-k8s-appsec-nginx-ingress-4.12.1.tgz
Run the following command depending on your Kubernetes version (Note - package file names contain the name appsec - short for "Application Security" provided by CloudGuard WAF):
helm install cp-k8s-appsec-nginx-ingress-4.12.1.tgz --name-template cp-appsec
--set appsec.agentToken="<token>"
Create a Kubernetes SSL/TLS Secret using the following command with the public key certificate for --cert
.PEM-encoded and matching the private key for --key
:
kubectl create secret tls <certificate-name> --key <private-key-file> --cert $<certificate-file>
Edit your ingress.yaml with your favorite editor
If needed add the following annotation: kubernetes.io/ingress.class: "nginx"
In environments that can allow short downtime, uninstall the older ingress and install the new one.
kubectl apply -f ingress.yaml
In environments that require zero-downtime:
Redirect your DNS traffic from the old ingress to the new ingress
Log traffic from both controllers during this changeover
Uninstall the old ingress once traffic has fully drained from it
For an NGINX-based ingress controller: Kubernetes 1.16.0+ cluster with enabled with Cluster admin permissions
installed on your local machine
Make sure you obtained the token from the page first, you will need it in the command to deploy the Helm chart.
Kubernetes Secrets are used for TLS termination of the Ingress resource. The public/private key pair must already exist before creating the Secret. Read more about Kubernetes TLS Secrets in the .