8000 config: allow to grant access to specific functions using `lua_call` · Issue #10304 · tarantool/tarantool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

config: allow to grant access to specific functions using lua_call #10304

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

Closed
Totktonada opened this issue Jul 24, 2024 · 0 comments · Fixed by #10324
Closed

config: allow to grant access to specific functions using lua_call #10304

Totktonada opened this issue Jul 24, 2024 · 0 comments · Fixed by #10324
Assignees
Labels
3.2 Target is 3.2 and all newer release/master branches config feature A new functionality

Comments

@Totktonada
Copy link
Member
Totktonada commented Jul 24, 2024

The declarative configuration allows to grant access to all global Lua functions (except built-in ones).

credentials:
  users:
    alice:
      privileges:
        - permissions: [execute]
          lua_call: [all]
An excerpt from the instance config schema

lua_call = schema.array({
items = schema.scalar({
type = 'string',
allowed_values = {'all'},
}),


It is a rough equivalent of the following box.schema.{user,role}.grant() call:

box.schema.user.create('alice')
box.schema.user.grant('alice', 'execute', 'lua_call')

box.schema.{user,role}.grant() allows to grant access to a particular global Lua function using lua_call since the 3.0.0 release (see #9360):

box.schema.user.create('alice')
box.schema.user.grant('alice', 'execute', 'lua_call', 'my_func')

We should support it in the declarative configuration too.

An example of such configuration:

credentials:
  users:
    alice:
      privileges:
        - permissions: [execute]
          lua_call: [my_func]

Part of TNTP-201.

@Totktonada Totktonada added feature A new functionality config labels Jul 24, 2024
mandesero added a commit to mandesero/tarantool that referenced this issue Jul 29, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

NO_DOC=yet
mandesero added a commit to mandesero/tarantool that referenced this issue Jul 29, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

NO_DOC=yet
mandesero added a commit to mandesero/tarantool that referenced this issue Jul 30, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

NO_DOC=yet
mandesero added a commit to mandesero/tarantool that referenced this issue Jul 30, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

@TarantoolBot document
Title: Grant access to specific functions using lua_call

Root document: https://www.tarantool.io/ru/doc/latest/book/admin/access_control

object-types:
- `lua_call`: A list of permitted global user-defined Lua functions
that can be called.

object-types-and-permissions:
- `lua_call`: `execute` This field specifies a list of allowed global
user-defined Lua functions that can be executed using the IPROTO_CALL
request. This permission doesn’t allow a user to call built-in Lua
functions (for example, `loadstring()` or `box.session.su()`) and
functions defined in the `_func` system space.
mandesero added a commit to mandesero/tarantool that referenced this issue Jul 30, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

@TarantoolBot document
Title: Grant access to specific functions using lua_call

Root document: https://www.tarantool.io/en/doc/latest/book/admin/access_control

object-types:
- `lua_call`: A list of permitted global user-defined Lua functions
that can be called.

object-types-and-permissions:
- `lua_call`: `execute` This field specifies a list of allowed global
user-defined Lua functions that can be executed using the IPROTO_CALL
request. This permission doesn’t allow a user to call built-in Lua
functions (for example, `loadstring()` or `box.session.su()`) and
functions defined in the `_func` system space.
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 5, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

@TarantoolBot document
Title: Grant access to specific functions using lua_call

Root document: https://www.tarantool.io/en/doc/latest/book/admin/access_control

object-types:
- `lua_call`: A list of permitted global user-defined Lua functions
that can be called.

object-types-and-permissions:
- `lua_call`: `execute` This field specifies a list of allowed global
user-defined Lua functions that can be executed using the IPROTO_CALL
request. This permission doesn’t allow a user to call built-in Lua
functions (for example, `loadstring()` or `box.session.su()`) and
functions defined in the `_func` system space.
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 5, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304

@TarantoolBot document
Title: Grant access to specific functions using lua_call

Root document: https://www.tarantool.io/en/doc/latest/book/admin/access_control

object-types:
- `lua_call`: A list of permitted global user-defined Lua functions
that can be called.

object-types-and-permissions:
- `lua_call`: `execute` This field specifies a list of allowed global
user-defined Lua functions that can be executed using the IPROTO_CALL
request. This permission doesn’t allow a user to call built-in Lua
functions (for example, `loadstring()` or `box.session.su()`) and
functions defined in the `_func` system space.
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 5, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows user 'alice' to execute the `foo` function.

Closes tarantool#10304
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 6, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

Closes tarantool#10304

@TarantoolBot document
Title: Document lua_call feature

Root document: https://www.tarantool.io/en/doc/latest/reference/configuration/configuration_reference/

`<user_or_role_name>.privileges.lua_call`:

Defines the Lua functions that the specified user or a user with the
specified role has permission to call. This field accepts a special
value, `all`, which grants the privilege to use any global non-built-in
Lua functions.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows the user alice to execute the foo function.
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 8, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

Closes tarantool#10304

@TarantoolBot document
Title: Document lua_call feature

Root document: https://www.tarantool.io/en/doc/latest/reference/configuration/configuration_reference/

`<user_or_role_name>.privileges.lua_call`:

Defines the Lua functions that the specified user or a user with the
specified role has permission to call. This field accepts a special
value, `all`, which grants the privilege to use any global non-built-in
Lua functions.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows the user alice to execute the foo function.
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 9, 2024
no commit message yet

[WIP]: This task depends on
- tarantool#10304 (PR tarantool#10324)
- tarantool#10306 (PR tarantool#10358)
and uses commits from these PRs.

Closes tarantool#10310

NO_DOC=yet
NO_CHANGELOG=yet
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 9, 2024
no commit message yet

[WIP]: This task depends on
- tarantool#10304 (PR tarantool#10324)
- tarantool#10306 (PR tarantool#10358)
and uses commits from these PRs.

Closes tarantool#10310

NO_DOC=yet
NO_CHANGELOG=yet
mandesero added a commit to mandesero/tarantool that referenced this issue Aug 13, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

Closes tarantool#10304

@TarantoolBot document
Title: Document lua_call feature

Root document: https://www.tarantool.io/en/doc/latest/reference/configuration/configuration_reference/

`<user_or_role_name>.privileges.lua_call`:

Defines the Lua functions that the specified user or a user with the
specified role has permission to call. This field accepts a special
value, `all`, which grants the privilege to use any global non-built-in
Lua functions.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows the user alice to execute the foo function.
Totktonada pushed a commit to mandesero/tarantool that referenced this issue Aug 19, 2024
This patch adds the capability to grant access to specific Lua functions
in the declarative configuration. You can now grant access by assigning
the function name to `credentials.users.<user>.privileges.lua_call`.

Closes tarantool#10304

@TarantoolBot document
Title: Document lua_call feature

Root document: https://www.tarantool.io/en/doc/latest/reference/configuration/configuration_reference/

`<user_or_role_name>.privileges.lua_call`:

Defines the Lua functions that the specified user or a user with the
specified role has permission to call. This field accepts a special
value, `all`, which grants the privilege to use any global non-built-in
Lua functions.

For example, setting
	`credentials.users.alice.privileges.lua_call = ['foo']`
allows the user alice to execute the foo function.
@Totktonada Totktonada added 3.3 Target is 3.3 and all newer release/master branches 3.2 Target is 3.2 and all newer release/master branches and removed 3.3 Target is 3.3 and all newer release/master branches labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2 Target is 3.2 and all newer release/master branches config feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0