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

add recordTransformation to DLP with cryptoDeterministicConfig support #9836

Assignees
Labels
Milestone

Comments

@erlanderlo
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

In relation to #9108, adding the cryptoDeterministicConfig for tabular and structured data would be helpful, as well. Learn more about tabular data transformation in the examples of de-identifying tabular docs.

De-identifying tabular data is handled by the recordTransoformation attributes, which will eventually have the same info_type_transformation block with primitive crypto types.

An example from the docs is in the references section.

New or Affected Resource(s)

  • google_data_loss_prevention_deidentify_template

Potential Terraform Configuration

The below example shows performing deterministic crypto for 2 columns and applying the transform to the entirety of the columns. It also shows applying a deterministic crypto for 1 column while looking for 2 particular info types and leaving the rest of the column unchanged.

resource "google_data_loss_prevention_deidentify_template" "table" {
    parent = "projects/PROJECT"
    description = "DESCRIPTION"
    display_name = "DISPLAY_NAME"

    deidentify_config {
        record_transformations: [
            field_transformations: [
                {
                    fields: [
                        {
                            name: "Card_NUMBER"
                        },
                        {
                            name: "DATE_OF_BIRTH"
                        }
                    ],
                    primitive_transformation: {
                        crypto_hash_config: {
                            crypto_key: {
                                kms_wrapped: {
                                    wrapped_key: "B64_WRAPPED_TOKENIZATION_KEY",
                                    crypto_key_name: "projects/PROJECT/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"
                                }
                            }
                        }
                    }
                },
                {
                    fields: [
                        {
                            name: "Notes"
                        }
                    ],
                    info_type_transformations: {
                        transformations: [
                            {
                                infoTypes: [
                                    {
                                        name: "EMAIL_ADDRESS"
                                    },
                                    {
                                        name: "PHONE_NUMBER"
                                    },
                                ],
                                primitive_transformation {
                                    crypto_deterministic_config {
                                        crypto_key {
                                            kms_wrapped {
                                                wrapped_key = "B64_WRAPPED_TOKENIZATION_KEY",
                                                crypto_key_name "projects/PROJECT/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"
                                            }
                                        }
                                    }
                                }                     
                            }
                        ]
                    }
                }
            ]
        ]
    }
}

References

@slevenick slevenick added this to the Goals milestone Aug 23, 2021
@SarahFrench SarahFrench self-assigned this Nov 22, 2022
@SarahFrench
Copy link
Member

SarahFrench commented Apr 28, 2023

I just got a notification about this issue but I can't see what it was 😅

This issue is requesting two things:

1) adding record transformations

e.g. google_data_loss_prevention_deidentify_template.foo.deidentify_config.record_transformations

Completed in PRs:

This is shown in the provider documentation here:

2) Adding cryptoDeterministicConfig support.

e.g. google_data_loss_prevention_deidentify_template.foo.deidentify_config.record_transformations[0].info_type_transformations[0].transformations[0].primitive_transformation.crypto_deterministic_config

This hasn't been completed yet; the field_transformations block doesn't contain info_type_transformations

@JayS-crest
Copy link

JayS-crest commented Apr 29, 2023

I just got a notification about this issue but I can't see what it was 😅

This issue is requesting two things:

1) adding record transformations

e.g. google_data_loss_prevention_deidentify_template.foo.deidentify_config.record_transformations

Completed in PRs:

This is shown in the provider documentation here:

2) Adding cryptoDeterministicConfig support.

e.g. google_data_loss_prevention_deidentify_template.foo.deidentify_config.record_transformations[0].info_type_transformations[0].transformations[0].primitive_transformation.crypto_deterministic_config

This hasn't been completed yet; the field_transformations block doesn't contain info_type_transformations

I was working on another issue regarding DLP and mistakenly commented that here instead hence, I deleted that. Also, regarding the missing attributes of deIdentifyTemplate, I've already added several attributes in a PR and we are going to work on and add the remaining attributes recordTransformation as well.

@github-actions
Copy link

github-actions bot commented Jul 8, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2023
@github-actions github-actions bot added service/dlp forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.