NotionCommotion Posted March 10, 2016 Share Posted March 10, 2016 First of all, I acknowledge that my solution below is just a weak crutch for not better security, but it might be all I am capably of... Stupid idea? If even worth pursuing, recommendations of the 3rd party service to query bad IPs? <?php //index.php function verifyWhiteListedIP($ip) { //Query local database to ensure that this IP has been recently verifed as not being bad, and return true or false. return true; //or false } function verifyIP($ip) { // Query some 3rd party DB to see if it has been blacklisted, and return true if okay, else delete from whitelist DB and return false. return true; //or false } function confirmWhiteListIPs() { // Will be called on a 24 hour cron job, and will verify whitelisted IPs are still nice using the above mentioned 3rd party DB, and delete if not } if(whitelisted($_SERVER['REMOTE_ADDR']) || verifyIP($_SERVER['REMOTE_ADDR'])){ //Return HTML, JSON, etc. } else {sayGoodby();} Quote Link to comment https://forums.phpfreaks.com/topic/300969-whitelisting-and-blacklisting-ip-addresses/ Share on other sites More sharing options...
Jacques1 Posted March 10, 2016 Share Posted March 10, 2016 Which problem are you trying to solve? Spam? Excessive scraping? A security-related issue? Completely blocking IPs based on the decision of a third-party service is, obviously, problematic, because an IP can represent anything from a single client to thousands of (innocent) users. In the worst case, you end up with a self-inflicted denial-of-service attack. There are specific cases where the risk can be justified with a significant benefit (e. g. using the blacklists of The Spamhaus Project to prevent e-mail spam), but it's impossible to give any advice without knowing the context. Quote Link to comment https://forums.phpfreaks.com/topic/300969-whitelisting-and-blacklisting-ip-addresses/#findComment-1531839 Share on other sites More sharing options...
NotionCommotion Posted March 10, 2016 Author Share Posted March 10, 2016 Which problem are you trying to solve? Spam? Excessive scraping? A security-related issue? Maybe none. I just look at my Apache log, and see suspect IPs attempting to access, and it just stresses me out. Quote Link to comment https://forums.phpfreaks.com/topic/300969-whitelisting-and-blacklisting-ip-addresses/#findComment-1531851 Share on other sites More sharing options...
Jacques1 Posted March 10, 2016 Share Posted March 10, 2016 If it's a public site, it's only natural that you get requests from all over the world and from all kinds of IP addresses. You can start worrying when the clients actually do something suspicious. Quote Link to comment https://forums.phpfreaks.com/topic/300969-whitelisting-and-blacklisting-ip-addresses/#findComment-1531867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.