search cancel

Whitelisting is not working

book

Article ID: 237847

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We have whitelisted few ips and its not working as expected

Configuring policy to allow whitelist of ip addresses using regex to extract the IP Address from  X-Forwarded-For header  ${request.http.header.x-forwarded-for} 

Regex stores the results in context variable origin_ip_upated

Problem: After the regex the "Allow access to IP Address Range" does not return true when it should

 

 

Cause

The regex store the context variable into array 

orgin_up_updated = {String[]} size = 1 

[0] = {String} “ip_address

 

When this context variable is evaluated by the  “Allows access to IP Address Range: fails on the context variable

Environment

Release : 10.1

Component : API GATEWAY

Resolution

When this context variable is evaluated by the  “Allows access to IP Address Range: fails on the context variable

 

Solution after the regex use the Set Context Variable to set a new variable from the regex results