valorin,
@valorin@phpc.social avatar

Do you log login attempts in your app? 🤔
Both successes and failures? 😯
Why not? 😧
https://securinglaravel.com/p/security-tip-login-logging

heiglandreas,
@heiglandreas@phpc.social avatar

@valorin Because it*'s logging PII when it's not necessary. You can't loose what you don't have.

And yes: there are ways to enable it for debugging purposes 😁

Because some things can only be debugged in production.

valorin,
@valorin@phpc.social avatar

@heiglandreas
What sort of PII are you worried about throwing into your logs?

You could drop or anonymise the IP if that's a concern, although IP is incredibly useful to correlate app logs with access logs.

Email or Username could be replaced with the user ID, making the messages very generic, but still more helpful than nothing:

"
User login attempt failed.
User logged in successfully.
Unknown user login attempt failed.
"

heiglandreas,
@heiglandreas@phpc.social avatar

@valorin You want the IP. Or any other way to follow "usersessions". And when you need to debug login issues also some user id.

But in general all userinfo is PII. whether that is a name or an email or an ID. As we need to be able to identify the user with it. Even the ID is not anonymized but at max pseudonymized.

So I'd rather only log that in special cases/times for debugging than in general.

heiglandreas,
@heiglandreas@phpc.social avatar

@valorin Only option I see is to use a non-stored hash of some sort of some user info.

That way it should not be possible to identify a specific user from the log entry but you can group things from tue same user. But that is only of limited help in special cases so being able to activate additional logging on-the-fly is helpful.

valorin,
@valorin@phpc.social avatar

@heiglandreas
You're thinking of it purely from a debugging point of view. I'm not talking about debugging, I'm saying that you need logging for security reasons. You need to be able to actively monitor activity and identify attacks on your app. Debugging doesn't and cannot give you this.

heiglandreas,
@heiglandreas@phpc.social avatar

@valorin absolutely. But do you need PII to fimd attack patterns? Or aren't we more talking about an audit trail? Which at least to me isn't about logging but about specific acrions specific users did. Which is rather domain specific and so usually needs a separate process. Especially as that information might need to be kept for legal reasons for a longer time than a log.

valorin,
@valorin@phpc.social avatar

@heiglandreas
I feel like we're going around in circles a bit here...

My point was simply that logging login activity is good for security. That could be verbose logs, or anonymous logs, an audit trail, a separate process, or something else entirely. If you have visibility of what's going on in your login flow, you may be able to identify attacks and malicious behaviour.

If you have PII and/or legal requirements, then by all means follow them. 🤷

heiglandreas,
@heiglandreas@phpc.social avatar

@valorin And all I wanted to point out is: login-data like email-addresses or usernames are already PII.

🤷

valorin,
@valorin@phpc.social avatar

@heiglandreas
Yep, that's fair, blindly logging PII is a bad idea. 🙂

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Laravel
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines