Live data from Hacker News

PostgreSQL Anonymizer

postgresql-anonymizer.readthedocs.io

51–54 of 54 posts

Re: PostgreSQL Anonymizer

#51

One of the best ways to handle this sort of thing is to put things like PII in a separate database entirely and replace it with a token in the "main" database. When something like PII actually needs to be retrieved you first retrieve the token and then search the other database for said token to get the real data. It certainly complicates things but it provides an additional security layer of separation between the P…

A nice tradeoff in many cases is to have a separate schema rather than a separate database, which allows preserving referential integrity and using the database’s RBAC to restrict access to the schemas. This also means things like cascading deletes can still work.

Re: PostgreSQL Anonymizer

#52

One of the best ways to handle this sort of thing is to put things like PII in a separate database entirely and replace it with a token in the "main" database. When something like PII actually needs to be retrieved you first retrieve the token and then search the other database for said token to get the real data. It certainly complicates things but it provides an additional security layer of separation between the P…

What's the difference between this and a user ID that's not publicly exposed?

Re: PostgreSQL Anonymizer

#53

One of the best ways to handle this sort of thing is to put things like PII in a separate database entirely and replace it with a token in the "main" database. When something like PII actually needs to be retrieved you first retrieve the token and then search the other database for said token to get the real data. It certainly complicates things but it provides an additional security layer of separation between the P…

This is a clever approach, thanks for sharing.

Databases like Postgres come with option to use roles and different user accounts, yet many applications have a single user who can see and do everything.

It's overall good practice to compartmentalize data and tasks (e.g. reading vs db schema upgrades vs admin access via web interface etc)

Re: PostgreSQL Anonymizer

#54
post #24

I was actually tasked with building essentially this same thing back in 2014 when I was a junior dev for a fintech startup. They needed an anonymized version of prod database suitable for support team to pull up when trying to reproduce bugs. Did this gigantic thing that would stream the db dump into a C++ app and anonymize it on the fly. Took a similar approach to their masking they do here. Fun project. Company sho…

This is the exact usecase that we are building for with Neosync ( https://github.com/nucleuscloud/neosync )

awesome, feel free to shoot me an email if you want to connect!
Post reply on HN