Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify docs for multiple access controls #24549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mosabua
Copy link
Member

@mosabua mosabua commented Dec 20, 2024

Description

Centralize and clarify usage with multiple access control systems.

Additional context and related issues

See #20152

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@mosabua mosabua requested a review from dain December 20, 2024 18:12
@cla-bot cla-bot bot added the cla-signed label Dec 20, 2024
@github-actions github-actions bot added the docs label Dec 20, 2024
the default `etc/access-control.properties`. Relative paths from the Trino
`INSTALL_PATH` or absolute paths are supported.

The configured access control systems are used in order until access rights are
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure about this .. also would be good to explain more with an example.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is true, but ordering shouldn't matter. Each access control is independent from the others.

Copy link
Member Author

Choose a reason for hiding this comment

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

well.. if they are independent.. what does that mean .. are the evaluted in order . what if the first on does a deny .. but the second one would be granting access ..

Copy link
Contributor

Choose a reason for hiding this comment

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

Any individual deny results in deny as the final result. So it doesn't really matter which does this first :)

the default `etc/access-control.properties`. Relative paths from the Trino
`INSTALL_PATH` or absolute paths are supported.

The configured access control systems are used in order until access rights are
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is true, but ordering shouldn't matter. Each access control is independent from the others.

`INSTALL_PATH` or absolute paths are supported.

The configured access control systems are used in order until access rights are
either granted or denied, and must use different types. Each system is
Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually "access is granted if none of the access controls denies it" - or: all access controls must allow. But if there are no access controls at all, all access is allowed. That's at the engine level (which is of interest here) and not to be confused with how each individual access control works.

Copy link
Member Author

Choose a reason for hiding this comment

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

So .. isnt that terrible for performance .. that kinda means all access controls are evaluated all the time .. is there some advice on how to order them better in terms of performance impact .. e.g. the most restrictive should be first? Or just the fastest should be first? Or any other better idea? Like .. dont use multiple system unless you have a real good reason like ???

Copy link
Contributor

Choose a reason for hiding this comment

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

that kinda means all access controls are evaluated all the time

Yes.

is there some advice on how to order them better in terms of performance impact

I think the assumption is that access control should not have significant impact on performance. If it does, fix your access control, or something like that.

Or any other better idea? Like .. dont use multiple system unless you have a real good reason like ???

I would say, this one. Combining access controls is tricky, especially system (global) access controls. Say you want to control catalog A with access control A, and catalog B with access control B, but both of them are deny-by-default (i.e. deny unless there's an explicit allow grant). This means you have to make access control A effectively allow-all for catalog B and vice versa. This tends to be surprisingly tricky, especially because "allow-all" in this case must be "allow all with grant option" because of SECURITY DEFINER views.

`INSTALL_PATH` or absolute paths are supported.

The configured access control systems are used in order until access rights are
either granted or denied, and must use different types. Each system is
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what you mean by "different types"?

Copy link
Member Author

Choose a reason for hiding this comment

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

OPA vs file-based vs Ranger vs whatever .. is there a better name for them?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks. I think I too would call them "types" :) But actually it's not true that they must be different types. The plugins can't register access control factories with the same name, but AFAICT it's perfectly fine to have two access control configuration files using the same access control, e.g. two "ranger"s.

Copy link
Member

Choose a reason for hiding this comment

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

"different access control plugins" - although this isn't true - it's perfectly fine to have two file-based or two-rangers or any mix you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants