Reputation: 162
I am getting a lot of spam/unwanted traffic from ips from China for eg. 125.116.123.14 as seen in my FTP logs with attempts log in etc.
Is there a way i can block this in Coldfusion Application.cfc? Currently i am manually going and blocking them on IIS.
Upvotes: 1
Views: 2385
Reputation: 6956
It could be as simple as this in the top of Application.cfc:
<cfif Left(cgi.REMOTE_ADDR, 7) EQ "125.116">
<cfabort/>
</cfif>
You can play with checking patterns and achieve some acceptable results.
But still, I would recommend to handle it at web-server level for better efficiency. I don't know much about advanced IIS stuff, but extensions like Dynamic IP Restictions may work for you.
Upvotes: 1