4. Service Policies

This guided lab is used to configure service policies which are used in conjuntion with WAF policies to add additional security controls to an application. The steps in this guide are based on the Service Policy How To guide, as well as the IP Reputation How to

Namespace Service Policies

This section of the guided lab will Add geo-filter and allowed-ip based service policies.

  1. In the left-hand navigation menu, expand the Security section and click Service Policies. In the flyout menu, click the Service Policies link.

    lab001

  2. Click Add Service Policy in the top left area as shown.

    lab002

  3. In the Metadata section enter geo-filter for the Name and then click Rules in the left-hand navigation.

    lab003

  4. Select Denied Sources from the dropdown for Select Policy Rules.

    lab004

  5. Locate the Country List input field, and begin typing Fiji, and then select it from the list that appears.

    lab005

  6. Click the dropdown for Default Action. Observe the available options and select

    Next Policy then click Save and Exit

    lab006

  7. Observe the resulting added geo-filter Service Policy added in your namespace.

    lab007

  8. Open another tab in your browser (Chrome shown), navigate to https://ipinfo.io and note your IP address as shown. (example provided)

    lab008

  9. Return to the Service Policies window and click Add Service Policy.

    lab009

  10. In the Metadata section enter allowed-ip for the Name and then click Rules in the left-hand navigation.

    lab010

  11. Select Allowed Sources from the dropdown for Select Policy Rules

    lab011

  12. locate the IPv4 Prefix List configuration section and click Configure

    lab012

  13. Enter your IP address with mask notation (/32), then click Apply

    lab013

  14. Click the dropdown for Default Action, select Deny, and click Save and Exit.

    lab014

  15. Observe the resulting added allowed-ip Service Policy added in your namespace.

    lab015

    lab016

IP Reputation

Attach Service Policies to your configured Load Balancer.

  1. Return to the Load Balancer in the F5 Distributed Cloud Console, Manage > Load Balancer > HTTP Load Balancers

    lab017

  2. Click Manage Configuration

    lab018

  3. Click Edit Configuration in the top right-hand corner.

    lab019

  4. Click Security Configuration in the left-hand navigation.

    lab020

  5. From the Service Policies dropdown, select Apply Specified Service Policies.

    lab021

  6. In the added menu for Apply Specified Service Policies, click Configure.

    lab022

  7. In the resulting Policies window, use the List of Policies dropdown to select your <namespace>/geo-filter Service Policy. Then click Apply.

    lab023

  8. Returning to the Load Balancer dialogue, note the changes shown in the Service Policies section.

  9. As we are already in this section, we will go ahead and add IP reputation filtering. This can be added as a Service Policy (shared or local namespace) or as a direct configuration.

  10. To start, the IP Reputation configuration, locate the IP Reputation section and click the dropdown menu, then select Enable.

    lab025

  11. Using the List of IP Threat Categories to choose add any of the configured Threat categories.

    lab026

  12. Select Spam Sources and Tor Proxy, then scroll to the bottom of the window and click the Save and Exit button.

    lab027

  13. In your browser (Chrome shown), navigate to your application/Load Balancer configuration: http://<namespace>.lab-sec.f5demos.com

    lab029

  14. You should receive a 403 Forbidden error. This is due to a Service Policy configuration error. Because we only attached the geo-filter Service Policy and the Default Action was Next Policy, there is no other or next policy to “Allow” traffic, therefore, all other traffic is disallowed producing the 403. This is will also show in the Security Events window.

    lab028

  15. Return to the Load Balancer in the F5 Distributed Cloud Console, Manage > Load Balancer > HTTP Load Balancers and use the Action Dots and click Manage Configuration

    lab030

  16. Click Edit Configuration in the top right-hand corner.

    lab031

  17. Click Security Configuration in the left-hand navigation.

  18. From the Service Policies section, click Edit Configuration.

    lab032

  19. In the resulting window click Add Item and from the dropdown select you allow-ip Service Policy <namespace>/allowed-ip.

    lab033

  20. Observe the order. Service Policies must be ordered correctly in a order to process traffic as intended. Click Apply when completed.

    Note

    The allowed-ip begins with an allowed ip (yours) and ends in a “Deny” a positive security model will be applied (denying all other traffic). Similar positive or negative service policies can be created and applied (Headers, methods, file types, etc)

    lab034

  21. Scroll to the bottom of the HTTP Load Balancer configuration and click Save and Exit.

    lab035

  22. In your browser, navigate to the application/Load Balancer URL: http://<namespace>.lab-sec.f5demos.com and successfully log in.

    lab036

Routes

Attach Service Policies to the configured Load Balancer.

  1. Navigate to Manage > Load Balancer > HTTP Load Balancers, click the Action Dots, and click Manage Configuration

    lab037

  2. Click Routes Configuration in the left-hand navigation, and select Edit Configuration

    lab038

  3. Toggle the Show Advanced Fields button to the On position, and Under the Routes section, click Configure.

    lab039

  4. In Routes, click the Add Item link.

    lab040

  5. In the resulting menu, toggle the Show Advanced Fields button to the On position.

    lab041

  6. Observe the various route types and matching criteria controls that can be leveraged to securely control access, perform pool targeting, make path responses or develop custom control to secure protected applications.