Forum Discussion

PG0581's avatar
PG0581
Icon for Cirrus rankCirrus
Jul 21, 2022
Solved

Whitelist certain inbound IPs

Could someone verify if this syntax is correct, please? 

I am looking to only permit certain source IPs contained in the data group "abc_ips" when navigating to a URL and dropping anything else. 

 

 

 

when HTTP_REQUEST {
	if { [class match [IP::client_addr] eq "abc_ips" ] } { 
		return
	} else {
		drop
	}
  }

 

 

 

 

  • Hi PG0581 ,

    Yes, syntax looks good to me. Additionally, you can even add the response page with some message to the unwanted source IP addresses who are trying to access it.  Just a suggetion in case you need it. Thanks!

2 Replies

  • Hi PG0581 ,

    Yes, syntax looks good to me. Additionally, you can even add the response page with some message to the unwanted source IP addresses who are trying to access it.  Just a suggetion in case you need it. Thanks!