Access Management for Service Account in Native Tag-Based Masking¶
This section describes how to configure access management for service accounts in Google BigQuery when using Native Tag-Based Masking in Privacera.
Google BigQuery uses service accounts with email addresses in the format:
Bash | |
---|---|
How Privacera Supports Service Accounts¶
Privacera provides built-in support for service account emails by using the following default regex pattern:
Text Only | |
---|---|
- This regex is automatically set for the BigQuery connector.
- If your service account email matches this pattern, no changes are required.
- If a custom email format is used, you can override the pattern using the configuration steps below.
Info
- For instructions on how to create a service account in Google Cloud Bigquery, refer to the link.
Update the Email Regex Pattern in Ranger Admin¶
Perform the following steps to configure access for service accounts in Native Tag-Based Masking:
-
If you're using custom service account formats, update the
RANGER_VALID_EMAIL_REGEX
in Privacera Manager. -
Add or update the following property with value:
YAML -
Save the file and update the Privacera Manager.
-
Create a user under Access Management in the Privacera Portal using the service account email.
Example:<service-account-name>@<project_name>.iam.gserviceaccount.com
Configuration Steps¶
Note
- The values shown below are for example purpose only. Replace them with your actual configuration values.
-
If your service account email matches the pattern shown below, you do not need to add a custom property, as it already matches the default value.
Text Only
-
Navigate to Settings → Applications in the Self-Managed Portal.
-
Select BigQuery from the list of Connected Applications.
-
Click on the application name or the icon, then click on Access Management.
-
Under the ADVANCED tab, add the following property under
Add New Custom Properties
:YAML -
Click SAVE to apply the changes.
-
Open the
vars.connector.bigquery.yml
file located in the connector’s instance directory. -
Add or update the following property:
YAML -
Save the file and update the privacera manager.
-
In PrivaceraCloud, go to Settings -> Applications.
-
Select BigQuery from the list of Connected Applications.
-
Click on the application name or the icon, then click on Access Management.
-
Under the ADVANCED tab, add the following property under
Add New Custom Properties
:YAML -
Click SAVE.
-
Once saved and enabled, the BigQuery connector will start. Then you can hover on the VIEW LOGS button to check the status, either Running or Stopped.
Note
Perform the following steps only if the connector does not reflect the updated configuration and requires a restart.
Restart The BigQuery Connector:
-
Navigate to Settings > Applications, and select the BigQuery connector application .
-
Edit the application, disable it, and click Save.
-
Reopen the same application, enable it, and click Save.
Post-Configuration Verification (GCP CLI)¶
-
Set up Google CLI to verify Service Account Access: Follow the installation instructions in the Google Cloud SDK documentation.
-
Authenticate as the Service Account: Run the following command to authenticate:
-
Install BigQuery CLI tool (Optional): If you don't have the BigQuery CLI tool, you can install it using the following command:
Bash -
Test Access by Running a Query: Verify the service account's access by running the following query:
Bash
- Prev topic: Advanced Configuration