Skip to content

Updating the cloud WAF node image

These instructions describe the steps to update the cloud WAF node image deployed on AWS or GCP up to 2.16.

Update procedure

To update the version of the WAF node deployed in the cloud:

  1. Launch a new virtual machine based on the WAF node 2.16 image.

  2. Copy the WAF node settings from the previous version to the new version.

  3. Delete the previous WAF node instance.

A more detailed description of the upgrade steps is provided below.

Step 1: Launch a new instance with the WAF node 2.16

  1. Open the Wallarm WAF node image on Amazon Marketplace or GCP Marketplace and proceed to the image launch.

  2. At the launch step, set the following settings:

    • Select the image version 2.16.x
    • For AWS, select the created security group in the field Security Group Settings
    • For AWS, select the name of the created key pair in the field Key Pair Settings
  3. Confirm the instance launch.

  4. For GCP, configure the instance following these instructions.

Step 2: Connect the WAF node to Wallarm Cloud

  1. Connect to the WAF node instance via SSH. More detailed instructions for connecting to the instances are available in the AWS documentation and GCP documentation.

  2. Connect the WAF node to Wallarm Cloud using a new cloud node token or username and password to the Wallarm Console as described in the instructions for AWS or GCP.

Step 3: Copy the WAF node settings from the previous version to the new version

  1. Copy the settings for processing and proxying requests from the following configuration files of the previous WAF node version to the files of the WAF node 2.16:

    • /etc/nginx/nginx.conf and other files with NGINX settings
    • /etc/nginx/conf.d/wallarm.conf with global WAF node settings
    • /etc/nginx/conf.d/wallarm-status.conf with the WAF node monitoring service settings
    • /etc/environment with environment variables
    • /etc/default/wallarm-tarantool with Tarantool settings
    • other files with custom settings for processing and proxying requests
  2. Restart NGINX to apply the settings:

    sudo systemctl restart nginx
    

Detailed information about working with NGINX configuration files is available in the official NGINX documentation.

The list of WAF node directives is available here.

Step 4: Test WAF node operation

  1. Get the WAF node statistics:

    curl http://127.0.0.8/wallarm-status
    

    The request will return statistics about analyzed requests. Response format is provided below, more detailed description of parameters is available by the link.

    { "requests":0,"attacks":0,"blocked":0,"abnormal":0,"tnt_errors":0,"api_errors":0,
    "requests_lost":0,"segfaults":0,"memfaults":0,"softmemfaults":0,"time_detect":0,"db_id":46,
    "lom_id":16767,"proton_instances": { "total":1,"success":1,"fallback":0,"failed":0 },
    "stalled_workers_count":0,"stalled_workers":[] }
    

  2. Send the request with test SQLI and XSS attacks to the application address:

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

    If the WAF node mode is block, the request will be blocked with the response 403 Forbidden returned.

  3. Send the request to wallarm-status and ensure the values of parameters requests and attacks increased:

    curl http://127.0.0.8/wallarm-status
    
  4. Open Wallarm Console → Events section in the EU Cloud or US Cloud and ensure attacks are displayed in the list.

    Attacks in the interface

Step 5: Creating the virtual machine image based on the WAF node 2.16

To create the virtual machine image based on the WAF node 2.16, please follow the instructions for AWS or GCP.

Step 6: Delete the previous WAF node instance

If the new version of the WAF node is successfully configured and tested, remove the instance and virtual machine image with the previous version of the WAF node using the AWS or GCP management console.