Lab 4: Web Application Firewall (WAF) ===================================== **Scenario** A security finding indicates that the "send" API endpoint in the Message controller is susceptible to dynamic attacks, such as Cross-Site Scripting (XSS). This vulnerability allows scripts to be rendered within the message window, making them visible to the Customer Service team, an unacceptable security risk. Implement measures to protect this endpoint, and ensure all APIs are safeguarded against dynamic attacks. **Expected Lab Time: 8 minutes** .. note :: This lab will use a pre-built shared WAF object. Refer to `Lab 4 Advanced `_ for additional steps on how to create a WAF object. Task 1: Simulate an Unmitigated Attack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In this task, you will follow steps simulating an attack against an unprotected endpoint. The Distributed Cloud (XC) WAF object is pre-built for the next Task, but please review how to create this object via the Advanced Lab 4. #. Using another browser tab, navigate to the following URL. .. code-block:: text http://.lab-sec.f5demos.com/swagger .. image:: _static/shared-swagger-intro.png :width: 800px #. Within the Swagger page navigate and expand the messageservice/send endpoint, and click **Try it out**. .. image:: _static/lab4-image001.png :width: 800px #. Copy the following JSON, paste within the Request body. Click on **Execute**. .. code-block:: json { "firstName": "Hugo", "lastName": "Weaving", "phoneNumber": "(568) 190-1234", "email": "hugo.weaving@hydra.com", "message": "The revolution has started " } .. image:: _static/lab4-image002.png :width: 800px #. Review the Response, notice how the included **" } .. image:: _static/lab4-image002.png :width: 800px #. Review the Server Response, taking notice of how a block message was presented within the Server Response body. .. image:: _static/lab4-image014.png :width: 800px **End of Lab** .. image:: _static/labend.png :width: 800px