Sign inSign up

checkpoint/infinity-next-nginx-ingress

By checkpoint

Updated over 4 years ago

NGINX Ingress controller with Check Point Nano-Agent for CloudGuard AppSec (Next Generation WAF)

Image
0

10K+

checkpoint/infinity-next-nginx-ingress repository overview

To Install an NGINX with Check Point Nano-Agent for Kuberenetes (k8s) environments:

  1. Replace the docker image used be the NGINX ingress controller with the check point’s NGINX ingress:
  • To get the image use this registry to pull the following NGINX Ingress image for this deployment.
  • The image is based on the official NGINX inc. alpine based ingress controller nginx/nginx-ingress:<version>-alpine
  • If you have a main template for the NGINX configurations make sure you add to the top of it the following line, to load the check point NGINX plugin (which will send the http traffic to the agent for inspection):
    main-template: |
    load_module /usr/lib/nginx/modules/ngx_cp_attachment_module.so;
  • Currently the agent can protect k8s environment only if it uses an official nginx inc. image (nginx-ingress / regular nginx)
  • Currently the agent cannot protect k8s environment with non NGINX ingress controller. In addition the agent does not support Kubernetes’s version of nginx-ingress.
  1. Obtain an agent token from the <a href=https://portal.checkpoint.com>Infinity Next Management Portal - Enforcement/Profile page.

  2. Add the Nano-Agent container image to the deployment yaml file of the NGINX ingress:

  • Use the following registry to pull the Nano-Agent image:
    <a href=https://hub.docker.com/r/checkpoint/infinity-next-nano-agent>checkpoint/infinity-next-nano-agent
  • The image is based on the official alpine docker.
  • Both the agent and above NGINX containers must be of the same version (tag)
  • Add the following argument to the nano agent container’s arg’s array : [ “--token”, “<token>” ]
  • Optional:If your environment's internet connection goes through a proxy server, add the proxy address to the nano agent container’s arg’s array as well : [ “--token”, “<token>”, “--proxy" , “<proxy address in the format http://[user:password@]url:port>” ]
  • Prepare in advanced a volume to be claimed by the agent container (we are creating a stateful set and the agent container requires persistency of some data in cases of restarts / upgrades
  • Add the following two mount paths + associated volume claim templates : “/etc/cp/conf/”, “/etc/cp/data/
  1. The deployment yaml with both NGINX and the agent will look like the following example:
    containers:
    ‐ image: checkpoint/infinity-next-nginx-ingress
    name: nginx-ingress-container
    ports:
    ‐ ... <relevant ports if needed>
    env:
    ‐ ... <relevant env if needed>
    args:
    ‐ ... <relevant args if needed>

    ‐ image: checkpoint/infinity-next-nano-agent
    name: nano-agent-container
    command: ["/cp-nano-agent"]
    args: ["--token", "<token>"]
    volumeMounts:
    ‐ name: cp-nano-agent-conf-volume-claim-template
    mountPath: /etc/cp/conf/
    ‐ name: cp-nano-agent-data-volume-claim-template
    mountPath: /etc/cp/data/

...

volumeClaimTemplates:
‐ metadata:
name: cp-nano-agent-conf-volume-claim-template
spec:
accessMode: [ "ReadWriteOnce" ]

Need to create a storage class resource

storageClassName: "<storage class name as defined in the current environment, e.g. - "gp2" in aws>"
resources:
requests:
storage: 5Mi
‐ metadata:
name: cp-nano-agent-data-volume-claim-template
spec:
accessMode: [ "ReadWriteOnce" ]

Need to create a storage class resource

storageClassName: "<storage class name as defined in the current environment, e.g. - "gp2" in aws>"
resources:
requests:
storage: 5Mi

  1. Deploy the new yaml and monitor the environment to make sure the new ingress pods are up and running

  2. Verify the nginx ingress pods contains both the nginx-ingress and agent containers:

  • Use: kubectl describe pod <nginx pod name> -n <namespace if exists>
  • Under the “Containers” section make sure that both “nginx-ingress-container” and “nano-agent-container” as defined in the example above exist
  1. Navigate to the Infinity Portal > Enforcement > go to the Agents page and make sure that the new Agent is added.

Tag summary

Content type

Image

Digest

Size

50.5 MB

Last updated

over 4 years ago

docker pull checkpoint/infinity-next-nginx-ingress