Home

Policies

IP Restriction

This custom policy allows you to specify a set of IP addresses that are allowed or blocked from making requests on your API. This can be useful for adding light-weight security to your API in non-critical scenarios. For example, if you want to ensure only employees on your corporate VPN cannot access development environments.

Generally, this policy should not be relied upon as the only security for protecting sensitive workloads.

Configuration#

{
  "name": "my-ip-restriction-inbound-policy",
  "policyType": "ip-restriction-inbound",
  "handler": {
    "export": "default",
    "module": "$import(./modules/YOUR_MODULE)",
    "options": {
      "allowedIpAddresses": [
        "184.42.1.4",
        "102.1.5.2/24"
      ]
    }
  }
}

Options#

  • name the name of your policy instance. This is used as a reference in your routes.
  • policyType the identifier of the policy. This is used by the Zuplo UI. Value should be ip-restriction-inbound.
  • handler/export The name of the exported type. Value should be default.
  • handler/module the module containing the policy. Value should be $import(./modules/YOUR_MODULE).
  • handler/options The options for this policy:
    • allowedIpAddresses

      The IP addresses or CIDR ranges to allow

    • blockedIpAddresses

      The IP addresses or CIDR ranges to allow

Was this article helpful?

Do you have any questions?Contact us
Check out ourproduct changelog