Lab 1 - Rules config

  1. Create the default service policy which will allow all
  1. Web App & API Protection -> Service Policies -> Service Policies -> Add Service Policy -> Fill the bellow data -> Save and Exit

    Object Value
    Name default-allow
    Select Policy Rules Allow All Requests
  1. Create the service policy which will verify that the email parameter value is in the appropiate email format
  1. Web App & API Protection -> Service Policies -> Service Policies -> Add Service Policy -> Fill the bellow data

    Object Value
    Name arcadia-parameter-inspection
  2. On the same page click Configure -> Add Item -> Fill the bellow data

    Object Value
    Name email
    HTTP Method POST
  3. On the same page click Configure under the HTTP Path section -> Add Item under the Exact Values section -> Fill the bellow data -> Apply

    Object Value
    Input box that just appeared /v1/login
  4. On the same page click the Show Advanced Fields switch under the Request Match section -> Add Item under Argument Matchers ->

    Object Value
    Argument Name email
  1. On the same page click Add Item under the Regex Values section -> Fill the bellow data -> Apply -> Apply -> Apply -> Save and Exit

    Object Value
    Input box that just appeared
    [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}
    
    Invert Matcher Checked
  1. Before we apply the service policy let’s do some tests
  1. First let’s do a curl request that will simulate a user login request. All will be fine and we expect for the request to succeseed.

    curl -H "Content-Type: application/json;charset=UTF-8" --data-raw "{\"email\":\"satoshi@bitcoin.com\",\"password\":\"bitcoin\"}" http://arcadia-re-$$makeId$$.workshop.emea.f5se.com/v1/login
    
  2. Now we will re run the same request but with the email parameter value being just a number. We won’t be able to login but the request will not be blocked.

    curl -H "Content-Type: application/json;charset=UTF-8" --data-raw "{\"email\":\"11223344\",\"password\":\"bitcoin\"}" http://arcadia-re-$$makeId$$.workshop.emea.f5se.com/v1/login
    
  1. Apply the service policies to the HTTP Load Balancer
  1. Web App & API Protection -> Load Balancers -> HTTP Load Balancer -> Click the 3 dots under the arcadia-re-lb row -> Manage Configuration -> Edit Configuration -> Fill the bellow data -> Save and Exit

    Object Value
    Service Policies Apply Specified Service Policies
  2. On the same page click Configure under Policies -> Add Item -> Fill the bellow data -> Apply -> Save and Exit

    Object Value
    First Input Box $$namespace$$/arcadia-parameter-inspection
    Second Input Box $$namespace$$/default-allow