Note:

Add Oracle Cloud Infrastructure Web Application Firewall protection to a flexible Load Balancer

Introduction

Web applications are often targets of malicious attacks that exploit vulnerabilities and misconfigurations in the application. Oracle Cloud Infrastructure Web Application Firewall (OCI WAF) helps you strengthen the security posture of your applications by providing some protection from the common web vulnerabilities, as identified by the Open Web Application Security Project (OWASP) top 10 vulnerabilities. OCI WAF is a regional-based and edge-enforcement service that is attached to an enforcement point, such as an OCI Flexible Load Balancer or a web application domain name.

OCI WAF provides protection to your web application against layer 7 threats with two versions: Edge WAF and Regional WAF (WAF on Load Balancer). WAF on OCI Load Balancers can help you protect your internal applications against insider threats and provide enhanced WAF security for your ‘in-region’ application workloads. WAF on Load Balancer supports both public and private applications. It is best for applications with regional presence. Edge WAF is best for public facing applications/users that are distributed globally.

Edit button

Objective

Apply OCI WAF’s protection capabilities to an OCI Load Balancer.

Prerequisites

Task 1: Set up a flexible load balancer

Task 2: Create a web application firewall policy for the Load Balancer

Web application firewall policies comprise of the overall configuration of your OCI WAF service, including access rules, rate limiting rules, and protection rules.

Note:

  1. Navigate to the OCI Console, Identity & Security, Web Application Firewall.

    Edit button

  2. Choose your compartment and click Create WAF policy.

  3. Enter basic information for the WAF policy- Name and Compartment.

    Edit button

  4. Add a sample access control rule, rate limiting and protection rule.

    • Access Control rule: In this tutorial, we have created an access control rule when the condition of URL path containing the keyword script is met. The rule action will return a HTTP response - 401 unauthorized.

      Edit button

      Rule Output

      Edit button

    • Rate Limiting rule: Rate limiting the access when the condition for URL path containing the keyword rate and accessed for 3 times in a duration of 10 seconds is met. The rule action will return HTTP response - 303 and a message.

      Edit button

      Rule Output

      Edit button

    • Protection rule: In this tutorial, we have enabled protection rule against cross-site scripting (XSS) where WAF recognizes the script injected into the URL based on the XSS rule enabled. If there is an attempt to inject a Cross Site Script in the Load Balancer IP , access is denied as set in the rule.

      Edit button

      Rule Output

      Edit button

  5. Add the Load Balancer (LB_WAF), created in Task 1 as a firewall.

    Edit button

  6. From the Create WAF policy wizard, choose the Review and Create option. Once the WAF policy is created, the following details are displayed.

    Edit button

Acknowledgments

Author: Shruti Soumya (Senior Cloud Security Engineer)

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.