Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Audience: System Administrators
Content Summary: Immuta offers both fine- and coarse-grained protection for Hive and Impala tables for users who access data via the Immuta Query Engine or the Spark Integration. However, additional protections are required to ensure that users cannot gain unauthorized access to data by connecting to Hive or Impala directly. Cloudera recommends using the Sentry service to secure access to Hive and Impala. As an alternative, this guide details steps that CDH cluster administrators can take to lock down Hive and Impala access without running the Sentry service.
Each section in this guide is a required step to ensure that access to Hive and Impala is secured.
After installing Immuta on your cluster, users will still be able to connect to Hive via the hive shell, beeline
, or JDBC/ODBC connections. To prevent users from circumventing Immuta and gaining unauthorized access to data, you can leverage HDFS Access control lists (ACLs) without running Sentry.
See the official Cloudera Documentation to complete this step.
In order to leverage ACLs to secure Hive, Hive impersonation must be enabled. To enable Hive impersonation in Cloudera manager, set hive.server2.enable.impersonation, hive.server2.enable.doAs
to true
in the Hive service configuration.
Group in this context refers to Linux groups, not Sentry groups.
You must configure ACLs for each location in HDFS that Hive data will be stored in to restrict access to hive
, impala
, and data owners that belong to a particular group. You can accomplish this by running the commands below.
In this example, we are allowing members of the hive
and examplegroup
to select & insert on tables in hive. Note that the hive
group only contains the hive
and impala
users, while examplegroup
contains the privileged users who would be considered potential data owners in Immuta.
By default, Hive stores data in HDFS under /user/hive/warehouse
. However, you can change this directory in the above example if you are using a different data storage location on your cluster.
After installing Immuta on your cluster, users will still be able to connect to Impala via impala-shell
or JDBC/ODBC connections. To prevent users from circumventing Immuta and gaining unauthorized access to data, you can leverage policy configuration files for Impala without running Sentry.
Group in this context refers to Linux groups, not Sentry groups.
The policy configuration file that will drive Impala's security must be in .ini
format. The example below will grant users in group examplegroup
the ability to read and write data in the default
database. You can add additional groups and roles that correspond to different databases or tables.
This policy configuration file assigns the group called examplegroup
to the roles example_insert_role
and example_select_role
, which grant insert and select (read and write) privileges on all tables in the default
database.
See the official Impala documentation for a detailed guide on policy configuration files. Note that while the guide mentions Sentry, running the Sentry service is not required to leverage policy configuration files.
Next, place the policy configuration file (we will call it policy.ini
) in HDFS. The policy file should be owned by the impala
user, and should only be accessible by the impala
user. See below for an example.
You can configure Impala to leverage your new policy file by navigating to Impala's configuration in Cloudera Manager and modifying Impala Daemon Command Line Argument Advanced Configuration Snippet (Safety Valve)
with the snippet below.
You must restart the Impala service in Cloudera Manager to implement the policy changes. Note that server_name
should correspond to the server
that you define in your policy roles. Also note that each key-value pair should be placed on its own line in the configuration snippet.
Audience: Data Owners and Data Users
Content Summary: Immuta integrates with your Hadoop cluster to provide policy-compliant access to data sources directly through HDFS. This page instructs how to access data through the HDFS integration, which only enforces file-level controls on data. For more information on installing and configuring the Immuta Hadoop plugin, see the installation tutorial. There is also a Spark SQL integration should you need to enforce row-level and column-level controls on data.
The Immuta Hadoop plugin can also be integrated with an existing kerberos setup to allow users to access HDFS data using their existing kerberos principals, with data access and policy enforcement managed by Immuta.
When Immuta is installed on the cluster, users can only access data through HDFS using the HDFS principal that has been set for them in Immuta. This principal can only be set by an Immuta Administrator or imported from an external Identity Manager, but Immuta users can view their principal via the profile page.
In order to access data through Immuta's HDFS Integration, you must be authenticated as the user or principal that is assigned to your Immuta HDFS principal.
For clusters secured with kerberos, you must successfully kinit
with your Immuta HDFS principal before attempting to access data.
For insecure clusters, you must be logged in to the cluster as the system user that is assigned to your HDFS principal.
Immuta's HDFS integration allows you to access data two different ways:
The immuta:///
namespace allows you to access files in relation to the Immuta data source that it is part of. For example, if you want to access a file called december_report.csv
that is part of an Immuta data source called reports
, you can access it with the following path:
immuta:///immuta/reports/december_report.csv
Note that the path to the file is relative to the Immuta data source that it falls under, not the real path in HDFS. Also, immuta:///
is restricted to only paths that a user can see - files that the user is not authorized for will not be visible.
The HDFS integration also allows users to access data using native HDFS paths. Authorized data source subscribers can access the file december_report.csv
through its native path in HDFS:
hdfs:///actual/path/in/hdfs/december_report.csv
Note that in order for a user to access data using hdfs:///
paths, there must be a hdfs:///user/<user>/
directory where <user>
corresponds to the user's Immuta HDFS principal. Also, hdfs:///
paths will allow users to see locations of all files, but they will only be able to read files that they have access to in Immuta.
Both methods of accessing data will be audited and compliant with data source policies. If users are not subscribed to or are policy-restricted by the data source that a file in HDFS falls under, they will not be able to access the file using either namespace.
Immuta users with the IMPERSONATE_HDFS_USER
permission can create HDFS, Hive, and Impala data sources as any HDFS user (provided that they have the proper credentials). For more information, see the tutorial for creating a data source.
Audience: Data Owners and Data Users
Content Summary: Users can access subscribed data sources within their Spark jobs by using SparkSQL with the
ImmutaSession
class (Spark 2.4). Immuta enforces SparkSQL controls on data platforms that support batch processing workloads. Through this process, all tables are virtual and empty until a query is materialized.When a query is materialized, standard Spark libraries access data from metastore-backed data sources (like Hive and Impala) to retrieve the data from the underlying files stored in HDFS. Other data source types access data using the Query Engine, which proxies the query to the native database technology and automatically enforces policies for each data source.
Security of data sources is enforced both server-side and client-side. Server-side security is provided by an external partitioning service and client-side security is provided by a Java SecurityManager to moderate access to sensitive information.
Audience: Data Owners and System Administrators
Content Summary: This guide augments the documentation on Spark, focusing on how and when you should use the Immuta Spark integration on your cluster.
When you create Hive or Impala tables from your data in HDFS, it may require policies restricting who can see specific rows and columns. This becomes complex on a Hadoop cluster because not only do you need to protect the Hive and/or Impala tables, but you also need to protect the data that back those tables.
For example, when you run SparkSQL, although it does reference Hive or Impala tables, it does not actually read any data from them. For performance reasons it reads the data directly from HDFS. This means that any protections you set on those Hive or Impala tables through Sentry or Ranger will not be applied to the raw file reads in SparkSQL. And in fact, those files need to be completely open to anyone running SparkSQL jobs.
Immuta enforces policy controls not only on the Hive and Impala tables, but also the backing files in HDFS.
Should you want to enforce row and column level controls on data in HDFS, you must associate some structure to that data. This is done by creating tables in Hive or Impala from that data in HDFS. Once those tables are created, you can then expose them as data sources in Immuta like you normally would any other database.
The difference, though, is that Immuta will not only enforce the controls through the Immuta Query Engine, but will also dynamically lock down the backing files in HDFS. That means if anyone tries to read those files, they will be denied access. In order to read these files, users can use SparkSQL and the ImmutaSparkSession
(Spark 2.4).
Tip: The user principal used to expose the data from Impala/HIVE/HDFS will not be impacted by Immuta security on the underlying files; it will fall back to the underlying permissions (such as ACLs).
The ImmutaSession
class (Spark 2.4) is a subclass of SparkSession. Users can access subscribed data sources within their Spark jobs by using SparkSQL. Immuta enforces SparkSQL controls on data platforms that support batch processing workloads. Standard Spark libraries access data from metastore-backed data sources (like Hive and Impala) to retrieve the data from the underlying files stored in HDFS, while Immuta dynamically unlocks the files in HDFS and enforces row-level and column-level controls within the Spark job.
Should you not care about row and column level controls, but still want to restrict access to files, you can do this with Immuta HDFS data sources. You can expose the HDFS directories in Immuta as data sources and enforce file-level controls based on directory structure or extra attributes on those files. In this case, HDFS reads work as usual and data is read with the Immuta policies enforced.
It is possible to also set ACL (or Ranger/Sentry) controls on tables and HDFS files as well. If an Immuta policy is set on that data, it will be enforced first, but if not, it will fall back to the ACL/Sentry/Ranger controls on that data. You can in fact exclude users (like admins) from Immuta policies should you desire to do so.
Please refer to our Installation Guide for details on combined installs with Immuta and Sentry. There are requirements on what sequence you install both.
Although Cloudera recommends using the Sentry service to secure access to Hive and Impala, CDH cluster administrators can lock down this access without running the Sentry service. See the Security without Sentry Guide for details on this alternative to using Sentry.
It is recommended that you provide write scratch space to your users that is private to them, avoiding write to public locations in HDFS. This avoids the issue of users inadvertently sharing data or data outputs from their jobs with other users. Once that data is in their scratch space, users with CREATE_DATA_SOURCE
permission can expose that data, either by exposing a Hive or Impala table created from it (if row/column controls are needed) or by exposing the raw HDFS files as an Immuta data source.
You may want to only allow privileged users have CREATE_DATA_SOURCE permission so the appropriate policies can be applied before the data is exposed.
Audience: All Immuta Users
Content Summary:: A collection of detailed technical documents.
If you do not see the content below in the left navigation pane, you need to log in.
Project Workspaces:
Audience: System Administrators
Content Summary: The Immuta CDH integration installation consists of the following components:
Immuta NameNode plugin
Immuta Hadoop Filesystem plugin
Immuta Spark 1.6 Partition Service (DEPRECATED)
Immuta Spark 2 Partition Service
This page outlines the prerequisites required to successfully use these components on your CDH cluster.
This installation process has been verified to work with the following CDH versions:
5.9.x
5.12.x
5.13.x
5.14.x
5.15.x
5.16.x
6.1.x
6.2.x
6.3.x
Before installing Immuta onto your CDH cluster, the following steps need completed:
Immuta requires that HDFS Extended Attributes are enabled.
Under the HDFS service of Cloudera Manager, Configuration tab, search for key:
and, ensure the Checkbox is checked.
Before sending the exported JSON file, it is recommended to look over the configurations and redact any information that you consider too sensitive to share externally. Cloudera Manager will automatically redact known passwords; however, there may be sensitive values embedded in your configuration that Cloudera Manager does not know about. An example of this may be configuration of a third-party cluster application that requires passwords or API keys in its cluster configuration.
Begin by downloading the Immuta Parcel and CSD for your Cloudera Distribution. A complete installation will require 3 files:
IMMUTA-<VERSION>_<DATESTAMP>-<CDH_VERSION>-spark2-public-<LINUX_DISTRIBUTION>.parcel
The .parcel
file is the Immuta CDH parcel.
For versions that support it, Spark 1 is included in this parcel.
IMMUTA-<VERSION>_<DATESTAMP>-<CDH_VERSION>-spark2-public-<LINUX_DISTRIBUTION>.parcel.sha
The .parcel.sha
file contains a SHA1 hash of the Immuta .parcel
file for integrity verification by Cloudera Manager.
IMMUTA-<VERSION>_<DATESTAMP>-<CDH_VERSION>-spark2-public.jar
The .jar
file is the Custom Service Descriptor (CSD) for the Immuta service in Cloudera Manager.
The variables above are defined as:
<VERSION>
is like "2024.1.13"
<DATESTAMP>
is the compiled date in the format "YYYYMMDD
"
<CDH_VERSION>
must match your CDH version, like "5.16.2"
<LINUX_DISTRIBUTION>
is either "el7
" or "el6
".
All artifacts are divided up by subdirectories in the form of[Immuta Release]/[CDH Version]
.
Audience: Data Owners, Data Users, and System Administrators
Content Summary: Immuta supports an S3-style REST API, which allows you to communicate with Immuta the same way you would with S3. Consequently, Immuta easily integrates with tools you may already be using to work with S3.
In this integration, Immuta implements a single bucket (with data sources broken up as sub-directories under that bucket), since some S3 tools only support the new virtual-hosted style requests.
The three APIs (outlined below) used in this integration support basic AWS functionality; the requests and responses for each are identical to those in S3.
This request returns the bucket configured within Immuta.
Method | Path | Successful Status Code |
---|---|---|
This request returns the contents of the given bucket.
Method | Path | Successful Status Code |
---|---|---|
This request returns a stream from the requested object within Immuta.
Method | Path | Successful Status Code |
---|---|---|
Example Request:
GET Bucket Example Request:
Note: There is a single file in the requested directory.
GET Bucket Example Response:
Boto 3 is the official Amazon Web Services client SDK for Python and is widely used by developers for accessing S3 objects. With Immuta's S3 integration, Immuta users can use boto3
to download policy-enforced files or tables.
The first step is to create a Session
object that points to your Immuta endpoint and is authenticated with a user-specific API Key.
To find out what objects are available for download, you can list the objects in the immuta
bucket. To filter down to a particular data source, pass in a Prefix
that corresponds to the SQL table name of your Immuta data source.
Once you have an object key, you can use the download_file
method to download the object to your local development environment.
Audience: System Administrators
Content Summary: This simple deployment guide familiarizes users with Immuta on EMR. This guide is only meant to be deploy clusters for non-production purposes, such as demos or proof-of-concept. For more robust deployments, please see the for Immuta on EMR.
Deprecation notice
Support for this integration has been deprecated.
(v1.16.x
or greater) installed in a bash environment.
The CLI should be configured to use a role that is able to fully manage EMR, IAM, and S3 resources. This can be a user role in a local environment or an instance role on an EC2 instance.
Resource IDs for your chosen and .
Be sure that your master and worker security groups are configured for bi-directional communication with your Immuta instance.
An instance of Immuta that is reachable from your chosen AWS VPC.
A username and password for the Immuta archives site. You can get these from your Immuta support professional.
First, download the quickstart script:
Next, run the script. Note that you will be prompted for input variables. If a variable is not required, you can press enter to use the displayed default value.
See below for an example of the script being run and prompting for variables. Note that any input in the example is simply for demonstration purposes; you will need to provide your own values.
The immuta-emr-quickstart.sh
script will prompt the user for input variables to configure the AWS resources required for the cluster. These variables are represented by the environment variables listed below. Exporting these environment variables prior to running the script will skip the prompts.
CLUSTER_NAME
Optional. The name of the EMR cluster to be created.
Default: immuta-quickstart
.
EMR_VERSION
Optional. The EMR version of the cluster. Current supported versions are 5.17.0
- 5.23.0
.
Default: 5.23.0
.
IMMUTA_VERSION
Optional. The full Immuta version to be installed on the cluster.
Default: 2024.1.13_20240624.
IMMUTA_INSTANCE_URL
Required. The URL of the Immuta instance that will drive policies on the cluster.
AWS_REGION
Optional. The AWS Region that the cluster will run in.
Default: us-east-1
.
INSTANCE_COUNT
Optional. The number of instances (master + worker) in the cluster.
Default: 3
.
INSTANCE_TYPE
Optional. The type of instance for cluster nodes.
Default: m5.xlarge
.
AWS_KEY_NAME
Required. The name of the SSH keypair in AWS that will be used to connect to the cluster.
AWS_SUBNET_ID
Required. The ID string of the subnet that the cluster will run in.
SERVICE_SECURITY_GROUP
Required. The ID string of the security group for the cluster's EMR services.
MASTER_SECURITY_GROUP
Required. The ID string of the security group for the cluster's master node.
WORKER_SECURITY_GROUP
Required. The ID string of the security group for the cluster's worker nodes.
ARCHIVE_USERNAME
Required. The username for Immuta Archives.
ARCHIVE_PASSWORD
Required. The password for Immuta Archives.
BOOTSTRAP_BUCKET
Optional. The S3 bucket where bootstrap artifacts will be stored. If the specified bucket does not exist, a new one will be created with default private ACLs.
Default: immuta-emr-bootstrap-$AWS_ACCOUNT_ID-$AWS_REGION
.
DATA_BUCKET
Optional. The S3 bucket where partitioned data is stored. If the specified bucket does not exist, a new one will be created with default private ACLs.
Default: immuta-emr-data-$AWS_ACCOUNT_ID-$AWS_REGION
.
KADMIN_PASSWORD
Optional. The Kerberos admin password that will be used to create Kerberos principals on the cluster's dedicated internal KDC.
Default: random.
HDFS_SYSTEM_TOKEN
Default: random.
The quickstart bootstrap automatically seeds the cluster with three user principals for you to use while familiarizing yourself with the Immuta platform and data policies: owner
, consumer1
, and consumer2
. The default Kerberos password for these users is immuta-quickstart
.
Audience: System Administrators
Content Summary: Installation of the components necessary for the use of the Immuta Hadoop Integration depends on the version of Hadoop. This section contains guides for installing Cloudera Hadoop.
: Outlines the prerequisites required to successfully use installation components on your CDH cluster.
: Describes strategies for improving performance of Immuta's NameNode plugin on CDH clusters.
: By default, the Immuta Partition servers will run as the immuta
user. For clusters configured to use Kerberos, this means that you must have an immuta
principal available for Cloudera Manager to provision the service. If for some reason you do not have an immuta
principal available, you can change the user that the Immuta partition servers run as. This page describes the configuration changes that are needed to change the principal(s) that Immuta uses.
: Details how to use the immuta_hdfs_log_analyzer
tool to troubleshoot slowdowns in your CDH cluster.
: Details how to upgrade the Immuta Parcel and Service on your CDH cluster.
: Outlines steps to effectively disable and/or uninstall the Immuta components from your CDH cluster.
Audience: System Administrators
Content Summary: The Immuta CDH integration installation consists of the following components:
Immuta NameNode plugin
Immuta Hadoop Filesystem plugin
Immuta Spark 2 Vulcan service
This page outlines the installation steps required to successfully deploy these components on your CDH cluster.
Prerequisites: Follow the to prepare for installation.
Begin installation by transferring the Immuta .parcel
and its associated .parcel.sha
files to your Cloudera Manager node and placing them in /opt/cloudera/parcel-repo
. Once copied, ensure files have both their owner and group permissions set to cloudera-scm
Next, transfer the Immuta CSD (.jar
file) to /opt/cloudera/csd
, and ensure both its owner and group permissions are set to cloudera-scm
as well.
You will need to restart the Cloudera Manager server in order for the CSD to be picked up:
Follow Cloudera's instructions for distributing and activating the IMMUTA parcel.
Once the parcel has been successfully activated, you can add the IMMUTA service:
From the Cloudera Manager select Add Service.
Choose Immuta.
Click Continue.
Select nodes to install the services on. Your options are
For maximum redundancy, choose all.
Choose a single node.
Choose a few nodes. Set up a Load Balancer in front of the instances to distribute load. Contact Immuta support for more details.
Proceed to the end of the workflow.
After adding the Immuta service to your CDH cluster, there is some configuration that needs to be completed.
Warning
The following settings should only be written to the configuration on the NameNode. Setting these values on DataNodes will have security implications, so be sure that they are set in the NameNode only section of Cloudera Manager. For optimal performance, only set these configuration options in the NameNode Role Config Group that controls the namespace where Immuta data resides.
Under the HDFS service of Cloudera Manager, Configuration tab, search for key:
and, using "View as XML", add/set the value(s) similar to:
Best Practice: Configuration Values
Immuta recommends that all Immuta configuration values be marked final
.
The following configuration items should be configured for both the NameNode processes and the DataNode processes. These configurations are used both by the Immuta FileSystem and the Immuta NameNode plugin. For example:
Under the HDFS service of Cloudera Manager, Configuration tab, search for key:
and, using "View as XML", add/set the value(s) similar to:
Best Practice: Configuration Values
Immuta recommends that all Immuta configuration values be marked final
.
Make sure that user directories underneath immuta.credentials.dir
are readable only by the owner of the directory. If the user's directory doesn't exist and we create it, we will set the permissions to 700
.
You can enable TLS on the Immuta Vulcan service by configuring it to use a keystore in JKS format.
Under the Immuta service of Cloudera Manager, Configuration tab, search for key:
and, using "View as XML", add/set the value(s) similar to:
Best Practice: Configuration Values
Immuta recommends that all Immuta configuration values be marked final
.
Detailed Explanation:
immuta.secure.partition.generator.keystore
Specifies the path to the Immuta Vulcan service keystore.
Example: /etc/immuta/keystore.jks
immuta.secure.partition.generator.keystore.password
Specifies the password for the Immuta Vulcan service keystore. This password will be a publicly available piece of information, but file permissions should be used to make sure that only the user running the service can read the keystore file.
Example: secure_password
immuta.secure.partition.generator.keystore.password
Specifies the password for the Immuta Vulcan service keystore. This password will be a publicly available piece of information, but file permissions should be used to make sure that only the user running the service can read the keystore file.
Example: secure_password
immuta.secure.partition.generator.keymanager.password
Specifies the KeyManager password for the Immuta Vulcan service keystore. This password will be a publicly available piece of information, but file permissions should be used to make sure that only the user running the service can read the keystore file. This is not always necessary.
Example: secure_password
Best Practice: Secure Keystore with File Permissions
Immuta recommends using file permissions to secure the keystore from improper access:
You must also set the following properties under the following client sections:
For Spark 2, under the Immuta service of Cloudera Manager, Configuration tab, search for key:
and, using "View as XML", add/set the value(s) similar to:
Best Practice: Configuration Values
Immuta recommends that all Immuta configuration values be marked final
.
Detailed Explanation:
immuta.secure.partition.generator.keystore
Set to true to enable TLS
Default: true
You must give the service principal that the Immuta Web Service is configured to use permission to delegate in Impala. To accomplish this, add the Immuta Web Service principal to authorized_proxy_user_config
in the Impala daemon command line arguments.
Under the Impala service of Cloudera Manager, Configuration tab, search for key:
and add/set the value(s) similar to:
If the authorized_proxy_user_config
parameter is already present for other services, append the Immuta configuration value to the end:
No additional configuration is required.
Note: Immuta will work with any Spark 2 version you may have already installed on your cluster.
The Immuta Vulcan service requires the same system API key that is configured for the Immuta NameNode plugin. Be sure that the value of immuta.system.api.key
is consistent across your configuration.
For Spark 2, under the IMMUTA service of Cloudera Manager, Configuration section, search for key:
and, using "View as XML", add/set the value(s) similar to:
Best Practice: Configuration Values
Immuta recommends that all Immuta configuration values be marked final
.
Though generally unnecessary given the configuration through the Application Settings of the Web UI, below is an example YAML snippet that can be used as an alternative to the Immuta Configuration UI if recommended by an Immuta representative.
Detailed Explanation:
client
kerberosRealm
Specifies the default realm to use for Kerberos authentication.
Example: YOURCOMPANY.COM
plugins
hdfsHandler
hdfsSystemToken
Token used by NameNode plugin to authenticate with the Immuta REST API. This must equal the value set in immuta.system.api.key
. Use the value of HDFS_SYSTEM_TOKEN
generated earlier.
Example: 0ec28d3f-a8a2-4960-b653-d7ccfe4803b3
kerberos
ticketRefreshInterval
Time in milliseconds to wait between kinit executions. This should be lower than the ticket refresh interval required by the Kerberos server.
Default: 43200000
username
User principal used for kinit.
Default: immuta
keyTabPath
The path to the keytab file on disk to be used for kinit.
Default: /etc/immuta/immuta.keytab
krbConfigPath
The path to the krb5 configuration file on disk.
Default: /etc/krb5.conf
krbBinPath
The path to the Kerberos installation binary directory.
Default: /usr/bin/
Audience: System Administrators
Content Summary: This tutorial will guide you through the process of spinning up an Amazon Elastic Map Reduce cluster with Immuta's Hadoop and Spark security plugins installed.
Deprecation notice
Support for this integration has been deprecated.
This tutorial contains examples using the AWS CLI. These examples are conceptual in nature and will require modification to adapt to your exact deployment needs. If you wish to quickly familiarize yourself with Immuta's EMR integration, please visit the .
This deployment is tested and known to work on the EMR releases listed below.
5.17.0
5.18.0
5.19.0
5.20.0
5.21.0
5.22.0
5.23.0
5.24.0
5.25.0
5.26.0
5.27.0
5.28.0
5.29.0
5.30.0
5.31.0
5.32.0
In addition to the EMR cluster itself, Immuta requires a handful of additional AWS resources in order to function properly.
In order to bootstrap the EMR cluster with Immuta's software bundle and startup scripts, you will need to create an S3 bucket to hold these artifacts.
Immuta's Spark integration relies on an IAM role policy that has access to the S3 buckets where your sensitive data is stored. Note that the EC2 Instance Roles for your EMR cluster should not have access to these buckets. Immuta will broker access to the data in these buckets to authorized users.
Modify the JSON data below to include the correct name of your data bucket(s), and save as immuta_data_iam_policy.json
.
If you are leveraging Immuta's Native S3 Workspace capability, you must also give the Immuta data IAM role full control of the workspace bucket or folder.
Now you can run the following command to create the Immuta IAM user policy.
The IAM role that brokers access to S3 data must be able to assume the cluster node instance roles, and vice versa. Since this a cycle, you will need to create both roles with generic trust policies, and then update them after both roles are created.
Create a file called immuta_data_role_trust_policy_generic.json
as seen below.
After creating the immuta_data_role_trust_policy_generic.json
file from above, run the following command to create the Immuta data IAM role. Note that you will be using the generic IAM role trust policy that you created in the previous step. This will be updated when both the data and instance IAM roles are created.
Next you will need to attach the IAM policy that allows access to your protected data in S3.
Modify the JSON data below to include the correct name of your bootstrap bucket, and save as immuta_emr_instance_policy.json
.
After creating the immuta_emr_instance_policy.json
file from above, run the following command to create the Immuta EMR Instance policy.
The node instance IAM role must be able to assume the IAM role that brokers access to S3 data, and vice versa. Assuming you have already created the immuta_emr_data_role
, create a JSON file called instance_role_trust_policy.json
as shown below.
Now you can create the instance role with the policy document from above.
Next you will need to attach the IAM policy that allows access to required resources for your cluster.
After creating the role and policy for the Immuta instances, you can create the Immuta EC2 Instance Profile.
After creating the Instance Profile, you can attach the newly created Role.
Now that both the data and instance IAM roles are created, you can update the trust policy of the data IAM role to include the instance role.
Create a file called data_role_trust_policy.json
as shown below.
Now you can update the trust policy of the data IAM role.
Complete the JSON template below and save as ec2_attributes.json
. You may remove keys where you would like to use default values.
When choosing security groups for your master and worker nodes, be sure that they provide bi-directional access between the nodes and your Immuta instance.
Immuta requires a custom configuration file for Hadoop services to be passed in to the cluster. The required configurations are displayed below. Modify the JSON data to match your environment and save as cluster_configuration.json
.
Next, create a file called bootstrap_actions.json
to configure the Immuta bootstrap action. If you have any additional bootstrap actions to run outside of Immuta, they should be added here as well.
If you wish to deploy a kerberized cluster, create a kerberos_attributes.json
file with your desired Kerberos configurations. Note that although not strictly required, a cluster without Kerberos should be considered secure for production.
You will need to create a security configuration before creating the EMR cluster so that Immuta's EMRFS integration can leverage the IAM role you created to access data in S3.
Next, create your security configuration with the following command.
Finally, you can now spin up an EMR cluster with Immuta's security plugins.
To ensure protection of the Immuta user's AWS credentials as well as the kadmin
password (if using Kerberos), it is recommended to overwrite the secret values that were created during cluster deployment process. If you leave the secret values in AWS Secrets Manager, cluster users may be able to assume the instance role of the EMR nodes and read these values.
It is safe to remove these values after the cluster has finished bootstrapping. The example below overwrites the relevant secrets with null
values.
Note that if you are using an external KDC without a cross-realm trust (no KDC on the cluster), you should put the kadmin
password back into the immuta-kerberos-secret
. This is required to clean up the Immuta services principals that will have been created on the external KDC.
Audience: Data Owners and Data Users
Content Summary: This page details the components of Immuta's Spark ecosystem and policy enforcement.
In Immuta's Spark plugins, policies are enforced at query time much like the .
Outside of Databricks, Immuta's Spark ecosystem is composed of
Immuta SparkSession
Vulcan Service
Immuta SecurityManager
Immuta NameNode Plugin (optional, HDFS)
All of these components work in conjunction to apply and enforce Immuta policies on data sources queried through Spark.
In Databricks, Immuta's Spark policy enforcement is driven by Spark plugins that operate on a normal SparkSession (i.e., no ImmutaSparkSession
class or object).
The Immuta SparkSession is the client-side plugin in the Immuta Spark ecosystem. This plugin is an extension of the open-source SparkSession, but Immuta's SparkSession and the open-source SparkSession have two differences:
Immuta's external and session catalogs
Immuta's logical replanning
The replanning in ImmutaSparkSession
occurs in the QueryExecution
class. Immuta has an internal version of that class that replaces the different stages of the plan (logical
, analyzed
, optimized
, sparkPlan
, and executedPlan
) with policy-enforced versions, and the QueryExecution
object and resulting SparkPlan
(physical plan) trigger audit calls. Additionally, Immuta's implementation of QueryExecution
provides a layer of security within the JVM itself to make sure that any sensitive information needed by physical plans is used or stored so that it can be protected by the SecurityManager.
Several other Spark internals are implemented in Immuta to organize code in a way that the SecurityManager can prevent access to fields or methods that expose sensitive information.
Non-Databricks Deployments
In non-Databricks deployments, users will have to use a different object in their code (an instance of ImmutaSparkSession) than the normal SparkSession object to run Immuta Spark jobs. Creating this object is simple, only requiring a 1-2 line change in most existing scripts.
In Databricks deployments, Immuta's plugins operate in a more transparent manner than outside of Databricks. Immuta leverages SparkSessionExtensions
in Databricks to update the different planning phases in Spark and add Immuta's policies to the target SparkSession objects. This means that in Databricks users do not have to use a different object to interact with Immuta data sources; they simply connect to an Immuta-enabled cluster and do their work as usual.
Immuta updates the Analyzer, Hive Client, and physical planning strategy to ensure that policies are enforced on any user-generated plans and that the user's view of available data sources represents only what they are allowed to see in Immuta.
ODBC/JDBC Queries
In Databricks, Spark is the execution layer for any ODBC/JDBC connections to the cluster. This means that when Immuta's plugins are installed, ODBC/JDBC queries submitted to the cluster go through Immuta's plugins during execution. This provides a great deal of functionality for users who wish to connect BI tools directly to the cluster and still have their view of Immuta's data. However, when exposing data sources in Immuta from an Immuta-enabled Databricks cluster, the API token provided to Immuta for exposing the Databricks data source must belong to either an administrative user in Databricks or a privileged user specified in the Immuta configuration on the Databricks cluster.
To make the Immuta Spark ecosystem as user-friendly as possible, Immuta's Spark implementation resolves relations by reaching out to the Immuta Web Service instead of resolving relations in the Hive Metastore directly. All queryable Immuta data sources are available to Immuta's Spark plugins.
Cluster-native data sources (Hive, Impala, or Databricks) will be queried by accessing files directly from storage that compose the Metastore table, which is the same type of query execution that occurs in open source Spark when accessing a table in the Hive Metastore.
Any non-cluster queryable data source in Immuta will be queried from the user's Spark application via JDBC through the Immuta Query Engine. Users can provide query partition information similar to what is available via the JDBC data source in Spark to distribute their query to the Query Engine.
In JDBC data sources, policies are enforced at the Query Engine layer. In cluster data sources, policies are enforced through the following steps:
Plan modification during analysis to include policies using functions/expressions for masking and filters for row-level policies.
Restrictions to field/method access through the Immuta SecurityManager.
In Databricks
Restrictions to storage configuration access via the Immuta SecurityManager. User code cannot access credentials for S3, ADL gen 2, etc. directly, and those configurations are only loadable by the ImmutaSecureFileSystemWrapper
class.
Restrictions to the use of AWS instance roles via the Immuta SecurityManager.
Outside Databricks
Partition and file access token generation in the Vulcan Service.
Token validation and filesystem access enforcement in the Immuta NameNode plugin (HDFS).
Token validation and remote object store proxying/enforcement in the Vulcan Service (S3/ADL/etc).
When a user attempts to query any Hive or Impala data source through the Immuta SparkSession, the Immuta catalogs first replace the relation in the user's plan with the proper plan that the data source represents. For example, if the user attempts the query (immuta
is an instance of ImmutaSparkSession)
and the customer_purchases
data source is composed of this query
and, in Immuta, these columns were selected to expose in this data source
id
first_name
last_name
age
country
ssn
product_id
department
purchase_date
the resulting Spark logical plan would look like this:
After the data source is resolved, the policies specific to the user will be applied to the logical plan. If the policy has masking or filters (row-level, minimization, time filter, etc.), those filters will be applied to all corresponding underlying tables in the plan. For example, consider the following Immuta policies:
Mask using hashing the column ssn for everyone.
Only show rows where user is a member of group that matches the value in the column department for everyone.
The plan would be modified (assume the current user is in the "Toys" and "Home Goods" groups):
In this example, the masked columns (such as ssn
) are aliased to their original name after masking is applied. This means that transformations, filters, or functions applied to those columns will be applied to the masked columns. Additionally, filters on the plan are applied before any user transformations or filters, so a user's query cannot modify or subvert the policies applied to the plan.
Immuta does not attempt to change or block optimizations to the Spark Plan via the Catalyst Optimizer.
Spark policies are applied at the lowest possible level in the Spark plan for security reasons, which may lead to different results when applying policies to a Spark plan rather than a Query Engine plan. For instance, in the Query Engine a user may be able to compute a column and then generate a masking policy on that computed column. For security reasons, this is not possible in Spark, so the query may be blocked outright.
Immuta has an implementation of the Java SecurityManager construct, which is required when running Spark jobs with the Immuta SparkSession. When a user's Immuta Spark job starts, it communicates with the Immuta Vulcan Service to get an access token, which can be exchanged for partition information during job planning and execution.
The Vulcan Service checks whether the user's job is running with the SecurityManager enabled; if so, it is allowed to retrieve partitions and access tokens during job execution to temporarily access the underlying data for the table. This data is stored in HDFS or a cloud object store (such as S3 or ADL). During job execution, the SecurityManager restricts when file access tokens can be used and which classes can use them. These restrictions prevent users from attempting to access data outside an approved Immuta Spark plan with policies applied.
The SecurityManager also prevents users from making changes to Spark plans that the Immuta SparkSession has generated. This means that once policies have been applied, users cannot attempt to modify the plan and remove policies that are being enforced via the plan modifications.
The Vulcan Service serves administrative functions in the Spark ecosystem and is only deployed outside of Databricks. The Service has these major responsibilities in Immuta's Spark ecosystem:
Compute partition information for Immuta Spark Jobs
Service administrative requests for Immuta Hadoop Native Workspaces
Act as a proxy to remote storage (S3, Google Storage, etc.) for Immuta Spark jobs
Immuta users do not have access to the underlying data files (like Parquet or ORC files) for the Hive Metastore tables that make up Immuta data sources on-cluster. For this reason, the user's Spark application cannot generate partition information directly because it cannot read file metadata from HDFS or remote storage.
Consequently, the user's Spark job must request partition information from the Vulcan Service, which must be configured in such a way that it can access all raw data that may be the target of Immuta data sources. This configuration should include
Running the service as a kerberos principal that is specified in HDFS NameNode configuration as the Immuta Vulcan user. If this configuration is incorrect, the service will fail to start, as the service will not have access to the locations in HDFS that it requires. This access is granted dynamically by the Immuta NameNode plugin.
Running the service with S3/Google Storage credentials that have access to the underlying data in remote storage. This configuration should be written in a way that users cannot access the configuration files, but the Vulcan Service user can. Typically this is done by configuring sensitive information in generator.xml
on the CLASSPATH for Vulcan and only giving the OS user running the Vulcan service access to that file.
The Vulcan Service serves all native workspace management requests on Hadoop Clusters. These requests include
Workspace creation
Workspace deletion
Derived data source creation from a directory
Determining if directory contains supported files (ORC/Parquet)
The Vulcan Service must have access to create Metastore databases to create Immuta native workspace databases and have access in storage (HDFS is handled via the NameNode plugin) to create directories in the configured workspace locations.
The Vulcan Service acts as a proxy to remote storage when Immuta Spark jobs read data from Metastore-based data sources. As mentioned above, the Vulcan Service must have access to credentials for reading data from remote storage to fulfill requests from Immuta Spark jobs to read that data. The Vulcan Service acts as a proxy with very minimal overhead when reading from remote storage.
The user must present Vulcan with a temporary access token for any target files being read. These temporary tokens are generated by Vulcan during partition generation and protected by the SecurityManager so that users cannot access them directly. The token presented to Vulcan grants access to the raw data via Vulcan's storage proxy endpoints. Vulcan opens a stream to the target object in storage and passes that stream's content back to the client until they are finished reading.
Note: The client will read all bytes needed from Vulcan, but Vulcan may read more data from storage than the client needed into its buffers. This may produce warning messages in the Vulcan logs but those are expected, as Vulcan cannot predict the number of bytes needed by the client.
The way Immuta is deployed allows a cluster to service both Immuta and non-Immuta workloads. Although it is recommended that those workloads are segregated, in many cases that is not feasible. However, because of the way Immuta jobs are executed (outside of Databricks), it is clear when a user is attempting to use Immuta and when they are not because of the immuta-
prefixed scripts that are analogous to the out-of-the-box Spark scripts for starting different spark toolsets. (For example, immuta-pyspark
instead of pyspark
and immuta-spark-submit
instead of spark-submit
.)
These scripts are required because Immuta packages a full deployment of Spark's binaries to override the target Spark classes needed by Immuta's plugins to operate securely. The immuta-
prefixed scripts set up environment variables needed by Immuta to execute properly and set other required configuration items that are not the default global values for Spark.
Note: This does not apply to Databricks. Once a Databricks cluster is Immuta-enabled/configured, Immuta is in the execution path for all jobs, regardless of whether the executing user is an Immuta user.
Audience: System Administrators
Content Summary: This page describes strategies for improving performance of Immuta's NameNode plugin on CDH clusters.
Immuta operates within a locked operation in the NameNode when granting / denying permissions based on Immuta policies. This section contains configuration and strategies to prevent RPC queue latency, threads waiting, or other issues on cluster-wide file permission checks.
Best Practice: NameNode Plugin Configuration
Immuta recommends only configuring the NameNode Plugin to check permissions on the NameNode(s) that oversee the data that you want to protect.
For example, say that you currently have a federated HDFS NameNode architecture with three Nameservices - nameservice1
, nameservice2
, and nameservice3
. The HDFS federation in this example is distributed across these nameservices as described below.
nameservice1
: /data
, /tmp/
, /user
nameservice2
: /data2
nameservice3
: /data3
Suppose you know that all the sensitive data that you want to protect with Immuta is located under /data3
. To achieve optimum performance in this case, you can go ahead and add the Immuta NameNode-only configuration (hdfs-site.xml
) to the role config group for nameservice3
, and leave it out of nameservice1
and nameservice2
. The public / client Immuta configuration (core-site.xml
) should still be configured cluster-wide. See for more details about these configuration groupings.
One caveat to take into consideration here is that Immuta's Vulcan service requires the Immuta NameNode Plugin to oversee user credentials that are stored in /user/<username>
by default. Vulcan also stores some configuration under /user/immuta
by default. This is a problem because /user
resides under nameservice1
, and the goal is to only operate the Immuta NameNode Plugin on nameservice3
.
A simple solution to this problem is to create a new directory for these credentials, /data3/immuta_creds
for example, and configure the NameNode Plugin and the Vulcan service to use this directory instead of /user
. Changing this requires the configuration modifications listed below.
HDFS - Cluster-wide Advanced Configuration Snippet (Safety Valve) for core-site.xml
Set immuta.generated.api.key.dir
and immuta.credentials.dir
to /data3/immuta_creds
.
Immuta - Immuta Spark 2 Vulcan Server Advanced Configuration Snippet(Safety Valve) for session/generator.xml
Set immuta.meta.store.token.dir
to /data3/immuta_creds/immuta/tokens
.
Set immuta.meta.store.remote.token.dir
to /data3/immuta_creds/immuta/remotetokens
.
Set immuta.configuration.id.file.config
to hdfs://nameservice3/data3/immuta_creds/immuta/config_id
.
Note that you will need to manually create the /data3/immuta_creds/immuta
directory and set the permissions such that only the immuta
user can read / write in that directory. The /data3/immuta_creds
directory should also be world writable to allow user directories to be created the first time that they interact with Immuta on the cluster.
immuta.permission.paths.to.enforce
Description: A comma delimited list of paths to enforce when checking permissions on HDFS files. This ensures that API calls to the Immuta web service are only made when permissions are being checked on the paths that you specify in this configuration. This also means that you can only create data sources against data that lives under these paths, and the Immuta Workspace must be under one of these paths as well. Alternatively, immuta.permission.paths.to.ignore
can be set to a list of paths that you know do not contain Immuta data - then API calls will never be made against those paths. Setting both immuta.permission.paths.to.ignore
and immuta.permission.paths.to.enforce
properties at the same time is unsupported.
immuta.permission.groups.to.enforce
Description: A comma delimited list of groups that must go through Immuta when checking permissions on HDFS files. If this configuration item is set, then fallback authorizations will apply to everyone by default, unless they are in a group on this list. If a user is on both the enforce list and the ignore list, then their permissions will be checked with Immuta (i.e., the enforce configuration item takes precedence). This may improve NameNode performance by only making permission check API calls for the subset of users who fall under Immuta enforcement.
immuta.permission.source.cache.enabled
Description: Denotes whether a background thread should be started to periodically cache paths from Immuta that represent Immuta-protected paths in HDFS. Enabling this increases NameNode performance because it prevents the NameNode plugin from calling the Immuta web service for paths that do not back HDFS data sources. For performance optimization, it is best to enable this cache to act as a "backup" to immuta.permission.paths.to.enforce
.
immuta.permission.source.cache.enabled
Description: The time between calls to sync/cache all paths that back Immuta data sources in HDFS. You can increase this value to further reduce the number of API calls made from the NameNode.
immuta.permission.workspace.base.path.override
Description: This configuration item can be set so that the NameNode does not have to retrieve the Immuta HDFS workspace base path periodically from the Immuta API.
immuta.permission.source.cache.timeout.seconds
immuta.permission.source.cache.retries
immuta.permission.request.initial.delay.milliseconds
immuta.permission.request.socket.timeout
immuta.no.data.source.cache.timeout.seconds
immuta.hive.impala.cache.timeout.seconds
immuta.canisee.cache.timeout.seconds
immuta.data.source.cache.timeout.seconds
immuta.canisee.metastore.cache.timeout.seconds
immuta.canisee.non.user.cache.timeout.seconds
immuta.canisee.num.retries
immuta.project.user.cache.timeout.seconds
immuta.project.cache.timeout.seconds
immuta.project.forbidden.cache.timeout.seconds
immuta.permission.system.details.retries
Audience: Data Users
Content Summary: This page outlines how to use the Immuta SparkSession with , , and .
Immuta SparkSession Background: For Spark 2, the Immuta SparkSession must be used in order to access Immuta data sources. Once the Immuta Spark Installation has been completed on your Spark cluster, then you are able to use the special Immuta Spark interfaces that are detailed below. For data platforms that support batch processing workloads, the Immuta SparkSession allows users to query data sources the same way that they query Hive tables with Spark SQL.
When querying metastore-backed data sources, such as Hive and Impala, the Immuta Session accesses the data directly in HDFS. Other data source types will pass through the . In order to take advantage of the performance gains provided by directly acting on the files in HDFS in your Spark jobs, you must create Immuta data sources for metastore-backed data sources with tables that are persisted in HDFS.
For guidance on querying data sources across multiple clusters and/or remote databases, see .
Launch the special immuta-spark-submit
interface, and submit jobs just like you would with spark-submit
:
First, launch the special immuta-spark-shell
interface:
Then, Use the immuta
variable just like you would spark
:
Next, use the immuta
format to specify partition information:
The immuta
format also supports query pushdown:
Finally, specify the fetch size:
First, launch the special immuta-pyspark
interface:
Then, use the immuta
variable just like you would spark
:
Finally, use the immuta
format to specify partition information:
The immuta
format also supports query pushdown:
Audience: System Administrators
Content Summary: This page outlines steps to effectively disable and/or uninstall the Immuta components from your CDH cluster. The disable portions of this document detail how to deactivate the Immuta components without removing the components. For a complete uninstall, follow these steps and then proceed to remove all Immuta-related settings, configuration, and any Immuta Kerberos principals from your cluster.
These changes will require a cluster restart
The changes detailed below affect HDFS; therefore, a cluster restart is required to fully implement these changes.
The Immuta Authorization Provider must be removed from the NameNode configuration.
Navigate to the Cloudera Manager Overview page.
Click on the HDFS service.
Click on the Configuration tab.
In the search bar, enter
Click on the minus [-] sign that appears on the right of the entry corresponding to dfs.namenode.authorization.provider.class
. This will restore to the CDH default.
Click the Save Changes button at the bottom of the screen.
Warning
You may have non-default settings that are completely unrelated to Immuta! You may also have non-default settings that are currently related to Immuta that will need to be altered to another non-default custom setting specific to your installation. Your CDH Admins will know which settings this applies to. Do not blanket revert settings to their defaults unless you are certain the CDH defaults are appropriate for your cluster.
To uninstall, instead of only reverting the Immuta Authorization Provider, all Immuta customized settings can be removed from the NameNode configuration.
Navigate to the Cloudera Manager Overview page.
Click on the HDFS service.
Click on the Configuration tab.
Near the bottom of the left side navigation pane, select Non-Default. This will list all settings that are not presently set to the defaults.
All settings under
can be reverted. Click the minus [-] sign that appears on the right of the individual entries, or - if you are certain your cluster should operate on the CDH defaults - all settings can be reverted by clicking the revert arrow icon to the right of HDFS (Service-Wide).
All settings under
can be reverted. Click the minus [-] sign that appears on the right of the individual entries, or - if you are certain your cluster should operate on the CDH defaults - all settings can be reverted by clicking revert arrow icon to the right of NameNode Default Group.
Click the Save Changes button at the bottom of the screen.
If fully uninstalling, Immuta's components need to be removed from YARN's classpath.
These changes will require a cluster restart
The changes detailed below affect HDFS; therefore, a cluster restart is required to fully implement these changes.
Navigate to the YARN service.
Click on the Configuration tab.
In the search bar, enter
Click on the minus [-] sign that appears on the right of any entries that reference IMMUTA
. For example, there may be records for jars such as immuta-group-mapping.jar
or immuta-hadoop-filesystem.jar
or similar.
Click the Save Changes button at the bottom of the screen.
These settings may be applied either system-wide (via core-site.xml
) or to specific target systems such as Hive or Impala. Be sure to locate all setting locations.
These changes will require a Hive service restart
The Hive service will need to be restarted for the changes below to take effect.
Navigate to the Hive service.
Click on the Configuration tab.
In the search bar, enter
Click on the minus [-] sign that appears to the right of the entry corresponding to hadoop.security.group.mapping
. This will restore to the CDH default.
Click the Save Changes button at the bottom of the screen.
Warning
You may have non-default settings that are completely unrelated to Immuta! You may also have non-default settings that are currently related to Immuta that will need to be altered to another non-default custom setting specific to your installation. Your CDH Admins will know which settings this applies to. Do not blanket revert settings to their defaults unless you are certain the CDH defaults are appropriate for your cluster.
Navigate to the Hive service.
Click on the Configuration tab.
Near the bottom of the left side navigation pane, select Non-Default. This will list all settings that are not presently set to the defaults.
All settings under
can be reverted. Click the minus [-] sign that appears on the right of the individual entries, or - if you are certain your cluster should operate on the CDH defaults - all settings can be reverted by clicking the revert arrow icon to the right of HiveServer2 Default Group.
Click the Save Changes button at the bottom of the screen.
These settings may be applied either system-wide (via core-site.xml
) or to specific target systems such as Hive or Impala. Be sure to locate all setting locations.
These changes will require an Impala service restart
The Impala service will need restarted in order for the changes below to take effect.
Navigate to the Impala service.
Click on the Configuration tab.
In the search bar, enter
Click on the minus [-] sign that appears on the right of the entry corresponding to hadoop.security.group.mapping
. This will restore to the CDH default.
Click the Save Changes button at the bottom of the screen.
Warning
You may have non-default settings that are completely unrelated to Immuta! You may also have non-default settings that are currently related to Immuta that will need to be altered to another non-default custom setting specific to your installation. Your CDH Admins will know which settings this applies to. Do not blanket revert settings to their defaults unless you are certain the CDH defaults are appropriate for your cluster.
Navigate to the Impala service.
Click on the Configuration tab.
Near the bottom of the left side navigation pane, select Non-Default. This will list all settings that are not presently set to the defaults.
The "immuta" proxy user from
can be removed. Simply delete the "immuta=*
" (and any leading or trailing ;
) from the -authorized_proxy_user_config=
value, leaving any other values in place. It may also be done by clicking the revert arrow icon to the right of Impala (Service-Wide) if the default is appropriate.
All settings under
can be reverted. Click the minus [-] sign that appears on the right of the individual entries, or - if you are certain your cluster should operate on the CDH defaults - all settings can be reverted by clicking the revert arrow icon to the right of Impala Daemon Default Group.
If using Kerberos principal short names was only done in support of ImmutaGroupsMapping
for use in native workspaces, that setting can also be reverted. In the search bar, enter
Simply uncheck the checkbox to the left of "Impala (Service-Wide)".
Click the Save Changes button at the bottom of the screen.
These changes will require a Spark service restart
The Spark service will need to be restarted for the changes below to take effect.
Navigate to the Spark service.
Click on the Configuration tab.
In the search bar, enter
Remove any references to IMMUTA
or "immuta" in the configuration options. Particularly look for the options defined in Spark 1.6 Configuration.
Then go back to the search bar, and enter
Remove any references to IMMUTA
or "immuta" in the environment variables. Particularly look for the environment settings defined in Spark 1.6 Configuration.
Click the Save Changes button at the bottom of the screen.
If your installation leveraged the Immuta HDFS Native Workspace and ImmutaGroupsMapping
, Immuta was likely configured as a Sentry admin. When uninstalling, this can be removed.
These changes will require a Sentry service restart
The Sentry service will need to be restarted for the changes below to take effect.
Warning
You may have non-default settings that are completely unrelated to Immuta! You may also have non-default settings that are currently related to Immuta that will need to be altered to another non-default custom setting specific to your installation. Your CDH Admins will know which settings this applies to. Do not blanket revert settings to their defaults unless you are certain the CDH defaults are appropriate for your cluster.
Navigate to the Sentry service.
Click on the Configuration tab.
Near the bottom of the left side navigation pane, select Non-Default. This will list all settings that are not presently set to the defaults.
The "immuta" user can be removed from any place specified, but particularly the
should be removed. Click the minus [-] sign that appears on the right of the individual entries, or - if you are certain your cluster should operate on the CDH defaults - all settings can be reverted by clicking the revert arrow icon.
Click the Save Changes button at the bottom of the screen.
Navigate to the Cloudera Manager Overview page.
Click on the down arrow next to the IMMUTA service.
Click Stop.
Confirm that you want to stop the service.
Navigate to the Cloudera Manager Overview page.
Click on the down arrow next to the IMMUTA service.
Click Delete.
Confirm that you want to delete the service.
Complete both 1 and 2 in the previous "Disable" section.
You may need to restart the cluster before you can fully remove these parcels
If the parcel was in active use, a cluster restart is likely needed before Cloudera Manager will let you do the following steps to remove and delete these parcels.
Navigate to the Cloudera Manager Overview page.
Click on the package icon on the top right hand side of the page near the search bar.
Find the "Distributed, Activated" Immuta Parcel(s) and click the Deactivate button.
Click Confirm.
Once deactivated, go back to the Immuta Parcels(s) and select the "down arrow" beside the "Activate" button, and select Remove from Hosts.
Click Confirm.
Once not distributed, go back to the Immuta Parcels(s) and select the "down arrow" beside the "Distribute" button, and select Delete.
Click Delete.
To commit all previous settings, issue a restart of the CDH cluster.
Called "authorizations" prior to Immuta's 2.7 release, attributes are custom tags that can be added to a user to restrict what data the user can see. When creating a policy on a data source, Data Owners can apply the policy to any user that possesses an attribute. Attributes can be added manually as well as mapped in from an .
Blob handlers are the tools used to access the backend data platform and stream blobs of data through Immuta.
A data attribute is data about your data. These attributes can be used to match against to decide if a row/object should be visible to a given user. This matching is usually done between the data attribute and .
Data attributes are typically part of the data being exposed as a column or metadata attribute. For example, a may have a column called access
, which is used in policy logic to match against a user attribute to determine if they can see the given row.
The Data Dictionary provides information about columns within a , including column names and types, and users subscribed to the data source can comment on the Data Dictionary.
Dictionary columns are generated automatically when the data source is created if the remote data platform supports SQL. Otherwise, the Data Owner or can create the entries manually.
Data Experts are those who are knowledgeable about the data source data and can elaborate on it. They are responsible for managing the data source's documentation and the .
A data source is how you virtually expose data across your enterprise to Immuta consumers. When you expose a data source you are not copying the data; you are using metadata from the data source to tell Immuta how to expose it. No raw data is moved to an end user (or into the Immuta cache) until it is fetched by that user. The Immuta caching layer is configurable to reduce load on your exposed databases, and with the cost of RAM dropping, building a virtual data lake with desired data flowing in and out through the Immuta caching layer will reduce infrastructure cost, database load, and data latency.
From a technical perspective, a data source is an abstraction to data living in a remote data storage technology. When you expose a data source, it becomes an authoritative view to that remote data without having to pass around connection strings or API guides. Policy enforcement and access is maintained through Immuta based on the settings provided by the data source creator, who is known within Immuta as the Data Owner. Once exposed and subscribed to, the data will be accessed in a consistent manner across analytics and visualization tools, allowing reproducibility and sharing.
Minimization policies expose a percentage of the data source to querying users. This percentage is configurable by the Data Owner and is based on a column with high cardinality.
As metadata for blobs/rows is ingested into Immuta, the data is tagged with a visibility marking which is an arbitrary JSON object that the Data Owner defines. The visibility for data sources can be prescribed by selecting one or many columns to use as the visibility.
Data Fingerprints capture summary statistics from data sources so that the user can view how that data changes over time or how the data changes when policies affecting that data source are changed.
Immuta pulls a sample of a data source through a Postgres proxy and it exists, temporarily, in the fingerprint container. Immuta then distills this data down to a series of summary statistics and pushes those statistics back to the Immuta Metadata Database. Those summary statistics of a data source are captured when a data source is created, when a policy is applied or changed, or when a user manually updates the data source fingerprint from the Policies tab. The user can then track changes in that data.
Identity managers (IAMs) authenticate Immuta users and control their access to data. Out of the box, Immuta supports several configurable identity managers:
Immuta Identity Manager (Built-in)
Active Directory
LDAP
PKI
OAuth2
Okta (SAML)
Immuta also offers support for custom IAM plugins, so you can use the Immuta API to implement your own identity manager.
This term refers to how Immuta users can consume and interact with data through Immuta. Accessing data through Immuta ensures that users are only consuming policy-controlled data with thorough auditing.
APPLICATION_ADMIN: Gives the user access to administrative actions for the configuration of Immuta. These actions include
Adding external IAMs.
Adding ODBC drivers.
Adding external catalogs.
Configuring email settings.
USER_ADMIN: Gives the user access to administrative actions for managing users in Immuta. These include
AUDIT: Gives the user access to the audit logs.
CREATE_DATA_SOURCE_IN_PROJECT: Gives the user the ability to create data sources within a project.
CREATE_S3_DATASOURCE_WITH_INSTANCE_ROLE: When creating an S3 data source, this allows the user to the handler to assume an AWS Role when ingesting data.
CREATE_FILTER: Gives the user the ability to create and save a search filter.
FETCH_POLICY_INFO: Gives the user access to an endpoint that returns visibilities, masking information, and filters for a given data source.
IMPERSONATE_HDFS_USER: When creating an HDFS data source, this allows the user to enter any HDFS user name to use when accessing data.
Policies are fine-grained security controls Data Owners apply when creating data sources. Columns can be masked and rows hidden, or certain blobs of data can be hidden from certain users and particular fields in the content of the blobs can be masked, if the blob is a known format. The creator of the data source determines the logic behind what is hidden from whom, and the logic can be as complex as desired.
Projects are logical groupings of data, members, and discussions based on business goals. Projects can also capture the purpose of the work and audit data access.
Deprecation notice: Support for this feature has been deprecated.
This feature can be enabled by an Application Admin to automatically identify and tag columns that contain sensitive data when a new data source is created. The Immuta application is pre-configured with a set of Discovered tags that can be used to write Global Policies proactively.
Users can subscribe to a data source by requesting access through the Immuta UI or be added to the data source by the Data Owner.
A Subscription Policy refers to how open a data source is to potential subscribers and can have one of four possible restriction levels:
Anyone: Users will automatically be granted access (Least Restricted).
Anyone Who Asks (and is Approved): Users will need to request access and be granted permission by a configured approver (Moderately Restricted).
Users with Specific Groups/Attributes: Only users with the specified groups/attributes will be able to see the data source and subscribe (Moderately Restricted).
Individual Users You Select: The data source will not appear in search results, Data Owners must manually add/remove users (Most Restricted).
Tags serve several functions in Immuta. They can drive Local or Global Subscription and Data Policies, generate Immuta Reports, and drive search results in the Immuta UI. Governors can create tags or import tags from external catalogs in the Governance UI. Data Owners and Governors can then apply these tags to or remove them from projects, data sources, and specific columns within the data sources.
Time-based restrictions only expose data within a defined time range, which is set by the Data Owner and is based on the event time column of the data source.
User attributes are used to drive data source policies as well as to give users access to certain Immuta features.
Audience: Data Users
Content Summary: This page outlines how to create your SQL account, view your SQL connection information, update your password, and create SQL connections for projects.
Navigate to your .
Click on the SQL Credentials tab. Then Create Account.
Fill out the required fields following these guidelines:
Usernames must be unique and can only consist of lowercase letters, numbers, and underscores ( _ ).
Usernames cannot start with a number and can be no longer than 63 characters.
Passwords should not contain braces ( { ).
Your SQL password will never be displayed in the Immuta console, so be sure to store it in a secure location.
Click the Create button at the bottom of the center pane.
Note: Rather than requiring users to enter this user/password for authentication when accessing a data source, System Administrators may force users to use PKI or LDAP authentication.
Assuming an Immuta SQL Account has already been created, navigate to your .
Click on the SQL Credentials tab.
Click the dropdown menu button in the top right corner of the page, and then select the Copy to Clipboard button to copy the SQL connection information.
This connection can be used to connect your favorite BI tool to the Immuta database, where all the Immuta Data Sources you’re subscribed to will be available to you as tables.
Click on the SQL Credentials tab.
Click the dropdown menu button in the top right corner of the page, and then select the Change Password button.
Change the password and click Save.
Navigate to the Project details page.
Click SQL Connection in the right menu under Credentials.
A modal window will display with the requested connection information. Please make sure to store these credentials somewhere secure. If you misplace them, you will have to generate a new account and re-authenticate all services connected to Immuta via this account.
When done, click the Close button.
Project SQL accounts are unique to each project, and only provide access to the data sources in that project. Note that project SQL credentials cannot be retrieved from Immuta if they are lost. Credentials can only be re-generated using the instructions above. When a user generates new SQL credentials for a project, any existing SQL credentials for that project the user may have had are revoked.
Audience: System Administrators
Content Summary: By default, users authenticate with the Query Engine using credentials that they create in their Immuta profile.
It is possible to configure Immuta so that users authenticate with the Query Engine using external systems such as LDAP, Kerberos, or PKI. Any valid should be possible, though not all have been tested. In order to use external authentication methods with the Query Engine, you must configure an IAM system with the supported action
linkPostgresAccount
. When the IAM is configured withlinkPostgresAccount
, Immuta attaches a special role to the user in the Query Engine of the format<IAM ID>_user
. For example, given the following IAM configuration,Immuta creates accounts in the Query Engine for users belonging to that IAM and assign the role
myOrgLDAPIAM_user
to them.This page describes authentication methods that are fully supported by Immuta.
Each Query Engine authentication method outlined below makes use of the IAM-specific role to target users for authentication. The configuration that is added to pg_hba.conf
needs to come at the beginning of the file before the catch-all hostssl immuta all 0.0.0.0/0 md5
that is used to authenticate users using the built-in SQL account management.
The built-in Query Engine authentication does not require any additional configuration. Users authenticate using a username and password configured on their Immuta profile page.
See for more information on how these accounts are managed.
Users can authenticate with the Query Engine using their LDAP IAM credentials, but the Query Engine must be configured using the PostgreSQL ldap
authentication method.
In this method, a DN pattern is specified as a username prefix and suffix. When a user makes an authentication attempt, the prefix, username, and suffix are concatenated and used as DN along with the supplied password to bind as the user. On a successful bind the user authentication to the Query Engine succeeds.
Simple Bind Example:
In this method, PostgreSQL performs an LDAP search using the given ldapbasedn
and ldapsearchattribute
with the given username to find the user DN to bind with. This method can be useful when users exist in multiple OUs such that a single prefix and suffix will not satisfy all valid user DN patterns.
Search and Bind Example:
When using search and bind, a bind username and password may be required if your LDAP server does not allow anonymous search.
Users can authenticate with the Query Engine using Kerberos credentials by using the PostgreSQL gss
authentication method.
Before users can authenticate against the Query Engine using Kerberos, the PostgreSQL configuration must be updated with a keytab file. Kerberos principals must be generated for postgres/<host>@<REALM>
for each Query Engine server and any replication load balancers that may be in use.
Generate a keytab for these service principals, copy it to each Query Engine host, and set the path to the keytab in postgresql.conf
as krb_server_keyfile
. For example,
Be sure that the keytab file is owned by the immutaqe
user.
The configuration for Kerberos authentication should always have include_realm=0
, and the krb_realm
will need to be set. When users connect to the Query Engine they will need to present valid Kerberos credentials. If the Kerberos credentials match an Immuta user, authentication to the Query Engine succeeds.
PKI authentication makes use of certificates signed by a trusted authority to perform authentication.
An example pg_hba.conf
configuration is below.
By default, the cn
attribute from the certificate will be compared to the database username. If the Immuta user ID is something else, such as an email address, then
Define a user mapping in pg_ident.conf
:
Then, in order to use the mapping in pg_hba.conf
, add map=pki-map
:
Audience: Users with the IMPERSONATE_USER permission and System Administrators
Content Summary: This page outlines how to use the
IMPERSONATE_USER
permission for Immuta instances using the .
Query Engine Must Be Enabled
If the on the App Settings page, Query Engine User Impersonation will be unavailable.
There are two general use cases for user impersonation:
The Project Path: The user wants multiple users to use the same dashboard and needs everyone to see the same data. An Immuta project is created and equalized. Then it is exposed to a PostgreSQL connection for projects; this gives the project a single connection for all the users to impersonate. A dashboard can then be created with the project's connection. After this creation multiple users can see the same data with the correct policies enforced.
The Impersonation Path: The IMPERSONATE_USER
permission allows a user to identify themselves while watching a dashboard that is not their own. An identifier of the user requesting the data is presented with a special, sensitive access token. With this information the data on the dashboard can be personalized to the person viewing it, while still remaining a multi-user connection.
The tutorial below illustrates the Impersonation Path.
A User Admin .
As a user with the IMPERSONATE_USER
permission, connect your analytic tool to Immuta's Query Engine using the .
In your Immuta Query Engine session, enter the iamid
that is associated with the Immuta user account you want to impersonate.
The iamid
is the name of the Identity and Access Management (IAM) provider that the Immuta user you want to impersonate is associated with.
For example, if using the iamid
of "Okta
", the full SQL command would be
Note: The iamid
is a case-sensitive value.
Enter the userid
that is associated with the Immuta user account you want to impersonate.
The userid
could be an email address (if using Immuta's built-in identity manager - or bim
), or it could be a shortened form of the username like a sAMAccountName in Active Directory.
For example, to specify a userid
of jdoe
, run
Note: The userid
is a case-sensitive value.
In certain cases, it may be necessary to convert a shortened form of the username, like a sAMAccountName, to an email address in order to match it to an Immuta account. To handle this special case, Immuta has a capability that augments the userid
by a specified template.
For example, a sAMAccountName of jdoe
can be converted into an email address at mycompany.com
using a string template that substitutes the value of {userid}
with the userid
provided. The resulting value would be jdoe@mycompany.com
.
Now that your Immuta Query Engine session is configured to impersonate the desired Immuta user, your queries will be executed as the impersonated user as long as your session remains active.
Once impersonation is set, all subsequent SQL calls will be made as the impersonated user.
User impersonation lasts the duration of the SQL connection. To stop impersonating a user, simply close the connection.
It is not possible to switch impersonated users within a single SQL connection. Each connection supports at most one impersonation setting. After user impersonation has been enabled, attempts to set a different user to impersonate will fail.
Audience: System Administrators
Content Summary: This page details how to upgrade the Immuta Parcel and Service on your CDH cluster.
Prerequisites: Follow the to prepare for upgrading.
Transfer the Immuta .parcel
and its associated .parcel.sha
to your Cloudera Manager node and place them in /opt/cloudera/parcel-repo
. Once copied, ensure files must have ownership cloudera-scm
and group cloudera-scm
.
Once the Immuta parcel and its SHA (hash) file are in the parcel repo, you can distribute and activate the updated parcel. (Activating the new parcel will automatically deactivate an older version.) To do so,
In Cloudera Manager, select the Parcels icon in the upper right corner.
Click Check for New Parcels.
Make sure the location filter has your on-cluster parcel repo selected.
Locate the IMMUTA
parcel, and then find the row corresponding to the version you are upgrading to. Click Distribute.
Wait for the parcel to finish distribution. Once finished, the action button for that row should say Activate.
Click the Activate button to activate the parcel.
You have successfully upgraded your Immuta parcel.
The first step in upgrading your Immuta Partition Service CSD is copying the .jar
file to your Cloudera Manager node, placing it in /opt/cloudera/csd
. The file must have ownership cloudera-scm
and group cloudera-scm
.
You will need to restart Cloudera Manager in order for the CSD to be picked up:
Finally, restart the IMMUTA service in Cloudera Manager.
An Immuta System API key will also need to be generated for the NameNode to communicate securely with the Immuta Web Service. You can generate the System API key via the .
Before installing the Immuta software on your CDH cluster, it is recommended that you via the Cloudera Manager API and send a copy to . This will enable our support team to assist you with specific configurations that may be required for your environment. Knowing the configuration and layout of your cluster will also help the support team to expedite troubleshooting and resolution of any potential issues that may arise with your Immuta installation.
These artifacts are available for download at . If you are prompted to log in and need basic authentication credentials, contact your Immuta support professional.
Parcel, SHA, and CSD downloads:
Optional. The HDFS System Token that the cluster will use to securely communicate with the Immuta instance. You should generate this value in the before creating your cluster.
You will need to copy the immuta.keytab
and krb5.conf
files from the cluster and upload them to your Immuta instance using the .
You can associate these users with your Immuta users by following . Note that only the owner
principal will have access to the data in your chosen S3 data bucket, so this is the principal that you should use to create your data sources in Immuta.
If your cluster is configured with Kerberos, note that the default configuration expects to run Immuta services using the immuta
principal. If you need to use a different Kerberos principal, see for detailed instructions on how to configure that. After running through these steps, note that you may need to manually run the Create Immuta User Home Directory
command from the Actions
menu for the Immuta
service.
For more details on Immuta's HDFS configuration, please see .
See for details about each individual configuration value.
See for details about each individual configuration value.
The Immuta Web Service needs to be configured to support the HDFS plugin. You can set this configuration using the .
Additionally, you must upload a keytab for the immuta
user as well as a krb5.conf
configuration file to the Immuta Web Service. This can also be done via the .
In this guide, the bucket is referenced by the placeholder $BOOTSTRAP_BUCKET
. You should substitute this bucket name for a unique bucket name of your choosing. The bucket must contain all artifacts listed below. These artifacts can be found at .
Note that the above policy is derived from the Minimal EMR role for EC2 (instance profile) policy
described in Amazon's guide. You may need to tune this policy based on your organization's environment and needs.
Navigate to the and generate an Immuta HDFS System Token. Copy the value generated by Immuta, and create a new secret in AWS Secrets Manager as shown below.
First, create a security_configuration.json
file with your desired security settings. A basic example with a cluster-dedicated KDC for Kerberos is shown below. Note that you are allowing the following system users to use the data IAM role: hadoop
, hive
, and immuta_emr
. Data Owners must also have access to this data to use the Immuta Query Engine. This example grants access to any user in the fictional data_owners
group. See the official for more details on configuring IAM roles for EMRFS.
Since Immuta runs transparently on the cluster and does not require a separate SparkSession object, any administrative users who need to run jobs against raw data on cluster must set the proper Spark configuration parameters to bypass Immuta's plan resolution plugins. See the for the Databricks installation for more information.
See Immuta's for more details.
However, even when a non-Immuta user is executing a non-Immuta Spark job, it is possible that the Immuta NameNode plugin is still in the execution path for that job. Please see our for the Immuta NameNode plugin to minimize the overhead or impact on non-Immuta users in a Hadoop cluster (such as setting up ignored paths in HDFS or dynamically determining non-Immuta users or paths).
There are also a wide variety of cache and network settings that can be used to fine-tune performance. You can refer to the for details on each of these items.
See for instructions on how to identify performance issues in the Immuta NameNode Plugin.
Most of the current Spark controls are now set through the IMMUTA
service and will be removed through the subsequent step of stopping and disabling that service. These instructions are primarily for legacy Spark 1.6 installs that may still contain settings from the .
Groups function similarly to those in Active Directory and LDAP, allowing admins to group a set of users together. Users can belong to any number of groups and can be added or removed from groups at any time. Similar to , groups can be used to restrict what data a set of users has access to. When creating a policy on a data source, you can apply the policy to a group, which would affect any user that belongs to the said group.
Immuta can leverage two different types of handlers: Blob Handlers and Policy Handlers.
Permissions are system-level mechanisms that control what actions a user is allowed to take. These are applied to both the and actions. Permissions can be added to any user by an admin (any user with the USER_ADMIN
permission); however, the permissions themselves are managed by Immuta and cannot be added or removed.
Creating and managing users and .
Add and remove user .
Create and manage user .
CREATE_DATA_SOURCE: Gives the user the ability to .
CREATE_PROJECT: Gives the user the ability to .
GOVERNANCE: Gives the user the ability to , create purpose-based usage restrictions on , and .
Policy handlers enforce on the data that comes through Immuta. Policy handlers are either created through the or .
See for more information on projects.
Projects contain which can define (or restrict) the scope and usage of data within a project. Purpose restrictions can be defined by the Immuta Governor and/or the project owner(s). The Immuta Governor typically defines Immuta-wide restrictions like "To provide analytics." The project owner typically defines project- or data-specific restrictions such as "Billing," "Marketing," or "Research." Data that is accessed under the provision of a project will incorporate purpose-based auditing. If members join a project but would like to use the information for purposes other than what is specified, they can always create another project for those purposes.
Access to data in a data source can be restricted to data source users acting under a specific purpose within the context of an Immuta . To see the restricted data, data source subscribers must use the credentials that are associated with a project that contains the relevant purpose.
To access the data in any data source, Immuta users must first be subscribed to that data source. The users with the most basic access to a data source are referred to as subscribers. are subscribers with a set of their own special privileges.
See for details on managing Data Users.
A user attribute is a type of value tied to an Immuta user account. These attributes are split into three categories: , , and .
Assuming an Immuta SQL Account has already been created, navigate to your .
The full documentation for this pg_hba.conf
configuration is available in the PostgreSQL documentation under .
PostgreSQL has two methods of authenticating with LDAP: and .
The full documentation for this pg_hba.conf
configuration is available in the PostgreSQL documentation under .
The full documentation for this pg_hba.conf
configuration is available in the PostgreSQL documentation under .
The Immuta user account with the IMPERSONATE_USER
permission must have configured to conduct user impersonation via the Immuta Query Engine.
GET
/s3p
200
GET
/s3p/{bucket}
200
GET
/s3p/{bucket}/{dataSource}/{key*}
200
Audience: Data Users
Content Summary: This page details how to use the Immuta project workspace in Hive and Impala.
You can write data to a project workspace within an ImmutaSparkSession. Note that you must be acting within the context of a project in order to write to that project's workspace.
In the example below, the consumer1
user is acting under the project Taxi Research
, which contains purpose-restricted Impala data sources: NYC Taxi Trip
and NYC Taxi Fare
. This user will query these data sources from the ImmutaSparkSession and write the resulting DataFrame to parquet files in the Taxi Research
workspace at /user/immuta/workspace/Taxi_Research
.
The user can then verify that the data was written:
Data written to the project workspace can be easily exposed as a derived data source within the project.
Continuing from the example in the previous section, consumer1
can log in to the Immuta Web UI and start creating a derived data source by navigating to the Overview tab and clicking Create under Create Derived Data Source.
A modal will appear, prompting the user to select the data source(s) that the data was derived from. In this case, the data was derived from NYC Taxi Fare
.
Next, the user will need to enter the path where the data is stored and select the desired backing technology of the derived data source. In this case, the data is stored under /user/immuta/workspace/Taxi_Research/fare_total_sample
.
After the derived data source is created, other members of the project will be able to subscribe to it in the Immuta Web UI and query the data from the project workspace.
Although best practices dictate that new tables in a project workspace database should be created via derived data sources, users can opt to manually create working tables in the database using Hive or Impala. In this case, users can leverage CREATE TABLE
or CREATE EXTERNAL TABLE
statements. An example for creating the fare_total_sample
table using this method is below.
The native workspace enables users to query data from an Immuta project natively from Hive or Impala, as opposed to using the Immuta Query Engine or the ImmutaSparkSession.
Immuta will manage the Sentry permissions for project users, allowing them to access a database in the Hive Metastore that corresponds to their active project context. In the example below, a project user connects directly to Impala and queries a derived data source table in the taxi_research
project database. Note that this is only possible when the user is acting under the Taxi Research
project context.
This workspace allows native access to data on cluster without having to go through the Immuta SparkSession or Immuta Query Engine. Within a project, users can enable an HDFS Native Workspace, which creates a workspace directory in HDFS (and a corresponding database in the Hive metastore) where users can write files.
After a project owner creates a workspace, users will only be able to access this HDFS directory and database when acting under the project, and they should use the SparkSQL session to copy data into the workspace. The Immuta Spark SQL Session will apply policies to the data, so any data written to the workspace will already be compliant with the restrictions of the equalized project, where all members see data at the same level of access.
Once derived data is ready to be shared outside the workspace, it can be exposed as a derived data source in Immuta. At that point, the derived data source will inherit policies appropriately, and it will then be available through Immuta outside the project and can be used in future project workspaces by different teams in a compliant way.
Administrators can opt to configure where all Immuta projects are kept in HDFS (default is /user/immuta/workspace
). Note: If an administrator changes the default directory, the Immuta user must have full access to that directory. Once any workspace is created, this directory can no longer be modified.
Administrators can place a configuration value in the cluster configuration (core-site.xml
) to mark that cluster as unavailable for use as a workspace.
Once a project is equalized, project owners can enable a workspace for the project.
If more than one cluster is configured, Immuta will prompt for which to use.
Once enabled, the full URI of where that workspace is located will display on the project page.
Project owners can also add connection information for Hive and/or Impala to allow Hive or Impala workspace sources to be created. The connection information provided and the Kerberos credentials configured for Immuta will be used for each derived Hive or Impala data source. The connection string for Hive or Impala will be displayed on the project page with the full URI.
Project owners can disable the workspace at any time.
When disabled, the workspace will not allow reading/writing from project members any longer.
Data sources living in this directory will still exist and their access will not be changed. (Subscribed users will still have access as usual.)
All data in this directory will still exist, regardless of whether it belongs to a data source or not.
Project owners can purge all data in the workspace after it has been disabled. Project Owners can
Purge all non-data-source data only.
Purge all data (including data source data).
When purging all data source data, sources can either be disabled or fully deleted.
When a user is acting under the project context, Immuta will provide them read/write access to the project HDFS directory (using HDFS ACLs). If there are Immuta data sources already exposed in that directory, the user will bypass the namenode plugin if acting under the project for the data in that directory.
Once a user is not acting under the project, all access to that directory will be revoked and they can only access data in that project as official Immuta data sources, if any exist.
When users with the CREATE_DATA_SOURCE_IN_PROJECT permission create a derived data source with workspace enabled, they will be prompted with a modified create data source workflow:
The user will select the directory (starting with the project root directory) of the data they are exposing.
If the directory contains parquet or ORC files, then Hive, Impala, and HDFS will be an option for the data source; otherwise, only HDFS will be available.
Users will not be asked for the connection information because the Immuta user connection will be used to create the data source, which will ensure join pushdown and that the data source will work even when the user isn’t acting in the project. Note: Hive or Impala workspace sources are only available if the Project Owner added Hive or Impala connection information to the workspace.
If Hive or Impala is selected as the data source type, Immuta will infer schema/partitions from files and generate create table statements for Hive.
Once the data source is created, policy inheritance will take effect.
Note: To avoid data source collisions, Immuta will not allow HDFS and Hive/Impala data sources to be backed from the same location in HDFS.
Audience: Data Users
Content Summary: This page explains the Immuta Query Engine.
Once subscribed to a data source, one of the mechanisms the user has for accessing data in that source is the Immuta SQL connection. The connection is a regular PostgreSQL connection, and the data sources look like PostgreSQL tables, but these tables abstract the true underlying database technology, allowing users to visit a single place for all of their data. However, the data still resides in its original location, not within Immuta. When a user queries the Immuta database, the query is transformed to sync with the underlying data platform for any data source. When the data is returned from the original location, Immuta applies policies based on the querying user's attributes and forwards the data on to that user.
All policy types are supported by the Immuta Query Engine. See the Subscription Policies or Data Policies overview for details about policy types.
Users can add their SQL connection to their analytic tools, such as Excel, Tableau, RStudio, etc. to query protected data through the Query Engine.
Once you’ve hooked in your BI tool and have subscribed to data sources in Immuta, you will see available tables in the Immuta database — these tables are the exposed Immuta data sources. All of the Immuta data sources look and feel just like PostgreSQL tables (when they are actually a proxy for the real data source). This means you can execute cross-database technology queries since to you, they are just PostgreSQL tables.
You will only be allowed to run queries on data sources you are subscribed to and against data you have appropriate entitlements to view.
To access data sources in the context of a project, Immuta users can also obtain unique SQL credentials for each project that they are a member of.
These credentials will only provide access to the data sources in their respective projects and allow Data Governors to enforce purpose-based restrictions on project data.
See Creating Project Based SQL Connections for more information.
Audience: Data Users
Content Summary: Immuta's Spark integration can help you leverage data in tables across different clusters and databases in your organization, without having to make permanent copies of the data. This page illustrates the process of running efficient cross-technology joins in Spark.
The code examples on this page are written in Scala using the
immuta
session variable in Spark 2.4. If you are using Spark 1.6, you can repeat these steps with the ImmutaContext variable,ic
.
An Immuta data source for each database table that you wish to join. For guidance on creating these data sources, please refer to this tutorial.
A working Immuta HDFS/Spark plugin installation on one of your clusters. This is also the cluster that your spark jobs will run on. For guidance on installing the Immuta plugin, please refer to the Hadoop Installation Guide.
When joining data across clusters, the most efficient approach is to focus queries on narrower windows of data to eliminate overhead. Although Immuta is not permanently rewriting the data, it still must transport data across a network from a different cluster. For this reason, users are encouraged to avoid overly broad queries.
Suppose you wish to run the query below, where sales
refers to an Immuta data source on Cluster A and customer
refers to an Immuta data source denoted by Database B. Also assume that the Immuta Spark plugin has been successfully installed on Cluster A.
To eliminate overhead, you join data and calculate sales totals for customers within their first month of registration. The following query calculates first-month sales for customers who registered in April 2018:
To maximize the efficiency of the cross-cluster join query, the first step is to load a partitioned portion of the data into a Spark DataFrame. This will reduce the overhead of the join query, and allow Immuta to calculate an ideal query plan.
First, load the desired sales
data from the local Cluster A into a DataFrame named salesDF
by passing the desired query to immuta.sql()
:
Then, load customer
data from remote Database B into a DataFrame named customerDF
. The syntax to set up the remote DataFrame is a little bit different since the user needs to pass in the partitioning configuration. Note that the user defines partitions on the region_id
column, which is an integer
between 1000
and 2000
.
Note: When choosing a partition column, it is important to find a column with a generally even distribution across a known range of values. If you are expecting a large volume of data to be returned from the remote cluster, you can increase the number of partitions to break up the transfers into smaller payloads.
If you do not partition your query and the remote data is larger than a single executor can handle (which is very typical for most workloads), the full local-cluster portion of the query will run. Then, one-by-one each Spark executor will attempt to execute the remote query and fail due to memory limitations. Thus, the time to failure of a non-partitioned query is extremely long. For more information, please contact your Immuta Support Professional.
Now that you have defined the filtered and partitioned DataFrames, register them as temporary views that will be used in the join query:
Immuta recognizes these temporary views as queryable tables for the current session. Below is an example of viewing the queryable Immuta tables in the Spark CLI:
Finally, leverage the newly-created temporary views to run the cross-cluster join query:
The following is a possible output in the Spark CLI:
Audience: System Administrators
Content Summary: By default, the Immuta Partition servers will run as the
immuta
user. For clusters configured to use Kerberos, this means that you must have animmuta
principal available for Cloudera Manager to provision the service. If for some reason you do not have animmuta
principal available, you can change the user that the Immuta partition servers run as.This page describes the configuration changes that are needed to change the principal(s) that Immuta uses. The same principal can be used for both services, but that is not necessary. Just make sure the configuration options are consistent for all configuration options on the individual services.
The Immuta Spark Partition Servers are components that run on your CDH cluster. The following sections will walk you through configuring the various CDH components so that the Spark Partition Servers can run as a non-default user.
In the configuration for the Immuta
service, make the following updates:
System User: Set to the system user that will be running Immuta.
System Group: Set to the primary group of the user that will be running Immuta.
Kerberos Principal: Set to the Kerberos principal of the user that will be running Immuta.
In the configuration for HDFS
, make the following updates:
Cluster-wide
Advanced Configuration Snippet (Safety Valve) for core-site.xml
:
Set immuta.spark.partition.generator.user
to the principal configured as the Kerberos Principal in the Immuta
service.
The Immuta Web Service uses the configured Kerberos principal to impersonate users when running queries against various Kerberos-enabled databases. If you are using a non-default Kerberos principal for the Immuta Web Service, be sure to update the following values.
In the configuration for HDFS
, enter the following for Cluster-wide Advanced Configuration Snippet (Safety Valve) for core-site.xml
:
hadoop.proxyuser.<immuta service principal>.hosts
Description: The configuration that allows the Immuta service principal to proxy other hosts. Make sure to enter the appropriate principal in place of <immuta service principal>
.
Value: *
hadoop.proxyuser.<immuta service principal>.users
Description: The configuration that allows the Immuta service principal to proxy end-users. Make sure to enter the appropriate principal in place of <immuta service principal>
.
Value: *
hadoop.proxyuser.<immuta service principal>.groups
Description: The configuration that allows the Immuta service principal to proxy user groups. Make sure to enter the appropriate principal in place of <immuta service principal>
.
Value: *
If the principal for the Immuta Web Service is different from the principal used by the Immuta Partition Server, then be sure to add the Web Service principal to immuta.permission.users.to.ignore
. In the HDFS
configuration section for NameNode Advanced Configuration Snippet (Safety Valve) for hdfs-site.xml
ensure that the user principal running the Immuta Web Service is included in the comma-separated list of users set for immuta.permission.users.to.ignore
.
Audience: System Administrators
Content Summary: This page details how to use the
immuta_hdfs_log_analyzer
tool to troubleshoot slowdowns in your CDH cluster.
Sub-optimal configuration of the Immuta HDFS NameNode plugin may cause cluster-wide slowdowns under certain conditions. The NameNode plugin contains a variety of cache settings to limit the number of network calls that occur within the NameNode's locked permission checking operation. If these settings are configured properly, there will be little to no impact on the performance of HDFS operations.
You can use the immuta_hdfs_log_analyzer
command-line utility to track the number of API calls coming from NameNode plugin to the Immuta Web Service.
You can download the log analysis tool:
It can be invoked like so:
START_TIME (-s
, --start-time
): Timestamp for the beginning of the period to analyze.
END_TIME (-e
, --end-time
): Timestamp for the end of the period to analyze.
GRANULARITY (g
, --granularity
): Defines time buckets for analysis. Can be MINUTES
, HOURS
or DAYS
.
TIME_FORMAT (-t
, --time-format
): The format to use for timestamps. This should match the timestamp format in the Immuta Web Service logs.
If you are able to correlate time buckets from this tool's output to periods of slow cluster performance, you may need to adjust configuration for the Immuta HDFS NameNode plugin.