News for hackers. Stuff that matters.
Re:Logs were our lifeblood, now they're our liability by rubbingalcohol on Tuesday October 08, 2019 @05:11PM (#21197317)
This brings up really good points. One of the best practices going forward is to minimize storage (and logging) of any personally identifiable information.

Under GDPR, IP addresses can be considered PII, so it makes sense to set up an anonymizer for nginx ip address logs. There is a great Stack Overflow answer on this: https://stackoverflow.com/questions/6477239/anonymize-ip-log...

But also there's some app hygeine involved. At least one of the recent "data breach" notifications involved not an actual leak of personal information, but unsanitized logs containing personal information that should not have been shared intra-organizationally. I forget the company that did this, but they notified as if it had been a breach even though passwords had just been logged internally.

When testing it's convenient to do stuff like ``` console.log('username: ', req.body.username); console.log('password: ', req.body.password); ``` but it's all too easy to forget about it when you're working on a million things. So a big part of the solution is mindfulness (do I _really_ need to log this?)

Re:Logs were our lifeblood, now they're our liability by ehsankia on Tuesday October 08, 2019 @05:23PM (#21197417)
At least one? Almost every one of the recent "plaintext password" headlines, of which there has been half a dozen or more, were due to that. And I'm sure there are many more cases happening right now without being noticed. It definitely is big issue.

And no, I don't think in most cases it's forgetting to remove the `console.log(req.body.password)`, but rather having a much wider `console.log(req)` which you didn't realize contains (or could in some other code path contain) a password. Or some log statement much deeper, 2-3 layers of abstractions away, logging some struct passing through the system, which happens to contain PII.

It definitely isn't a trivial issue with a simple solution, as some people commenting on such headlines seem to imply.

Re:Logs were our lifeblood, now they're our liability by ikiris on Wednesday October 09, 2019 @05:02AM (#21201369)
Its not that hard when you taint structs with PII, so that the log library faults if it tries to log it.
Re:Logs were our lifeblood, now they're our liability by zbentley on Wednesday October 09, 2019 @08:38AM (#21202550)
Ah yes, just handle tainting/laundering all data that flows into a system which is hooked up to thousands or hundreds of thousands of external data sources. Not that hard at all.

/s

Re:Logs were our lifeblood, now they're our liability by ikiris on Wednesday October 09, 2019 @07:46PM (#21209436)
So your alternative is... do nothing?
Re:Logs were our lifeblood, now they're our liability by ehsankia on Wednesday October 09, 2019 @08:33PM (#21209721)
Of course if your whole system is written with this in mind, it's doable. But many code bases are huge and fixing them isn't trivial.
Re:Logs were our lifeblood, now they're our liability by hyperman1 on Wednesday October 09, 2019 @04:39AM (#21201238)
This: Under GDPR, IP addresses can be considered PII,so it makes sense to set up an anonymizer

is wrong. First of all, PII is a legal definition from mostly the US. The GDPR talks about Personal Data, which is different. If any consultant is talking about GDPR and PII, he is confused, stop listening. Have fun reading the details here: https://gdpr-info.eu/art-4-gdpr/

Which doesn't matter all that much, because the next part of the line is way to broad:

Is an IP adres Personal Data? Maybe, if you can use it to track an individual. But if you arent an ISP and don't actively try to identify anybody with an IP, stop worrying.

Next question: Do you need it? In general, using them for keeping the website running is normal usage.So no need for consent. Using them for attack prevention might actually be an industry best practice, and then the GDPR requires you to keep them.

Next question: If you need them, how to keep them safe? Throw logs away after a while, encrypt backups, etc...

The GDPR has been hijacked by consulting companies to extract money from everybody, so they do their utmost best to sow paranoia with all kinds of weird urban myths. DOn't believe it. Basically, do the normal IT best practices and stop worrying.

Re:Logs were our lifeblood, now they're our liability by pmoriarty on Tuesday October 08, 2019 @05:35PM (#21197537)
"Under GDPR, IP addresses can be considered PII, so it makes sense to set up an anonymizer for nginx ip address logs."

One thing I wonder about is what you would do if, say, you have an abuser on your site that you need to ban due to behavior detected after the fact through a log file.

If one needs their IP in order to ban them, but their IP is anonymized, what do you do?

Re:Logs were our lifeblood, now they're our liability by jumpingmice on Tuesday October 08, 2019 @06:14PM (#21197863)
There's nothing wrong with retaining full IP address information for the defined purpose of operating your site. Combining such information with other data to perform, say, ad targeting would be more problematic.
Re:Logs were our lifeblood, now they're our liability by bchanudet on Tuesday October 08, 2019 @06:48PM (#21198115)
IP alone is not considered personal data. If this is the only thing you store about a user on your website (for example for a static website), don't bother and keep it as it is.

