This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
Update Query Builder to use Masking Strategies on Policy Rules [#47] #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Currently, when the query builder masks data, it replaces it with null values. Instead, update the query builder to use the masking strategies attached to Policy Rules for various data categories. As a first iteration, we'll still only allow null masking policy rules to be created while we get some other pieces in place, but this is a first step to connecting to actual masking strategies.
Future TODO's will include getting masking strategies to work with various data types #37 and have the caller be responsible for generating the key/salt, etc.
Changes
generate_update_stmt
methods for theSQLQueryConfig
andMongoQueryConfig
to replace values with those generated by the masking strategy on the rule policies instead of NoneQueryConfig.build_rule_target_fields
that maps all the rules on the policy to corresponding fields on a collection (via data categories)QueryConfig.update_value_map
that pulls masking strategies off rules and takes in an input value, and returns field names mapped to their masked value.Ticket
https://ethyca.atlassian.net/browse/SOL-220 (old internal ticket)
#47
Resolves #47