Red Hat 3scale API Management on OpenShift
  • Red Hat 3scale API Management on OpenShift Demo
  • documents
    • Access Control based on IP Address
    • AWS S3 Bucket Setup Guide
    • Expose SOAP API Through API Gateway
    • Red Hat 3scale API Management Installation Guide
    • Secure Your API With OpenID Connect OAuth 2.0 Standard
    • Onboarding New API Consumer
    • Virtual Machine Preparation
    • Limit API calls using Rate Limit
    • Secure API with API Key-pair
    • Running Self-Managed API Gateway On VM
    • Self-Managed API Gateway On OpenShift
    • Testing Demo Applications
Powered by GitBook
On this page
  • Steps
  • 1. Get IP Address
  • 2. Add Policy to API Product
  • 3. Testing
  1. documents

Access Control based on IP Address

PreviousdocumentsNextAWS S3 Bucket Setup Guide

Last updated 2 years ago

Steps

1. Get IP Address

Go to to check your IP Address.

Note. You can also use curl https://ifconfig.me command to get your host IP address.

2. Add Policy to API Product

  1. Switch to 3scale admin web console, click API link in the Products panel from the main dashboard.

  2. Select Integration -> Policies menu from left panel. Then click + Add policy link.

  3. Look for the IP Check policy then click on it.

  4. The policy will be added to Policy Chain. Click on the IP Check policy to configure it.

  5. Enter following details, then click Update Policy button.

    • Specifies how to get the client IP....: Select Get the IP from the X-Forwarded-For header (first IP of the list)

    • The type of check to apply: Select Block the IPs included in the list

      Note. In reality, this option should be Allow only the IPs included in the list. But for testing and demonstration purpose, using the Block the IPs... option is easy to demonstrate.

  6. You'll be directed to the Policies dashboard, click on Update Policy Chain button.

  7. Select Integration -> Configuration menu from left panel, then click Promote v.n to Staging APIcast button and then click Promote v.n to Production APIcast button to promote the configuration to Staging APIcast and Production APIcast respectively.

3. Testing

  1. Open a new tab in Postman, then enter the APIcast API Gatway URL.

  2. Copy user_key query parameter from 3scale web console.

  3. Append the copied user_key to the URL in Postman (DO NOT forget to add / character to the end of URL before append the user_key param) and click Send button. You should get error response says IP address not allowed.

List of IPs: Click + button and enter the IP address from above.

step 1
ifconfig.me
1. Get IP Address
2. Add Policy to API Product
3. Testing
access control
access control
access control
access control
access control
access control
access control
access control
access control
access control
access control
access control