Skip to content

Enhancement: Support for Row-Level Filtering and Column Masking in Druid OPA Authorizer #137

@Vinoth721

Description

@Vinoth721

Description:

We are currently using the druid-opa-authorizer plugin to integrate Open Policy Agent (OPA) with Apache Druid for fine-grained access control.

At present, the plugin only supports boolean authorization decisions (i.e., true or false) returned from OPA policies.
This works well for basic allow/deny authorization but does not support more granular data security requirements such as row-level filtering and column-level masking.

In enterprise environments, it’s common to need:

  • Row-Level Security (RLS): Restricting access to specific rows based on user identity, role, or group (e.g., a user in the APAC region should only see records where region = 'APAC').
  • Column Masking: Masking or hiding sensitive columns (e.g., salary, SSN) from certain users while allowing others full access.

Currently, since the OPA policy can only return a boolean value, Druid cannot apply dynamic filtering or masking logic at the query level.

We propose enhancing the plugin to handle structured JSON responses from OPA that include both access decisions and filter/masking metadata.


Proposed Enhancement:

Support for JSON-based OPA responses, for example:

{
  "allow": true,
  "row_filter": "region = 'APAC'",
  "column_mask": {
    "ssn": "MASKED",
    "salary": "NULL"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions