Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrub personal user info when disabling a user #46

Closed
wants to merge 5 commits into from

Conversation

camallen
Copy link
Contributor

No description provided.

if user.disabled?
raise ScrubDisabledUserError.new("Can't scrub personal details of a disabled user with id: #{user.id}")
else
hashed_login_string = Zlib.crc32(user.login).to_s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason you choose this? Mostly just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in the standard ruby libs and seemed to be the same across platforms. I may be wrong. Any thoughts to change it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super sure. I was reading its wikipedia page, and it seems like its probably pretty easy to reverse. I was just wondering if it made sense to hash the user login for deleted users with something cryptographically stronger like bcrypt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So from the meeting in Oxford and #39 we would reserve the right to reverse it should we desire to, e.g. user says my account was hacked and everything is deleted. Not saying that we'd do this but the idea was to remove the personal information (email), change the display name and then hash the login name so we might be able to re-enable the account.

I thought that if the login is unique then the hashed login would not fail the unique login index criteria. Perhaps I should add a retry block with a suffix appender?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think it's fine if we don't consider the user's login to be personal information. Since crc32 isn't a cryptographic hash it doesn't requite a lot of computational power to go from crc32 hash -> plaintext login (it seems even less than md5 or something like that). If we're fine with people who have access to our database having that ability, I'm fine with that. Although it does raise the question about whether we should even hash deleted logins in the first place?

I found this SO Question about CRC collisions. It looks like CRC32 may not be good enough if we have any number of deleted users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points.

Re security, I guess it's just a layer of obfuscation, perhaps we don't need it or we add a crypto hash with a secret key and never lose it.

Re collisions, thoughts on replacement hash functions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it looks like unless we have a way to salt the hash there isn't a reasonable way to store it that won't be vulnerable to a pretty trivial rainbow table attack, and if we salt the hash, there isn't a good way for us to look up a user that wants to re-enable their account.

I also think it may be a bad idea to allow a user's account to be deactivated, and then allow someone to signup with their old login, especially if we tie the login to a users's URL name.

To me it makes the most sense to just leave the login in plaintext, and to offer some sort of "Really delete my entire account" option.

Just leave the login as is since it's not personal information thus avoiding probelms with duplicate login names on revert and uniq index clashes when hashing.
@camallen camallen added this to the v0.0.1 milestone Jun 11, 2014
@edpaget edpaget closed this Jun 11, 2014
@edpaget
Copy link
Contributor

edpaget commented Jun 11, 2014

Merged this but again github didn't close the pull request. I think it might because because I rebased from origin/master after I merged your branch in.

@camallen camallen deleted the scrub_personal_user_info branch June 13, 2014 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants