Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology

How do I view an ASM policy's id and configure a Whitelisted IP using ASM's Rest API?

I was asked if there is a method to configure an ASM whitelist across several policies. To my knowledge, this is not possible from a global context so my recommendation was to use ASM's Rest API to make the updates. If you have your own method, please share.

Rate this Discussion

Replies to this Discussion


Using the following command I was able to obtain the ASM policy ID.

curl -sk -u admin:password\$select=name | sed 's/,/\'$'\n/g'

Image Text

I then used the following command to add a whitelisted IP address to my policy. I also added an additional option to never block this IP address.

curl -sk -u admin:password -X POST -H "Content-Type: application/json" -d '{"ipAddress":"" , "ipMask":"" , "blockRequests":"never"}'

Image Text