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

Document function rules for File-based Access Control #14774

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

huberty89
Copy link
Contributor

Description

Update documentation for #13713

Copy link
Member

@colebow colebow left a comment

Choose a reason for hiding this comment

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

I've made an initial pass. Defer to @m57lyra if she suggests anything in the same places, as she's better at this than I am.

Copy link
Contributor

@m57lyra m57lyra left a comment

Choose a reason for hiding this comment

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

Some things to take care of.

Comment on lines 405 to 406
``query`` polymorphic table function should be used by admins in a first
place.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not quote sure what is meant here @huberty89 - Do you mean that only admins should have this privilege? If so:

" The query PTF is recommended for use only by admin or users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean that only admins should have this privilege?

In short yes. query PTF bypass the whole access control and should be used carefully.
To make access more strict, admin should create a SECURITY DEFINER views which execute specific query using query PTF so user can use only those defined by admin.

@huberty89 huberty89 force-pushed the hubert/fbac-functions-doc branch 2 times, most recently from 93c1b5d to 475c417 Compare October 31, 2022 19:33
@huberty89
Copy link
Contributor Author

@colebow @m57lyra Please take a look, I applied fixed based on all comments

Copy link
Contributor

@m57lyra m57lyra left a comment

Choose a reason for hiding this comment

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

Just a couple of minor fixes needed.

@huberty89 huberty89 force-pushed the hubert/fbac-functions-doc branch from 475c417 to 729ded8 Compare October 31, 2022 19:43
@@ -25,6 +25,13 @@ cluster in a single JSON file.
Configuration
-------------

.. warning::
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be part of the release notes. If we add warnings like that we may end up with messy docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, and it should be in a breaking change section, as this will break expected security behaviors.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was told though that there are no special sections, and release notes are generated from issues?

Copy link
Member

Choose a reason for hiding this comment

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

Release notes are not generated. We write them .. but we do not have a dedicated breaking changes section. But this can be added .. probably was already .. @colebow ?

Also the warning is still appropriate .. maybe without the version info and past behavior though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remove information about Trino versions

Copy link
Member

Choose a reason for hiding this comment

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

I think we still need this too in release notes.

.. note::

It is recommended to only allow admins to use the ``query`` polymorphic table
function.
Copy link
Member

Choose a reason for hiding this comment

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

Add "why"

Maybe it would be nice to have some best-practices somewhere. Where you would have config to grant access to PTF to admin, then create a (definer) view on top of it with admin as owner and granting access to view to regular users. Maybe we could explain that only somewhere.

Copy link
Member

Choose a reason for hiding this comment

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

I would even say .. remove that.. there is no reason for this to be best practice in general. Instead explain what the consequence is of this setup .. and earlier what happens by default

Copy link
Member

Choose a reason for hiding this comment

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

As in like .. if anyone is allowed to execute table functions.. then what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

query table function which works as a query pass-though - it's bypass the whole access control so IMO it's quite important to at least mention about it

Copy link
Member

Choose a reason for hiding this comment

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

Yeah .. mention.. but not recommend as best practice.. its just important to understand that it is kind of a security hole otherwise ;-) .. so we need to explain that and not just have a recommendation without detailing the reasoning

Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Some changes like "regex" might have to wait and be done to the whole document later

@@ -25,6 +25,13 @@ cluster in a single JSON file.
Configuration
-------------

.. warning::
Copy link
Member

Choose a reason for hiding this comment

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

Release notes are not generated. We write them .. but we do not have a dedicated breaking changes section. But this can be added .. probably was already .. @colebow ?

Also the warning is still appropriate .. maybe without the version info and past behavior though

.. note::

It is recommended to only allow admins to use the ``query`` polymorphic table
function.
Copy link
Member

Choose a reason for hiding this comment

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

I would even say .. remove that.. there is no reason for this to be best practice in general. Instead explain what the consequence is of this setup .. and earlier what happens by default

.. note::

It is recommended to only allow admins to use the ``query`` polymorphic table
function.
Copy link
Member

Choose a reason for hiding this comment

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

As in like .. if anyone is allowed to execute table functions.. then what?

@huberty89 huberty89 force-pushed the hubert/fbac-functions-doc branch from 729ded8 to 195091a Compare November 2, 2022 11:44
@huberty89
Copy link
Contributor Author

@mosabua @kokosing updated, please take a look

Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Let's update a bit more.

@huberty89 huberty89 force-pushed the hubert/fbac-functions-doc branch 2 times, most recently from 177a916 to a679b25 Compare November 2, 2022 16:34
@huberty89 huberty89 force-pushed the hubert/fbac-functions-doc branch from a679b25 to c658368 Compare November 2, 2022 17:22
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Looks good now. @martint could you merge this before the release since the feature already merged with the 401 release.

@kokosing kokosing merged commit bc7f2a7 into trinodb:master Nov 4, 2022
@github-actions github-actions bot added this to the 403 milestone Nov 4, 2022
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.

5 participants