Fine-Grained Access Control [Technical Preview]

Fine-Grained Access Control introduced in Spark 4.1 enforces row-level filtering and column-level masking across Cloudera Data Engineering resources by integrating Spark Connect, Apache Ranger, and Apache Polaris.

Configure Fine-Grained Access Control for running Spark Connect sessions through the Cloudera Data Engineering CLI. Access requires Apache Ranger policy enforcement and storage credential vending through Apache Polaris.

In Cloudera Data Engineering with Cloudera Unified Data Fabric, Spark 4.1 introduces a security plugin that enforces Fine-Grained Access Control by intercepting queries and applying security rules. This architecture uses Apache Polaris and Ranger for catalog management and dynamic credential vending. Fine-Grained Access Control provides centralized enforcement of row-level filters and column-level masking across all Spark resources. Integrating Spark Connect, Apache Ranger, and Polaris ensures secure access to data stored in Iceberg tables by leveraging trusted engines as the execution proxy, separating the runtime from the data access layer, and mitigating risks associated with over-privileged compute models.

Operational workflow

You can use Fine-Grained Access Control when running Spark Connect sessions through the Cloudera Data Engineering CLI.

Ranger enforces the security policy before the data is accessed, as the data is filtered before it leaves the storage layer. Polaris acts as the gatekeeper for storage: Spark cannot bypass Ranger, for example to access raw S3 or GCS paths directly, instead Spark must get the temporary access token from Polaris.

The platform does not allow low-level APIs (for example direct SparkContext access) and arbitrary User Defined Functions. You must use standard DataFrame or SQL operations. Jobs attempting to use low-level APIs, custom User Defined Functions, or bypass Spark Connect are denied.

Security integrity

When a session starts: before it accepts any queries, the Spark Connect session checks if it can reach Ranger and download the access policies. If Ranger is unreachable, or the security plugin cannot finish setting up, the session stops and does not run any queries. The session is displayed as failed, and the reason is included in the driver log. An administrator can turn off this startup check, but this is not recommended, as in that case sessions can start without the access rules being applied.

While a session is running: the session keeps a copy of the latest Ranger policies and checks Ranger for changes every 30 seconds. Policy changes made in Ranger apply to running sessions in about 30 seconds, without a restart.

If Ranger becomes unavailable during a session: queries keep running with the last policies the session downloaded. Policy changes made in Ranger during the outage, including removing a user's access, take effect only after Ranger is reachable again. The session picks them up at its next check. If a session has never managed to download policies, its queries are refused.

Authentication failures: if the user's identity cannot be confirmed, the query is rejected.

Audit logging

Every policy evaluation decision is logged to an audit store. Security event logs are stored as audit logs, separately from general application logs. Audit logs are accessible to security administrators. The log entry contains the user ID, the resource accessed (database/table/column), and the policy decision, which can be “allow” or "deny”.

Configuration hardening

To prevent resource hijacking and unauthorized security bypasses, modifying the Spark engine settings is restricted. The spark.kyuubi.conf.restricted.list Spark driver configuration property defines a deny-list enforced at both the Catalyst layer and the gRPC layer. You can set the spark.kyuubi.conf.restricted.list Spark driver configuration at the Spark Compute level.