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

Support for data masking in sql server provider #20592

Open
Tracked by #22946
clement911 opened this issue Apr 10, 2020 · 15 comments
Open
Tracked by #22946

Support for data masking in sql server provider #20592

clement911 opened this issue Apr 10, 2020 · 15 comments

Comments

@clement911
Copy link
Contributor

It would be great if we could configure the data masking behavior of columns via migrations.

Docs: https://docs.microsoft.com/en-us/sql/relational-databases/security/dynamic-data-masking

Ideally, there would be a DataMaskingAttribute that we could annotate properties with and the migration would ALTER the column accordingly.

I was inspired by this project: https://github.com/nikitasavinov/EntityFrameworkCore.Extensions

@nguyenlamlll
Copy link

+1 for this feature. We need supports for data masking. #ProtectTheSensitiveData

@MyEidos
Copy link

MyEidos commented Jul 21, 2021

+1 for this feature.

@roji
Copy link
Member

roji commented Jul 25, 2021

For anyone looking for this, it seems possible to adding data masking to an existing table; this means that it's pretty trivial to activate this feature by integrating raw SQL in your migrations, right after EF Core's generated migration code which creates the table.

While this isn't a perfect solution, it's quite a usable workaround, and also means that likely wouldn't be prioritized as highly as other features where EF Core support is absolutely required.

@nikitasavinov
Copy link

nikitasavinov commented Jul 28, 2021

I'm the author of the small library mentioned above (https://github.com/nikitasavinov/EntityFrameworkCore.Extensions), which adds dynamic data masking support to EF Core although in a slightly dirty way as it messes with EF Core internals.

If the core team agrees to add this functionality to the framework, I'm happy to propose a design and implement data masking in EF Core (and get rid of my library).

@roji
Copy link
Member

roji commented Jul 29, 2021

@nikitasavinov we'd certainly welcome this as a contribution! However, be aware that it is now quite late for introducing new enhancements for EF Core 6.0, and the team is currently very busy locking down EF Core 6.0 improvements. So this work would ideally happen for EF Core 7.0, and we'd have time to react to your design/PR starting from 2-3 months from now.

But at that point a design proposal followed by a PR would be great!

@cfauchere
Copy link

cfauchere commented Oct 25, 2021

Is anyone working on this? If nobody is working on it I can put the time. Just let me know @roji

@roji
Copy link
Member

roji commented Oct 26, 2021

@cfauchere I'm not aware of anyone working on this - you're welcome to do so. However, it would be good if you could submit a quick description of what you're planning to add (e.g. API) before starting work, so we can make sure we're in the right direction etc.

@nikitasavinov
Copy link

Hi @cfauchere I was planning to work on it after EF Core 6.0 release, but if you started/want to start - would be great! And if not and @roji you have now time for a design/PR review - I'm happy to move this forward.

My plan was based on this:

So this work would ideally happen for EF Core 7.0, and we'd have time to react to your design/PR starting from 2-3 months from now.

@preardon
Copy link

Is anyone working on this as yet, I'de be happy to help out

@preardon
Copy link

As above, I really need this in the mainline, I am happy to do the work, Just let me know if it needs to be done.

Can I please have an update

@roji
Copy link
Member

roji commented Jul 12, 2022

As I wrote above, we'd welcome a contribution for this - but please submit an API design proposal first.

Also, since it's possible to add masking via raw SQL, the lack of specific support should not block anyone in any way. The number of possible migration tweaks is very large, and EF Core likely won't ever support absolutely everything; using raw SQL for to configure things is completely fine.

@preardon
Copy link

@roji I will submit an API design, Is there a deadline to have this in for EF 7?

@roji
Copy link
Member

roji commented Jul 12, 2022

@preardon at this point it's rather late in the release, and it isn't sure we'll have enough bandwidth to give the PR the proper attention... But you can try...

@preardon
Copy link

@preardon at this point it's rather late in the release, and it isn't sure we'll have enough bandwidth to give the PR the proper attention... But you can try...

Sorry mate, if I had realised noone was working on it earlier I would have done it earlier

@zyofeng
Copy link

zyofeng commented Dec 12, 2023

Anyone just looking at this?
With latest ef core the lib no longer works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants