Skip to content

Conversation

@sungwy
Copy link
Contributor

@sungwy sungwy commented Nov 12, 2025

Doc PR following up the introduction of OpaPolarisAuthorizer: #2680

Checklist

  • πŸ›‘οΈ Don't disclose security issues! (contact [email protected])
  • πŸ”— Clearly explained why the changes are needed, or linked related issues: Fixes #
  • πŸ§ͺ Added/updated tests with good coverage, or manually tested (and explained how)
  • πŸ’‘ Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • πŸ“š Updated documentation in site/content/in-dev/unreleased (if needed)

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sungwy This is a really neat piece of documentation and PR work! Thanks a lot!

Just a few minor comments, nothing serious.


Create a policy file (e.g., `policies/polaris.rego`):

```rego
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too sad - guess we need to bump the Hugo version to get syntax highlighting for Rego (not for this PR tho).

sungwy and others added 2 commits November 12, 2025 09:04
Co-authored-by: Robert Stupp <[email protected]>
Co-authored-by: Robert Stupp <[email protected]>
@sungwy
Copy link
Contributor Author

sungwy commented Nov 12, 2025

@sungwy This is a really neat piece of documentation and PR work! Thanks a lot!

Just a few minor comments, nothing serious.

Thanks @snazy :) I've adopted your suggested changes and it looks like Hugo Site CI is breaking as a result. I'll take another pass through this PR later today πŸ˜„

linkTitle: Managing Security
type: docs
weight: 550
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The front-matter ending is missing now. That's probably why CI fails.

Comment on lines 26 to 28
{{< alert warning "Experimental Feature" >}}
**OPA integration is currently an experimental feature** and may undergo breaking changes in future versions. Use with caution in production environments.
{{< /alert >}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d suggest using β€œPreview Feature” instead of β€œExperimental Feature.”
β€œPreview” typically signals that the feature is available for early adoption and feedback, but not finalized, while sounding more stable and user-friendly than β€œexperimental.” This may set better expectations for users. For example, we marked the event as a preview feature, https://polaris.apache.org/downloads/#120.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great suggestion - thank you @flyrain !


The `action` field contains the operation being attempted as a string value from the `PolarisAuthorizableOperation` enum.

For the complete list of available operations, see the [PolarisAuthorizableOperation enum](https://github.com/apache/polaris/blob/main/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizableOperation.java) in the source code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we recommend to handle all operations in OPA so that it makes sure that an operation won't accidentally fail? Even say, defaulting operations you don't care to deny would be helpful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also mention that the certain operations(e.g. grant privilges) should be set to deny always?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we recommend to handle all operations in OPA so that it makes sure that an operation won't accidentally fail? Even say, defaulting operations you don't care to deny would be helpful.

Sounds good πŸ‘

Should we also mention that the certain operations(e.g. grant privilges) should be set to deny always?

I think that makes sense. I was just wondering if we'd want to do that explicitly in the OpaPolarisAuthorizer, but I think relying on the default behavior of default allow := false would be an easier way of achieving than maintaining a list in the opa extension

For the complete list of available operations, see the [PolarisAuthorizableOperation enum](https://github.com/apache/polaris/blob/main/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizableOperation.java) in the source code.

Common examples include:
- Table operations: `LOAD_TABLE_WITH_READ_DELEGATION`, `LOAD_TABLE_WITH_WRITE_DELEGATION`, `CREATE_TABLE_DIRECT`, `UPDATE_TABLE`, `DROP_TABLE_WITHOUT_PURGE`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking more about it, would it make sense to provide a rego example that demonstrate how it would work with all kinds of operations? It's a blocker for this PR. We could file an issue for that if that makes sense.

Copy link
Contributor Author

@sungwy sungwy Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to say that it's not a blocker for this PR? :)

I'm +1 for creating a follow up issue for that! Happy to create it once you clarify above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the typo. It's NOT a blocker.

Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice doc! Thanks a lot for working on it, @sungwy! Left some comments.

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants