Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

bug 1133709 - use '!' to blank password field #3234

Merged
merged 1 commit into from Jun 12, 2015

Conversation

groovecoder
Copy link
Contributor

This makes it easier for DBA to run the anonymize script.

@openjck
Copy link
Contributor

openjck commented Jun 5, 2015

@groovecoder groovecoder force-pushed the update-anonymize-script-1133709 branch 2 times, most recently from f8aa57f to 9e45743 Compare June 10, 2015 19:42
@groovecoder
Copy link
Contributor Author

Assigning @jezdez ...

@groovecoder groovecoder changed the title bug 1133709 - use '' to blank password field bug 1133709 - use '!' to blank password field Jun 10, 2015
email = CONCAT('user-', id, '@example.com'),
first_name = ROUND(RAND()*1000000),
last_name = ROUND(RAND()*1000000);

UPDATE account_emailaddress SET
email = CONCAT('user-', id, '@example.com');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this shouldn't use the id of the account email address row but the user id the email address refers to, to continue have some relation to the data in the auth_user table. So this should work:

UPDATE account_emailaddress SET email = CONCAT('user-', user_id, '@example.com');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started with that, but then the records violate a unique constraint, since the same user_id can have multiple account_emailaddress records. E.g., for user ID 8, user@gmail.com and user@yahoo.com both become user-8@example.com which violates a unique key constraint.

So I wasn't sure how else to anonymize the email address. 😐

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is that I'm not sure how allauth will react to the data integrity broken between the account_emailaddress and auth_user tables. If we'd use a simple hashing function on the full email address plus a random identifier that is the same for both update statements that should prevent rainbow table attacks since that secret is unknown. Something like:

UPDATE auth_user SET
    -- username left alone, because it's public info
    password = '!',
    email = CONCAT(MD5(CONCAT(email, @common_hash_secret)), '@example.com'),
    first_name = ROUND(RAND()*1000000),
    last_name = ROUND(RAND()*1000000);
UPDATE account_emailaddress SET
    email = CONCAT(MD5(CONCAT(email, @common_hash_secret)), '@example.com');

untested..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll test it ...

@jezdez
Copy link
Contributor

jezdez commented Jun 11, 2015

rwc+

@jezdez jezdez assigned groovecoder and unassigned jezdez Jun 11, 2015
TRUNCATE and scrub allauth tables
@groovecoder groovecoder force-pushed the update-anonymize-script-1133709 branch from 9e45743 to 99d56ce Compare June 12, 2015 11:55
@groovecoder
Copy link
Contributor Author

Updated and spot-checked locally. r? again.

@groovecoder groovecoder assigned jezdez and unassigned groovecoder Jun 12, 2015
@jezdez
Copy link
Contributor

jezdez commented Jun 12, 2015

LGTM

jezdez added a commit that referenced this pull request Jun 12, 2015
…3709

bug 1133709 - use '!' to blank password field
@jezdez jezdez merged commit f975082 into mdn:master Jun 12, 2015
@groovecoder groovecoder deleted the update-anonymize-script-1133709 branch September 1, 2015 13:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants