Skip to main content

IP Filtering

The primary method to secure your deployments' REST endpoints is with API keys. You can add an additional layer of security with IP filtering to limit the IPs that are allowed to send traffic to your deployments.

info

Changes to IP filters take about 1 minute to roll out to all of your deployments.

Create an IP filter

By default, deployments accept REST API traffic from all IP addresses. You can limit the allowed IPs in Settings under Traffic Control.

In the Allowed IPs section, click Add IP Filter. Give your filter a useful description and then set the CIDR. The CIDR must be in IPv4 format.

For example, to limit API traffic to only coming from the IP address 12.34.56.78 you'd set the CIDR 12.34.56.78/32.

REST API traffic that doesn't match an IP filter will be rejected with the error Request Forbidden.

Managing IP filters

From the same screen you can add additional filters, change existing filters, and delete filters. If there are no IP filters present then deployments will accept traffic from all IP addresses.

Monitoring IP traffic

Modelbit's inference logs include the remote IP address of the API caller. You can find it in the remoteIp field for each batch of inferences.

For example:

{
"deploymentName": "example_deployment",
"remoteIp": "35.191.10.24",
"results": [...]
...
}