ethyca / fides

The Privacy Engineering & Compliance Framework
https://ethyca.com/docs
Apache License 2.0
361 stars 72 forks source link

Added masking_strategy_override at field level #5446

Closed Linker44 closed 1 week ago

Linker44 commented 3 weeks ago

Closes #LA-60

Description Of Changes

This pr adds masking_strategy_overrides at the dataset field-level.

Many masking strict erasure requests fail because some fields dont have the correct format. This is caused by applying the same masking to each field when some of them should remain with a certain format.

ex: an endpoint will only succeed at updating an email field if it has an email format.

          - name: email_address
            data_categories: [user.contact.email]
            fidesops_meta:
              data_type: string
              masking_strategy_override:
                strategy: random_string_rewrite
                configuration:
                  length: 10
                  format_preservation:
                    suffix: "@test.com"

Code Changes

Steps to Confirm

Confirm masking override validation on fides admin:

Confirm masking override validation on startup (nox -s dev):

Confirm masking override is working:

Pre-Merge Checklist

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **fides-plus-nightly** | ⬜️ Ignored ([Inspect](https://vercel.com/ethyca/fides-plus-nightly/GkgfJtuRLoQd62bmMnEWf7Ko55fn)) | [Visit Preview](https://fides-plus-nightly-git-fieldlevelmasking-ethyca.vercel.app) | | Nov 18, 2024 4:24pm |
cypress[bot] commented 3 weeks ago

fides    Run #11040

Run Properties:  status check passed Passed #11040  •  git commit 7d643dc386 ℹ️: Merge b31509540c43bb1e5a1727fa9796c865e264460e into 523c1ab716c666feeca4636b844c...
Project fides
Branch Review refs/pull/5446/merge
Run status status check passed Passed #11040
Run duration 00m 40s
Commit git commit 7d643dc386 ℹ️: Merge b31509540c43bb1e5a1727fa9796c865e264460e into 523c1ab716c666feeca4636b844c...
Committer Facundo Lopez Janza
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎
codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 78.33333% with 13 lines in your changes missing coverage. Please review.

Project coverage is 79.16%. Comparing base (52ac330) to head (1d0382c). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/fides/api/api/v1/endpoints/router_factory.py 30.00% 7 Missing :warning:
src/fides/api/service/connectors/query_config.py 78.57% 1 Missing and 2 partials :warning:
src/fides/api/util/data_category.py 81.81% 1 Missing and 1 partial :warning:
src/fides/core/api.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5446 +/- ## ========================================== - Coverage 85.20% 79.16% -6.04% ========================================== Files 386 387 +1 Lines 24247 24303 +56 Branches 2644 2654 +10 ========================================== - Hits 20659 19239 -1420 - Misses 3033 4550 +1517 + Partials 555 514 -41 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cypress[bot] commented 1 week ago

fides    Run #11047

Run Properties:  status check passed Passed #11047  •  git commit 861201b96c: Added masking_strategy_override at field level (#5446)
Project fides
Branch Review main
Run status status check passed Passed #11047
Run duration 00m 35s
Commit git commit 861201b96c: Added masking_strategy_override at field level (#5446)
Committer Facundo Lopez Janza
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