amarjeetAnand
amarjeetAnand

Reputation: 465

track users details in php website for security resasons

i read in an article that we should track users about their ip, browser details, geolocations etc... to help prevent any threat in future and to handle the situation when our website is under attack. . Is it good practice to track user details and would it be ever useful to help prevent when my website is under attack using that tracked data, based on some algorithms? If yes, then what attributes or detais of users should i store for future. . The article also suggested to create log files on database updates to know when and what is happening on the website. . would anyOne please guide me or suggest me some tutorial link on the same.

waiting for your valuable response... thanks for any reply.

Upvotes: 1

Views: 93

Answers (1)

NorthBridge
NorthBridge

Reputation: 674

I'd dare to say it's mostly useless for the following reasons:

  1. IP address - the attacker may be behind a proxy, may use VPN, Tor, may be in a wi-fi cafe or a lot of other options. You can't rely on that.
  2. Browser details - the User-agent he sends you may be absolutely anything. He can be on Firefox and pretend he's on Chrome. Or that he's a potato. Or a chromed potato. You can't rely on that either.
  3. Geolocation - most likely you will be able to track the location of his ISP, but for the reasons in point 1, again you can't rely on that.
  4. Logging these details for every user and every request is going to be a headache if you've got a large amounts of traffic on your website.

Generally anyone who wants to do something bad and knows how to stay anonymous is going to stay anonymous, and you can't help that - deal with it and be careful when you write your code to minimize the possibility of anonymous guys doing bad things.

With this in mind, it's a good idea to look once or twice per month through your webserver's error log and check for unusual activity. If you've got cPanel running, AWStats is a good tool for that.

Cheers!

Upvotes: 1

Related Questions