Lab 1.4: Deploy a WAF with BIG-IQ and AS3 using an ASM policy on BIG-IP using Policy Builder


Estimated time to complete: 25 minutes

Lab environment access

If you have not yet visited the page Getting Started, please do so.


  1. Larry creates the ASM policy in transparent mode on the BIG-IQ and deploy on the BIG-IP(s).
  2. David creates the AS3 template and reference ASM policy created by Larry in the template.
  3. David assigns the AS3 template to Paula.
  4. Paula creates her application service using the template given by david.
  5. After Paula does the necessary testing of her application, she reaches to Larry.
  6. Larry reviews the ASM learning and deploy the ASM policy changes on the BIG-IP(s) and set the policy to blocking mode.
  7. They all go for happy hour.


1. First make sure your device has ASM module discovered and imported for under Devices > BIG-IP DEVICES.

2. Check if the Web Application Security service is Active under System > BIG-IQ DATA COLLECTION > BIG-IQ Data Collection Devices.

ASM Policy and Security Logging Profile creation (Larry)

Let’s first deploy the default Advance WAF policy and Security Logging Profile available in BIG-IQ to

  1. Login to BIG-IQ as larry.

2. Go to Configuration > Security > Web Application Security > Policies and clone the policy called templates-default and name it as templates-default-cloned.


In this example, we created a clone from an existing policy but you could also create a new policy from one of the default WAF template available in BIG-IQ under Configuration > Security > Web Application Security > Policy Templates.

../../_images/lab-5-1a1.png ../../_images/lab-5-1b1.png
  1. Select templates-default-cloned and change Enforcement Mode to transparent under POLICY BUILDING > Settings, then click on Save & Close.
  1. Under Virtual Servers, click on the inactive virtual server attached to
  1. Select the /Common/templates-default-cloned, then click on Save & Close.
  1. Notice the policy is now attached to the inactive virtual servers.

Select the inactive virtual servers attached to, click on Deploy.

  1. The deployment window opens. Type a name, select Deploy immediately for the Method.

Under the Target Device(s) section, click on Find Relevant Devices and select the Then, click on Deploy.

  1. Confirm the deployment information, click on Deploy.
  1. Wait for the deployment to complete.

Once the deployment is completed, you confirm the changes by clicking on view*.

  1. Deploy the default BIG-IQ Security Logging Profile so the ASM events are being sent correctly to BIG-IQ DCD.


This step is only for your information as it’s already perform in this lab.

Under configuration tab, SECURITY, Shared Security, Logging Profiles. templates-default is the default Security Logging Profile available on BIG-IQ.

  1. Under Pinning Policies, click on the device.

Confirm the logging profile has been added under Logging Profiles.


AS3 WAF template creation (David)

Until now we used a default AS3 template out-of-the-box (available on for deploying an application service. It is a good practice to clone the default AS3 templates and use them more tailored to your custom needs.

  1. Login as david and Go to the Applications tab > Applications Templates and select AS3-F5-HTTPS-WAF-existing-lb-template-big-iq-default-<version> and press Clone.
  2. Give the cloned template a name: AS3-LAB-HTTPS-WAF-custom-template and click Clone.
  1. Open the template AS3-LAB-HTTPS-WAF-custom-template and select the Analytics_Profile AS3 class. Change to Override the Property Collect Client-Side Statistics, as well as Collect URL and Collect User Agent.


Response Code, User Method and Operating System and Browser are already enabled by default in the AS3 schema.

  1. Now, select the Service_HTTPS AS3 class. Change to the property bigip under policyWAF to /Common/templates-default-cloned. Make sure the property is set to Editable.


If you want to hide the ASM policy in the template, you can set the property to Override (only starting BIG-IQ 7.1, see BIG-IQ 7.0 Release note #811013).

  1. Click Save & Close.
  2. Select AS3-LAB-HTTPS-WAF-custom-template and click Publish.
  3. Before paula can use this AS3 template, david needs to update her role. Use the previous steps in Lab 3.2 to add AS3 Template AS3-LAB-HTTPS-WAF-custom-template to Application Creator VMware custom role assigned to paula.

AS3 WAF application service deployment (Paula)

Now both Advance WAF policy and Security Logging Profile are available on BIG-IP and AS3 WAF template available on BIG-IQ, let’s create the WAF application service using AS3 & BIG-IQ.

  1. Login as paula and select previously created LAB_module3 Application and click Create.
  2. Click Create to create an Application Service:
Application properties:
  • Grouping = New Application or Part of an Existing Application
  • Application Name = LAB_module3
  • Description = My second AS3 template deployment through a GUI
Select an Application Service Template:
  • Template Type = Select AS3-LAB-HTTPS-WAF-custom-template [AS3]
General Properties:
  • Application Service Name = https_waf_app_service
  • Target =
  • Tenant = tenant2
Analytics_Profile. Keep default.
  • Members:
  • Virtual addresses:
  • policyWAF: /Common/templates-default-cloned
  • Security Log Profiles: /Common/templates-default
Certificate. Keep default.
TLS_Server. Keep default.
../../_images/lab-5-14a1.png ../../_images/lab-5-14b1.png
  1. Click Create.
  2. Check the application service https_waf_app_service has been created under Application LAB_module3.
  1. Now, let’s look on the BIG-IP and verify the application is correctly deployed in partition tenant2.
  2. Login to BIG-IP from lab environment. Select the partition tenant2 and look at the objects created on the BIG-IP.

7. Notice that new https_waf_app_service comes with a redirect. Select the HTTPS VS, Select Security and hit Policies. Application Security Policy is Enabled and the Log Profile has a templates-default selected.

  1. Back to the BIG-IQ and logged in as paula, select tenant2_https_waf_app_service. What is the enforced Protection Mode?
  1. From the lab environment, launch a remote desktop session to have access to the Ubuntu Desktop.

Open Chrome and navigate to the following URL:

  1. Paula does the necessary testing of her application, she reaches out to Larry when she is done.


There are traffic generator sending good and bad traffic from the Lamp server in the lab.

  1. Paula can update application service health alert rules by clicking on the Health Icon on the top left of the Application Dashboard.
../../_images/lab-5-20a1.png ../../_images/lab-5-20b1.png

ASM Policy Learning review and Dashboard/Events (Larry & Paula)

  1. Login as larry and go to Configuration > Security > Web Application Security > Policies.
  2. Select templates-default-cloned and navigate under POLICY BUILDING > Suggestions and review the learning.
  1. Accept necessary suggestions.


In case the app is deployed on a BIG-IP HA pair, the learning is not sync unless the failover group is set to automatic or the centrally builder feature is used.

  1. Navigate under POLICY BUILDING > Settings, change Enforcement Mode to blocking then click on Save & Close.
  1. Select the templates-default-cloned, click on Deploy to deploy the changes (same as previously done).
  1. Let’s generate some bad traffic, connect on the Ubuntu Lamp Server server and launch the following script:

  2. Check ASM type of attacks by navigating under Monitoring > EVENTS > Web Application Security > Event Logs > Events

  1. Login as paula and select previously created LAB_module3 Application, then click on https_waf_app_service.
  2. In 7.x, the protection mode isn’t automatically updated on the Application Dashboard. This is no longer needed for 8.0 version and above.

Under Properties, select CONFIGURATION, then add upgradeProtectionMode 3/26/20 in the Description field and click Save.

  1. In Application Dashboard, navigate to the Security Statistics and notice the Malicious Transactions.
  1. Stop the bad traffic script, connect on the Ubuntu Lamp Server server and CTRL+C.


Try navigating to from Chrome on the Lamp server.