If you store anything else about the user (their firstname/lastname) and can make a relation between this and the IP (e.g. you can see that this IP went to the page myprofile.php?id=438098 at 23:10 yesterday), then you should already have somewhere where the user can see why you store their firstname/lastname. Just add "IP" to the list of data stored, for the purpose of maintaining your systems safe and accessible, warn that you'll store it for 30 days, because after the logs are purged, and then you're fine.

Re:Logs were our lifeblood, now they're our liability by PeterStuer on Wednesday October 09, 2019 @07:52AM (#21202264)
If you are a B2C site then banning based on IP in today's multi NAT layered internet with non-fixed IP's and mobile devices is probably going to be wildly ineffective and cause far more collateral damage than you think.
Re:Logs were our lifeblood, now they're our liability by Silhouette on Tuesday October 08, 2019 @08:14PM (#21198674)
Our current policy is to retain basic access logs, including IP addresses, potentially indefinitely.

In GDPR terms, we have obvious legitimate interests in being able to identify repeat offenders trying to abuse our system in some way, in being able to identify recurring problems with how our systems are operating, and in tracking long term usage patterns. These interests combined with the very low risk of any adverse consequences should any of the relevant logs leak make our policy of indefinite retention in this specific instance compatible with GDPR in our view.

Incidentally, we have in fact identified repeat abusers returning to our site several years later based on their access patterns and IP addresses as recorded in logs, so there is even an objectively demonstrable long-term threat should anyone ever want to question this policy.

Re:Logs were our lifeblood, now they're our liability by brightball on Tuesday October 08, 2019 @05:58PM (#21197741)
GDPR is supposed to allow retention of certain data for security purposes.
Re:Logs were our lifeblood, now they're our liability by bostik on Wednesday October 09, 2019 @03:07AM (#21200794)
There is also the fact that GDPR cannot overrule industry specific regulations that mandate long-term retention.

I work in gambling industry, and we are required by the regulations to keep ALL user information, including the KYC documents they submit, on file for a minimum of 5 years after their last activity. If you are looking for toxic data stores, this is among the worst ones there is. Limiting access to that data is crucial, and making sure it's not misused is mandatory.

It could be worse. There are domains with more demanding data retention requirements: insurance and consumer finance in particular.

Re:Logs were our lifeblood, now they're our liability by solidasparagus on Tuesday October 08, 2019 @11:43PM (#21199809)
I think you block the IP without correlating it to a given user. Pseudonymity seems like one of the most realistic ways of becoming GDPR compliant without losing the value of data.
Re:Logs were our lifeblood, now they're our liability by DiabloD3 on Tuesday October 08, 2019 @05:36PM (#21197559)
One way hash of the IP.
Re:Logs were our lifeblood, now they're our liability by jacquesm on Tuesday October 08, 2019 @05:39PM (#21197594)
The search space is so small you can simply create a table with all of the hashes and use that to reverse the hash.
Re:Logs were our lifeblood, now they're our liability by thaumasiotes on Tuesday October 08, 2019 @06:06PM (#21197803)
Mandatory IPv6 could finally be here! ;D
Re:Logs were our lifeblood, now they're our liability by GhettoMaestro on Tuesday October 08, 2019 @08:51PM (#21198879)
You could always salt it.
Re:Logs were our lifeblood, now they're our liability by majewsky on Wednesday October 09, 2019 @05:51AM (#21201611)
Salts are only useful when you already know which hash to check e.g. because the user supplied the username that picks which password hash to check. When matching an IP against a list of salted hashes, you need to hash the input with every possible salt to compare against all hashes in the list. So for performance reasons, it's probably not feasible to use more than one salt (or a small number of salts). Then it's again very possible to reverse the list of salted hashes because the search space is number of all IP addresses times number of salts used, which is way less than the number of all hashes.
Re:Logs were our lifeblood, now they're our liability by thaumasiotes on Wednesday October 09, 2019 @01:14AM (#21200239)
How would that address the problem? Salts don't make hashes any less reversible.
Re:Logs were our lifeblood, now they're our liability by EdwardDiego on Wednesday October 09, 2019 @03:45AM (#21200972)
Yeah, we're GDPR bound and henceforth compliant, and nope, a one-way hash isn't sufficient. We just drop the last octet and accept it. I mean, we can still say 'this impression was from a user in Strasbourg', but we enrich the record with that enroute through our pipeline, about the same time as we drop the last octet of the IP.