Skip to content

Installing NGINX Ingress Controller with integrated Wallarm services

These instructions provide you with the steps to deploy the Wallarm Ingress controller to your K8s cluster using Helm when there are no other non-NGINX Ingress controllers deployed.

Requirements

  • Kubernetes platform version 1.19-1.23

  • Helm package manager

  • Compatibility of your services with the Community Ingress NGINX Controller version 1.1.3 or lower

  • Access to the account with the Administrator role in Wallarm Console for the EU Cloud or US Cloud

  • Access to https://api.wallarm.com:444 for working with EU Wallarm Cloud or to https://us1.api.wallarm.com:444 for working with US Wallarm Cloud

  • Access to https://charts.wallarm.com to add the Wallarm Helm charts. Ensure the access is not blocked by a firewall

  • Access to the Wallarm repositories on Docker Hub https://hub.docker.com/r/wallarm. Make sure the access is not blocked by a firewall

  • Access to GCP storage addresses to download an actual list of IP addresses registered in allowlisted, denylisted, or graylisted countries, regions or data centers

Known restrictions

  • Operation without the postanalytics module is not supported.

  • Scaling down postanalytics module may result in a partial loss of attack data.

Installation

  1. Install the Wallarm Ingress controller.

  2. Enable traffic analysis for your Ingress.

  3. Check the Wallarm Ingress controller operation.

Step 1: Installing the Wallarm Ingress Controller

  1. Go to Wallarm Console → Nodes via the link below:

  2. Create a filtering node with the Wallarm node type and copy the generated token.

    Creation of a Wallarm node

  3. Add the Wallarm chart repository:

    helm repo add wallarm https://charts.wallarm.com
    

  4. Create the values.yaml file with the Wallarm configuration.

    Example of the file with the minimum configuration:

    controller:
      wallarm:
        enabled: "true"
        token: "<NODE_TOKEN>"
    
    controller:
      wallarm:
        enabled: "true"
        token: "<NODE_TOKEN>"
        apiHost: "us1.api.wallarm.com"
    

    <NODE_TOKEN> is the Wallarm node token.

  5. Install the Wallarm packages:

    helm install --version 3.6.9 <INGRESS_CONTROLLER_NAME> wallarm/wallarm-ingress -n <KUBERNETES_NAMESPACE> -f <PATH_TO_VALUES>
    
    • <INGRESS_CONTROLLER_NAME> is the name for the Wallarm Ingress controller
    • <KUBERNETES_NAMESPACE> is the namespace to deploy the Wallarm Ingress controller to
    • <PATH_TO_VALUES> is the path to the values.yaml file

Step 2: Enabling traffic analysis for your Ingress

kubectl annotate ingress <YOUR_INGRESS_NAME> nginx.ingress.kubernetes.io/wallarm-mode=monitoring
kubectl annotate ingress <YOUR_INGRESS_NAME> nginx.ingress.kubernetes.io/wallarm-application="<APPLICATION_ID>"
  • <YOUR_INGRESS_NAME> is the name of your Ingress

  • <APPLICATION_ID> is a positive number that is unique to each of your applications or application groups. This will allow you to obtain separate statistics and to distinguish between attacks aimed at the corresponding applications

Step 3: Checking the Wallarm Ingress Controller operation

  1. Get the list of pods specifying the name of the Wallarm Ingress controller in <INGRESS_CONTROLLER_NAME>:

    kubectl get pods -l release=<INGRESS_CONTROLLER_NAME>
    

    Each pod should display the following: STATUS: Running and READY: N/N. For example:

    NAME                                                              READY     STATUS    RESTARTS   AGE
    ingress-controller-nginx-ingress-controller-675c68d46d-cfck8      3/3       Running   0          5m
    ingress-controller-nginx-ingress-controller-wallarm-tarantljj8g   8/8       Running   0          5m
    
  2. Send the request with test SQLI and XSS attacks to the Wallarm Ingress controller address:

    curl http://<INGRESS_CONTROLLER_IP>/?id='or+1=1--a-<script>prompt(1)</script>'
    

    If the filtering node is working in the block mode, the code 403 Forbidden will be returned in the response to the request and attacks will be displayed in Wallarm Console → Events.

Configuration

After the Wallarm Ingress controller is successfully installed and checked, you can make advanced configurations to the solution such as:

To find parameters used for advanced configuration and appropriate instructions, please follow the link.