- Platform Release 6.5
- Privacera Platform Release 6.5
- Enhancements and updates in Privacera Access Management 6.5 release
- Enhancements and updates in Privacera Discovery 6.5 release
- Enhancements and updates in Privacera Encryption 6.5 release
- Deprecation of older version of PolicySync
- Upgrade Prerequisites
- Supported versions of third-party systems
- Documentation changelog
- Known Issues 6.5
- Platform - Supported Versions of Third-Party Systems
- Platform Support Policy and End-of-Support Dates
- Privacera Platform Release 6.5
- Privacera Platform Installation
- About Privacera Manager (PM)
- Install overview
- Prerequisites
- Installation
- Default services configuration
- Component services configurations
- Access Management
- Data Server
- UserSync
- Privacera Plugin
- Databricks
- Spark standalone
- Spark on EKS
- Portal SSO with PingFederate
- Trino Open Source
- Dremio
- AWS EMR
- AWS EMR with Native Apache Ranger
- GCP Dataproc
- Starburst Enterprise
- Privacera services (Data Assets)
- Audit Fluentd
- Grafana
- Ranger Tagsync
- Discovery
- Encryption & Masking
- Privacera Encryption Gateway (PEG) and Cryptography with Ranger KMS
- AWS S3 bucket encryption
- Ranger KMS
- AuthZ / AuthN
- Security
- Access Management
- Reference - Custom Properties
- Validation
- Additional Privacera Manager configurations
- Upgrade Privacera Manager
- Troubleshooting
- How to validate installation
- Possible Errors and Solutions in Privacera Manager
- Unable to Connect to Docker
- Terminate Installation
- 6.5 Platform Installation fails with invalid apiVersion
- Ansible Kubernetes Module does not load
- Unable to connect to Kubernetes Cluster
- Common Errors/Warnings in YAML Config Files
- Delete old unused Privacera Docker images
- Unable to debug error for an Ansible task
- Unable to upgrade from 4.x to 5.x or 6.x due to Zookeeper snapshot issue
- Storage issue in Privacera UserSync & PolicySync
- Permission Denied Errors in PM Docker Installation
- Unable to initialize the Discovery Kubernetes pod
- Portal service
- Grafana service
- Audit server
- Audit Fluentd
- Privacera Plugin
- How-to
- Appendix
- AWS topics
- AWS CLI
- AWS IAM
- Configure S3 for real-time scanning
- Install Docker and Docker compose (AWS-Linux-RHEL)
- AWS S3 MinIO quick setup
- Cross account IAM role for Databricks
- Integrate Privacera services in separate VPC
- Securely access S3 buckets ssing IAM roles
- Multiple AWS account support in Dataserver using Databricks
- Multiple AWS S3 IAM role support in Dataserver
- Azure topics
- GCP topics
- Kubernetes
- Microsoft SQL topics
- Snowflake configuration for PolicySync
- Create Azure resources
- Databricks
- Spark Plug-in
- Azure key vault
- Add custom properties
- Migrate Ranger KMS master key
- IAM policy for AWS controller
- Customize topic and table names
- Configure SSL for Privacera
- Configure Real-time scan across projects in GCP
- Upload custom SSL certificates
- Deployment size
- Service-level system properties
- PrestoSQL standalone installation
- AWS topics
- Privacera Platform User Guide
- Introduction to Privacera Platform
- Settings
- Data inventory
- Token generator
- System configuration
- Diagnostics
- Notifications
- How-to
- Privacera Discovery User Guide
- What is Discovery?
- Discovery Dashboard
- Scan Techniques
- Processing order of scan techniques
- Add and scan resources in a data source
- Start or cancel a scan
- Tags
- Dictionaries
- Patterns
- Scan status
- Data zone movement
- Models
- Disallowed Tags policy
- Rules
- Types of rules
- Example rules and classifications
- Create a structured rule
- Create an unstructured rule
- Create a rule mapping
- Export rules and mappings
- Import rules and mappings
- Post-processing in real-time and offline scans
- Enable post-processing
- Example of post-processing rules on tags
- List of structured rules
- Supported scan file formats
- Data Source Scanning
- Data Inventory
- TagSync using Apache Ranger
- Compliance Workflow
- Data zones and workflow policies
- Workflow Policies
- Alerts Dashboard
- Data Zone Dashboard
- Data zone movement
- Workflow policy use case example
- Discovery Health Check
- Reports
- How-to
- Privacera Encryption Guide
- Overview of Privacera Encryption
- Install Privacera Encryption
- Encryption Key Management
- Schemes
- Encryption with PEG REST API
- Privacera Encryption REST API
- PEG API endpoint
- PEG REST API encryption endpoints
- PEG REST API authentication methods on Privacera Platform
- Common PEG REST API fields
- Construct the datalist for the /protect endpoint
- Deconstruct the response from the /unprotect endpoint
- Example data transformation with the /unprotect endpoint and presentation scheme
- Example PEG API endpoints
- /authenticate
- /protect with encryption scheme
- /protect with masking scheme
- /protect with both encryption and masking schemes
- /unprotect without presentation scheme
- /unprotect with presentation scheme
- /unprotect with masking scheme
- REST API response partial success on bulk operations
- Audit details for PEG REST API accesses
- Make encryption API calls on behalf of another user
- Troubleshoot REST API Issues on Privacera Platform
- Privacera Encryption REST API
- Encryption with Databricks, Hive, Streamsets, Trino
- Databricks UDFs for encryption and masking on PrivaceraPlatform
- Hive UDFs for encryption on Privacera Platform
- StreamSets Data Collector (SDC) and Privacera Encryption on Privacera Platform
- Trino UDFs for encryption and masking on Privacera Platform
- Privacera Access Management User Guide
- Privacera Access Management
- How Polices are evaluated
- Resource policies
- Policies overview
- Creating Resource Based Policies
- Configure Policy with Attribute-Based Access Control
- Configuring Policy with Conditional Masking
- Tag Policies
- Entitlement
- Service Explorer
- Users, groups, and roles
- Permissions
- Reports
- Audit
- Security Zone
- Access Control using APIs
- AWS User Guide
- Overview of Privacera on AWS
- Configure policies for AWS services
- Using Athena with data access server
- Using DynamoDB with data access server
- Databricks access manager policy
- Accessing Kinesis with data access server
- Accessing Firehose with Data Access Server
- EMR user guide
- AWS S3 bucket encryption
- Getting started with Minio
- Plugins
- How to Get Support
- Coordinated Vulnerability Disclosure (CVD) Program of Privacera
- Shared Security Model
- Privacera Platform documentation changelog
Hive UDFs for encryption on Privacera Platform
This topic provides instruction on how to enable encryption using a Hive user-defined function (UDF).
Add Privacera UDF in Hive
To add a Privacera user-defined function (UDF) in Hive, follow these steps:
Log in to the Privacera Portal.
From the navigation menu, select Encryption & Masking > Encryption.
Under the Diagnostics tab, click Encryption.
Click Create for UDF - Protect, UnProtect.
Click Yes.
The UDF is created.
Confirm Privacera UDF in Hive
SSH to the instance.
Do kinit for
<user>
.Connect to beeline.
# Example beeline -u "jdbc:hive2://<hostname>:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" -n $<user>
Enter the following two commands to describe the functions created by Privacera:
DESCRIBE FUNCTION EXTENDED privacera.protect;
DESCRIBE FUNCTION EXTENDED privacera.unprotect;
Note
If the UDF has not been created successfully, you will see the error message “Function ‘privacera.protect’ does not exist”.
Test Privacera UDF in Hive
Log in to Privacera Portal.
From the navigation menu, select Encryption & Masking > Schemes .
Click Add.
Create a scheme by entering the following details:
Scheme Name: SWIFT_ID
Format type: FPE_ALPHA_NUMERIC
Scope: All
Algorithm: FPE
Click Save.
Check if the KMS key is generated for the scheme:
Log in to Ranger at
http://<hostname>:6080
with the username keyadmin.Click Encryption > Key Manager.
SSH to the instance.
Do kinit for
<user>
.Connect to beeline.
#Example beeline -u "jdbc:hive2://<hostname>:2181/; serviceDiscoveryMode=zooKeeper; zooKeeperNamespace=hiveserver2" -n $<user>
After connecting to beeline enter the following commands.
select privacera.protect("TEXT" ,"SWIFT_ID"); select privacera.unprotect(privacera.protect("TEXT" ,"SWIFT_ID"), "SWIFT_ID");
Check the KMS audits in Ranger.
Log in to Ranger
http://<hostname>:6080
with the username keyadmin.Click Audit > Access.
If the UDF fails, the message "denied access" is recorded in Ranger KMS audits.
If access is denied, you need to give permission to `$<user>`.
If the UDF result is successful, the audits are shown as Allowed.
To check crypto UDF logs, run this command:
sudo su tail -f /var/log/hive/hiveserver2.log
Give users access to UDFs
Users need access to the UDFs.
Set up Privacera Encryption
Check if the shaded JAR is needed
You might need to use a shaded JAR depending on certain conditions described below.
To check if the shaded JAR is needed, go to the Hive libraries directory:
cd /opt/cloudera/parcels/CDH/lib/hive/lib/ ls | grep http
You need to install the shaded JAR if:
The version of the http client is less than 4.5.6.
The UDF throws a NoClassDefFound exception for class
org/apache/http/config/Lookup
.
To install the shaded JAR, see Install the shaded JAR.
Create Privacera UDF in CDH/CDP
To install the Privacera Encryption JAR in CDH/CDP cluster, do the following:
Download the JAR to the cluster node.
sudo su - privacera exportPRIVACERA_BASE_DOWNLOAD_URL=$<PRIVACERA_BASE_DOWNLOAD_URL> wget $<PRIVACERA_BASE_DOWNLOAD_URL>/privacera-crypto-jar-with-dependencies.jar -O privacera-crypto-jar-with-dependencies.jar
Upload the JAR into an HDFS location where Hive can access it. The following are the commands to upload the JAR into HDFS using Hadoop CLI:
kinit -kt /opt/privacera/keytab/privacera.headless.keytab privacera hadoop fs -ls hadoop fs -mkdir -p /privacera/crypto/jars hadoop fs -put privacera-crypto-jar-with-dependencies.jar /privacera/crypto/jars/privacera-crypto-jar-with-dependencies.jar
Create configuration files.
hadoop fs -mkdir -p /privacera/crypto/configs
vi crypto.properties
privacera.portal.base.url=http://$<PRIVACERA_SERVER>:6868 privacera.portal.username=$<USER_NAME> privacera.portal.password=$<PASSWORD> #Mode of encryption/decryption rpc/native privacera.crypto.mode=native
cp crypto.properties crypto_default.properties
Upload the configuration files to DBFS.
hadoop fs -put crypto.properties /privacera/crypto/configs/crypto.properties hadoop fs -put crypto_default.properties /privacera/crypto/configs/crypto_default.properties
Install the Crypto JAR into the Cluster.
SSH to the cluster node.
Do kinit for
$<user>
(if Kerberos is enabled).Connect to beeline.
If you have Kerberos-enabled cluster, use the following command to login to beeline:
Update the values for for the variables
<HIVE_SERVER2_HOSTNAME>
and<REALM>
below.HIVE_SERVER2_HOSTNAME=<<10.1.1.2>>REALM=<<EXAMPLE.PRIVACERA.US>>beeline -u "jdbc:hive2://$<HIVE_SERVER2_HOSTNAME>:10000/default;principal=hive/$<HIVE_SERVER2_HOSTNAME>@$<REALM>"
Add Privacera crypto UDF JAR. You need to run multiple SQL queries in Databricks cluster to create privacera encryption functions.
SQL query to create the Privacera unprotect UDF.
add jar hdfs:///privacera/crypto/jars/privacera-crypto-jar-with-dependencies.jar;
Create the Privacera encryption UDF. You need to run multiple SQL queries in beeline to create Privacera encryption UDF.
SQL query to create Privacera unprotect UDF:
create database if not exists privacera ; drop functionif exists privacera.unprotect; create function privacera.unprotect AS 'com.privacera.crypto.PrivaceraDecryptUDF' using jar 'hdfs:///privacera/crypto/jars/privacera-crypto-jar-with-dependencies.jar';
SQL query to create Privacera protect UDF:
drop functionif exists privacera.protect; create function privacera.protect AS 'com.privacera.crypto.PrivaceraEncryptUDF' using jar 'hdfs:///privacera/crypto/jars/privacera-crypto-jar-with-dependencies.jar';
Install the shaded JAR
To install the shaded Privacera Encryption JAR in a CDH/CDP cluster, follow these steps:
Download JAR in cluster node.
sudo su - privacera exportPRIVACERA_BASE_DOWNLOAD_URL=$<PRIVACERA_BASE_DOWNLOAD_URL> wget $<PRIVACERA_BASE_DOWNLOAD_URL>/privacera-crypto-jar-with-dependencies-shaded.jar -O privacera-crypto-jar-with-dependencies-shaded.jar
Upload JAR into HDFS location from where Hive can access it. Following are the commands to upload JAR into HDFS using Hadoop CLI.
kinit -kt /opt/privacera/keytab/privacera.headless.keytab privacera hadoop fs -ls / hadoop fs -mkdir -p /privacera/crypto/jars hadoop fs -put privacera-crypto-jar-with-dependencies-shaded.jar /privacera/crypto/jars/privacera-crypto-jar-with-dependencies-shaded.jar
3. Create configuration files.
hadoop fs -mkdir -p /privacera/crypto/configs vi crypto.properties privacera.portal.base.url=http://$<PRIVACERA_SERVER>:6868 privacera.portal.username=$<USER_NAME> privacera.portal.password=$<PASSWORD> #Mode of encryption/decryption rpc/native privacera.crypto.mode=native cp crypto.properties crypto_default.properties
Upload the configuration files to DBFS.
hadoop fs -put crypto.properties /privacera/crypto/configs/crypto.properties hadoop fs -put crypto_default.properties /privacera/crypto/configs/crypto_default.properties
Install Crypto JAR into cluster.
SSH to the cluster node.
Do kinit for
<user>
(if Kerberos is enabled).Connect to beeline.
If you have Kerberos-enabled cluster, use the following command to login to beeline:
Update the values for
<HIVE_SERVER2_HOSTNAME>
and<REALM>
as per your environment.HIVE_SERVER2_HOSTNAME=<<10.1.1.2>>REALM=<<EXAMPLE.PRIVACERA.US>>beeline -u "jdbc:hive2://$<HIVE_SERVER2_HOSTNAME>:10000/default;principal=hive/$<HIVE_SERVER2_HOSTNAME>@$<REALM>"
Add Privacera Crypto UDF JAR. You need to run multiple SQL queries in Databricks cluster to create Privacera encryption functions.
SQL query to create the Privacera unprotect UDF.
add jar hdfs:///privacera/crypto//privacera-crypto-jar-with-dependencies-shaded.jar;
Create the Privacera encryption UDF. You need to run multiple SQL queries in beeline to create Privacera encryption UDF.
SQL query to create Privacera unprotect UDF .
create database if not exists privacera ; drop functionif exists privacera.unprotect; CREATE FUNCTION privacera.unprotect AS 'com.privacera.crypto.PrivaceraDecryptUDF' using jar 'hdfs:///privacera/crypto/jars/privacera-crypto-jar-with-dependencies-shaded.jar';
SQL query to create Privacera protect UDF.
drop functionif exists privacera.protect; CREATE FUNCTION privacera.protect AS 'com.privacera.crypto.PrivaceraEncryptUDF' using jar 'hdfs:///privacera/crypto/jars/privacera-crypto-jar-with-dependencies-shaded.jar';
Hive TEZ: Add properties file in beeline
If you are using Hive TEZ, before executing the UDFs, you must add the cryptop.properties file in beeline with the following command:
add file hdfs:///privacera/crypto/configs/crypto.properties;
Sample queries to verify setup
Sample query to run encryption:
select privacera.protect("test_data","$<SCHEME_NAME>") limit 10;
Sample query to run encryption and decryption in one query to verify setup:
select privacera.unprotect(privacera.protect("test_data","$<SCHEME_NAME>"),"$<SCHEME_NAME>") limit 10;
For authorization and leveraging Hive Masking policies, you need to install the Hive plug-in in hiveserver2.
If you do not want to install the Hive plug-in, you can authorize use of the keys based on KMS.
Create a view on top of your raw table:
create view secure_view as select col1, privacera.protect(col2, ‘SSN’) as col2 from db.table; select * from secure_view;
If the user is not present in Privacera, they can still access the protect function. It is recommended to use the Hive plug-in as they can control the access to the resource using Ranger Policies and it makes it easier to manage them with the simple UI.