Modify the WAF Policy to Resolve an App Issue

  1. In Firefox, open a new tab, then click the Arcadia Finance (N+) bookmark or navigate to
  1. You should see a partially blank page load as shown below.
  1. Now, click on the Arcadia Finance (DIY) bookmark or navigate to
  1. Notice that this page includes more images than the Arcadia Finance (N+) page.
  1. Load the Arcadia Finance (N+) bookmark again. Now, we will make a request for the missing image in the blank section of the web page. In your Jump Server RDP session, click Applications and then Terminal.
../../../_images/terminal_click.png ../../../_images/terminal_new.png
  1. In the terminal window that opens, enter the command below.
curl -X POST -k -H "host:" "https://nginx-plus-1.appworld.lab/images/slider/slide-img-3.jpg" |& sed 's/>/>\n/gI'
  1. NGINX App Protect intercepted the request and responded with this custom page. Notice that a support ID is generated in the terminal output. You can use this ID to identify the cause of the image block. Select and copy this value so that you can search for it in SM.
  1. Return to NIM and navigate to Security Monitoring by clicking the drop-down in the top left of the screen and selecting Security Monitoring.
  1. You’ll be presented with the Security Monitoring landing page, as shown below:
  1. On the left menu, select Support ID Details.
  1. You’ll be prompted for your support ID.
  1. Enter your support ID into the search field and click the arrow to search. If you receive an error, the system is still processing the alert; wait a bit and click Try Again.


At anytime in this lab you encounter a support ID, feel free to return to this tool to look at the details of the attack and mitigation.

  1. Once the security event has loaded, you can see details surrounding the violation that is blocking images on your app.
  1. Notice that the image URI is listed as /images/slider/slide-img-3.jpg.
  1. If you scroll down to the Attack Details section, you can expand the individual sections showing Violations, Subviolations, CVEs, and Threat Campaigns.
  1. Notice that the Violations section shows an Illegal File Type violation.
  1. You need to allow JPG files to enable the application to operate properly. To do this, you will need to modify the WAF policy. Start that process by navigating back to Instance Manager from the Select module drop-down at the top of the left menu bar.
  1. Inside of the Instance Manager dashboard, click on App Protect, then Policies towards the bottom of the left menu bar.
  1. Click on the AppWorldPolicy in the policy list.
  1. Now, click on the Versions tab inside of the Policy Detail page.
  1. Click on the version name under the Versions column in the list.
  1. The JSON configuration of the policy will be displayed, as shown below:
  1. To modify the policy based on this version of the policy, click Edit Version.
  1. Provide a description of the changes you’ll be making in the Description field.
  1. Place your mouse cursor inside the policy editor. Press CTRL+F to open the search dialog.
  1. Search for “jpg” and you’ll find on line 240 that JPG files are not being allowed. Modify line 241 to change "allowed": false to "allowed": true. Note that false and true are not encapsulated in quotation marks.
  1. Click the Save New Version button to create a new version of the policy.
  1. You will see confirmation that the new version has been created.
  1. Click on the policy name at the top of the screen.
  1. Select the Versions tab.
  1. Notice the new policy version is now listed.
  1. Return to the the Deployments tab.
  1. Now click on the Assign Policy and Signature Versions button above the instance list.
  1. Notice that the version listed in the Policy Version column is in a drop-down box. You may need to hover your mouse arrow over this section to see the drop-down appear.
  1. Change this to your newer version (compare timestamps) and click Publish.
  1. A pop-up will confirm that you have changed the version.
  1. Click X to close the confirmation window.
  1. Click Cancel to close the assignment window.
  1. On the top of the left menu bar, click Instances.
  1. Select the nginx-plus-1 instance from the list.
  1. Look for the deployment status in the Last Deployment Details section. You should see a status of Successful. If not, wait a few moments for the deployment to commence and complete. You may need to refresh your browser for the status to update.
  1. Once the deployment has finished, check the site to see if the issue is remediated. Go back to the Terminal that is open on the Jump Server and enter the command below.
curl -X POST -k -H "host:" "https://nginx-plus-1.appworld.lab/images/slider/slide-img-3.jpg" -o slide-img-3.jpg && file slide-img-3.jpg | sed 's/, /\n/gI'

The command will attempt to download the jpg image, and inspect its contents. You should see output as in the screenshot below signifying that the file has been downloaded successfully, and is no longer being blocked by the WAF policy.


Now that you have viewed, diagnosed and remedied a false positive in a WAF policy, continue to the next section of the lab.