You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jerqi (via GitHub)" <gi...@apache.org> on 2024/08/13 04:03:59 UTC
[PR] [#4467] docs: Refactor the security document and add access control [gravitino]
jerqi opened a new pull request, #4496:
URL: https://github.com/apache/gravitino/pull/4496
### What changes were proposed in this pull request?
Refactor the security document and add access control
### Why are the changes needed?
Fix: #4467
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Just docs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718029870
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,173 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple, OAuth and Kerberos.
+If you don't enable authentication for your client and server explicitly, you will use anonymous to access the server.
+
+### Simple mode
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` in the client isn't set, the client uses the user logging in the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
+
+| Configuration item | Description | Default value | Required | Since version |
+|---------------------------------------------------|-----------------------------------------------------------------------------------------------------|-------------------|--------------------------------------------|---------------|
+| `gravitino.authenticator` | The authenticator which Gravitino uses, setting as `simple`,`oauth` or `kerberos`. | `simple` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serviceAudience` | The audience name when Gravitino uses OAuth as the authenticator. | `GravitinoServer` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.allowSkewSecs` | The JWT allows skew seconds when Gravitino uses OAuth as the authenticator. | `0` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.defaultSignKey` | The signing key of JWT when Gravitino uses OAuth as the authenticator. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.signAlgorithmType` | The signature algorithm when Gravitino uses OAuth as the authenticator. | `RS256` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serverUri` | The URI of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.tokenPath` | The path for token of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.kerberos.principal` | Indicates the Kerberos principal to be used for HTTP endpoint. Principal should start with `HTTP/`. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+| `gravitino.authenticator.kerberos.keytab` | Location of the keytab file with the credentials for the principal. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+
+The signature algorithms that Gravitino supports follows:
+
+| Name | Description |
+|-------|------------------------------------------------|
+| HS256 | HMAC using SHA-25A |
+| HS384 | HMAC using SHA-384 |
+| HS512 | HMAC using SHA-51 |
+| RS256 | RSASSA-PKCS-v1_5 using SHA-256 |
+| RS384 | RSASSA-PKCS-v1_5 using SHA-384 |
+| RS512 | RSASSA-PKCS-v1_5 using SHA-512 |
+| ES256 | ECDSA using P-256 and SHA-256 |
+| ES384 | ECDSA using P-384 and SHA-384 |
+| ES512 | ECDSA using P-521 and SHA-512 |
+| PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 |
+| PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 |
+| PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 |
+
+### Example
+
+You can follow the steps to set up an OAuth mode Gravitino server.
+
+1. Prerequisite
+
+ You need to install the JDK8 and Docker.
+
+2. Set up an external OAuth 2.0 server
+
+ There is a sample-authorization-server based on [spring-authorization-server](https://github.com/spring-projects/spring-authorization-server/tree/1.0.3).
+
+ The image has registered client information in the external OAuth 2.0 server.
+
+ Its clientId is `test`. Its secret is `test`. Its scope is `test`.
+
+```shell
+ docker run -p 8177:8177 --name sample-auth-server -d datastrato/sample-authorization-server:0.3.0
+```
+
+3. Open [the JWK URL of the Authorization server](http://localhost:8177/oauth2/jwks) in the browser and you can get the JWK.
+
+ 
+
+4. Convert the JWK to PEM. You can use the [online tool](https://8gwifi.org/jwkconvertfunctions.jsp#google_vignette) or other tools.
+
+ 
+
+5. Copy the public key and remove the character `\n` and you can get the default signing key of Gravitino server.
+
+6. You can refer to the [Configurations](gravitino-server-config.md) and append the configurations to the conf/gravitino.conf.
+
+```text
+gravitino.authenticator = oauth
Review Comment:
I can't get your word `We don't merge this document.`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718030360
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
Review Comment:
https://www.reddit.com/r/grammar/comments/ufits/i_love_you_too_or_i_love_you_too/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715437282
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+
+The user won't be able to use the privilege.
Review Comment:
OK, I will the blank line.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denys to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denys to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, is spitted by comma. | | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
+
+You should add the user to your metalake before you use the authorization.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ "name": "user1",
+}' http://localhost:8090/api/metalakes/test/users
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.addUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Get a user
+
+You can get a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.getUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a user
+
+You can delete a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+## Group Operation
+
+
+### Add a Group
+
+The external systems like LDAP, Scim and etc manage the group.
+
+You should add the group to your metalake before you use the authorization.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ "name": "group1",
+}' http://localhost:8090/api/metalakes/test/groups
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+Group group =
+ client.addGroup("group1");
+```
+
+</TabItem>
+</Tabs>
+
+### Get a group
+
+You can get a group by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/groups/group1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+Group group =
+ client.getGroup("group1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a group
+
+You can delete a group by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/groups/group1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteGroup("group1");
+```
+
+</TabItem>
+</Tabs>
+
+## Role Operation
+
+### Create a role
+
+You can create a role by given properties.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ name: "role1",
+ properties: {"k1", "v1"}
+ securableObjects: [
+ {
+ fullName: "catalog1.schema1.table1",
+ type: "TABLE",
+ privileges: [
+ {
+ name: "SELECT_TABLE",
+ condition: "ALLOW"
+ }
+ ]
+ }
+ ]
+}' http://localhost:8090/api/metalakes/test/roles
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+
+SecurableObject securableObject =
+ SecurableObjects.ofTable(
+ SecurableObjects.ofSchema(
+ SecurableObjects.ofCatalog("catalog1", Collections.emptyList()),
+ "schema1",
+ Collections.emptyList()),
+ "table1",
+ Lists.newArrayList(Privileges.SelectTable.allow()));
+
+Role role =
+ client.createRole("role1", ImmutableMap.of("k1", "v1"), Lists.newArrayList(securableObject));
+```
+
+</TabItem>
+</Tabs>
+
+### Get a role
+
+You can get a role by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d http://localhost:8090/api/metalakes/test/roles/role1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+Role role =
+ client.getRole("role1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a role
+
+You can delete a role by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/roles/role1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteRole("role1");
+```
+
+</TabItem>
+</Tabs>
+
+## Permission Operation
+
+### Grant roles to a user
+
+You can grant specific roles to a user.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ roleNames: ["role1"]
+}'http://localhost:8090/api/metalakes/test/permissions/users/user1/grant
+
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user = client.grantRolesToUser(Lists.newList("role1"), "user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Revoke roles from a user
+
+You can revoke specific roles from a user.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ roleNames: ["role1"]
+}'http://localhost:8090/api/metalakes/test/permissions/users/user1/revoke
+
Review Comment:
OK.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716588314
##########
docs/index.md:
##########
@@ -144,11 +144,17 @@ Gravitino provides a Flink connector to manage metadata in a unified way. To use
Gravitino provides several ways to configure and manage the Gravitino server. See:
-* [Security](./security.md): provides security configurations for Gravitino, including HTTPS
- and OAuth2 configurations.
* [Gravitino metrics](./metrics.md): provides metrics configurations and detailed a metrics list
of the Gravitino server.
+### Security
+
+Gravitino provides security configurations for Gravitino, including HTTPS, authentication and access control configurations.
Review Comment:
Not only for the server. It will include the client, too. It's not accurate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#issuecomment-2290844192
LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718084190
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,641 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for securable objects, when Gravitino supports to pass the privileges to underlying authorization plugin.
+Gravitino doesn't support metadata authentication. It means that Gravitino won't check the privileges when Gravitino receives the requests.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715133701
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+
+The user won't be able to use the privilege.
Review Comment:
You shouldn't separate into two paragraphs, the sentence is broken.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718033031
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
I think you should add this to the document to clarify it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716594070
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, is spitted by comma. | | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
Review Comment:
It's a popular user system.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717885640
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
Review Comment:
You create any fileset. But if others create another fileset. You don't have write privilege, too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717853292
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718039700
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,173 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple, OAuth and Kerberos.
+If you don't enable authentication for your client and server explicitly, you will use anonymous to access the server.
+
+### Simple mode
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` in the client isn't set, the client uses the user logging in the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
+
+| Configuration item | Description | Default value | Required | Since version |
+|---------------------------------------------------|-----------------------------------------------------------------------------------------------------|-------------------|--------------------------------------------|---------------|
+| `gravitino.authenticator` | The authenticator which Gravitino uses, setting as `simple`,`oauth` or `kerberos`. | `simple` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serviceAudience` | The audience name when Gravitino uses OAuth as the authenticator. | `GravitinoServer` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.allowSkewSecs` | The JWT allows skew seconds when Gravitino uses OAuth as the authenticator. | `0` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.defaultSignKey` | The signing key of JWT when Gravitino uses OAuth as the authenticator. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.signAlgorithmType` | The signature algorithm when Gravitino uses OAuth as the authenticator. | `RS256` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serverUri` | The URI of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.tokenPath` | The path for token of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.kerberos.principal` | Indicates the Kerberos principal to be used for HTTP endpoint. Principal should start with `HTTP/`. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+| `gravitino.authenticator.kerberos.keytab` | Location of the keytab file with the credentials for the principal. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+
+The signature algorithms that Gravitino supports follows:
+
+| Name | Description |
+|-------|------------------------------------------------|
+| HS256 | HMAC using SHA-25A |
+| HS384 | HMAC using SHA-384 |
+| HS512 | HMAC using SHA-51 |
+| RS256 | RSASSA-PKCS-v1_5 using SHA-256 |
+| RS384 | RSASSA-PKCS-v1_5 using SHA-384 |
+| RS512 | RSASSA-PKCS-v1_5 using SHA-512 |
+| ES256 | ECDSA using P-256 and SHA-256 |
+| ES384 | ECDSA using P-384 and SHA-384 |
+| ES512 | ECDSA using P-521 and SHA-512 |
+| PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 |
+| PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 |
+| PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 |
+
+### Example
+
+You can follow the steps to set up an OAuth mode Gravitino server.
+
+1. Prerequisite
+
+ You need to install the JDK8 and Docker.
+
+2. Set up an external OAuth 2.0 server
+
+ There is a sample-authorization-server based on [spring-authorization-server](https://github.com/spring-projects/spring-authorization-server/tree/1.0.3).
+
+ The image has registered client information in the external OAuth 2.0 server.
+
+ Its clientId is `test`. Its secret is `test`. Its scope is `test`.
+
+```shell
+ docker run -p 8177:8177 --name sample-auth-server -d datastrato/sample-authorization-server:0.3.0
+```
+
+3. Open [the JWK URL of the Authorization server](http://localhost:8177/oauth2/jwks) in the browser and you can get the JWK.
+
+ 
+
+4. Convert the JWK to PEM. You can use the [online tool](https://8gwifi.org/jwkconvertfunctions.jsp#google_vignette) or other tools.
+
+ 
+
+5. Copy the public key and remove the character `\n` and you can get the default signing key of Gravitino server.
+
+6. You can refer to the [Configurations](gravitino-server-config.md) and append the configurations to the conf/gravitino.conf.
+
+```text
+gravitino.authenticator = oauth
Review Comment:
https://github.com/apache/gravitino/pull/4489 This pull request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718024063
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
Review Comment:
? why?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716431127
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
Review Comment:
DefaultOAuth2TokenProvider doesn't support it now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716486352
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
Review Comment:
> For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
From this word, I only get the message that `deny` is prior to `allow`. How to `the parent securable privilege will still take effect`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715170287
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denys to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denys to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, is spitted by comma. | | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
+
+You should add the user to your metalake before you use the authorization.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ "name": "user1",
+}' http://localhost:8090/api/metalakes/test/users
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.addUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Get a user
+
+You can get a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.getUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a user
+
+You can delete a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+## Group Operation
+
+
+### Add a Group
+
+The external systems like LDAP, Scim and etc manage the group.
+
+You should add the group to your metalake before you use the authorization.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ "name": "group1",
+}' http://localhost:8090/api/metalakes/test/groups
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+Group group =
+ client.addGroup("group1");
+```
+
+</TabItem>
+</Tabs>
+
+### Get a group
+
+You can get a group by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/groups/group1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+Group group =
+ client.getGroup("group1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a group
+
+You can delete a group by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/groups/group1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteGroup("group1");
+```
+
+</TabItem>
+</Tabs>
+
+## Role Operation
+
+### Create a role
+
+You can create a role by given properties.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ name: "role1",
+ properties: {"k1", "v1"}
+ securableObjects: [
+ {
+ fullName: "catalog1.schema1.table1",
+ type: "TABLE",
+ privileges: [
+ {
+ name: "SELECT_TABLE",
+ condition: "ALLOW"
+ }
+ ]
+ }
+ ]
+}' http://localhost:8090/api/metalakes/test/roles
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+
+SecurableObject securableObject =
+ SecurableObjects.ofTable(
+ SecurableObjects.ofSchema(
+ SecurableObjects.ofCatalog("catalog1", Collections.emptyList()),
+ "schema1",
+ Collections.emptyList()),
+ "table1",
+ Lists.newArrayList(Privileges.SelectTable.allow()));
+
+Role role =
+ client.createRole("role1", ImmutableMap.of("k1", "v1"), Lists.newArrayList(securableObject));
+```
+
+</TabItem>
+</Tabs>
+
+### Get a role
+
+You can get a role by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d http://localhost:8090/api/metalakes/test/roles/role1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+Role role =
+ client.getRole("role1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a role
+
+You can delete a role by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/roles/role1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteRole("role1");
+```
+
+</TabItem>
+</Tabs>
+
+## Permission Operation
+
+### Grant roles to a user
+
+You can grant specific roles to a user.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ roleNames: ["role1"]
+}'http://localhost:8090/api/metalakes/test/permissions/users/user1/grant
+
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user = client.grantRolesToUser(Lists.newList("role1"), "user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Revoke roles from a user
+
+You can revoke specific roles from a user.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ roleNames: ["role1"]
+}'http://localhost:8090/api/metalakes/test/permissions/users/user1/revoke
+
Review Comment:
Remove this empty line in here and other places.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716438870
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
Could you explain this more clearly?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718030857
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|------------------------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Whether Gravitino enable authorization or not. | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, Multiple admins are spitted by comma. | (none) | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718032841
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718029195
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
Review Comment:
What I want to express: the second sentence `Gravitino doesn't support metadata authentication.` is about authentication because the first sentence is just about `authorization`. The sentences in this passage are unnaturally connected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716812800
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718084404
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,641 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for securable objects, when Gravitino supports to pass the privileges to underlying authorization plugin.
+Gravitino doesn't support metadata authentication. It means that Gravitino won't check the privileges when Gravitino receives the requests.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717848965
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
Review Comment:
I feel every sentence is a paragraph will be more clear. It they are a paragraph. The sentence is too long.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718085757
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,641 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for securable objects, when Gravitino supports to pass the privileges to underlying authorization plugin.
+Gravitino doesn't support metadata authentication. It means that Gravitino won't check the privileges when Gravitino receives the requests.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #4496:
URL: https://github.com/apache/gravitino/pull/4496
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716798328
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
the logic is too odd
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716441009
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
I don't know to how to make it clearer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717853189
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
`authorization` means that write privileges to underlying system.
`medata authentication` means that check privileges about metadata, if has privileges to allow the operation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#issuecomment-2286083689
Can you please add a chapter about security in the `index.md`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718014114
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,173 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple, OAuth and Kerberos.
+If you don't enable authentication for your client and server explicitly, you will use anonymous to access the server.
+
+### Simple mode
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` in the client isn't set, the client uses the user logging in the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
Review Comment:
ditto
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
Review Comment:
You can view metalake as a xxxxx.
The word `understand` is not elegant.
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,173 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple, OAuth and Kerberos.
+If you don't enable authentication for your client and server explicitly, you will use anonymous to access the server.
+
+### Simple mode
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` in the client isn't set, the client uses the user logging in the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
+
+| Configuration item | Description | Default value | Required | Since version |
+|---------------------------------------------------|-----------------------------------------------------------------------------------------------------|-------------------|--------------------------------------------|---------------|
+| `gravitino.authenticator` | The authenticator which Gravitino uses, setting as `simple`,`oauth` or `kerberos`. | `simple` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serviceAudience` | The audience name when Gravitino uses OAuth as the authenticator. | `GravitinoServer` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.allowSkewSecs` | The JWT allows skew seconds when Gravitino uses OAuth as the authenticator. | `0` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.defaultSignKey` | The signing key of JWT when Gravitino uses OAuth as the authenticator. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.signAlgorithmType` | The signature algorithm when Gravitino uses OAuth as the authenticator. | `RS256` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serverUri` | The URI of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.tokenPath` | The path for token of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.kerberos.principal` | Indicates the Kerberos principal to be used for HTTP endpoint. Principal should start with `HTTP/`. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+| `gravitino.authenticator.kerberos.keytab` | Location of the keytab file with the credentials for the principal. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+
+The signature algorithms that Gravitino supports follows:
+
+| Name | Description |
+|-------|------------------------------------------------|
+| HS256 | HMAC using SHA-25A |
+| HS384 | HMAC using SHA-384 |
+| HS512 | HMAC using SHA-51 |
+| RS256 | RSASSA-PKCS-v1_5 using SHA-256 |
+| RS384 | RSASSA-PKCS-v1_5 using SHA-384 |
+| RS512 | RSASSA-PKCS-v1_5 using SHA-512 |
+| ES256 | ECDSA using P-256 and SHA-256 |
+| ES384 | ECDSA using P-384 and SHA-384 |
+| ES512 | ECDSA using P-521 and SHA-512 |
+| PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 |
+| PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 |
+| PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 |
+
+### Example
+
+You can follow the steps to set up an OAuth mode Gravitino server.
+
+1. Prerequisite
+
+ You need to install the JDK8 and Docker.
+
+2. Set up an external OAuth 2.0 server
+
+ There is a sample-authorization-server based on [spring-authorization-server](https://github.com/spring-projects/spring-authorization-server/tree/1.0.3).
+
+ The image has registered client information in the external OAuth 2.0 server.
+
+ Its clientId is `test`. Its secret is `test`. Its scope is `test`.
+
+```shell
+ docker run -p 8177:8177 --name sample-auth-server -d datastrato/sample-authorization-server:0.3.0
+```
+
+3. Open [the JWK URL of the Authorization server](http://localhost:8177/oauth2/jwks) in the browser and you can get the JWK.
+
+ 
+
+4. Convert the JWK to PEM. You can use the [online tool](https://8gwifi.org/jwkconvertfunctions.jsp#google_vignette) or other tools.
+
+ 
+
+5. Copy the public key and remove the character `\n` and you can get the default signing key of Gravitino server.
+
+6. You can refer to the [Configurations](gravitino-server-config.md) and append the configurations to the conf/gravitino.conf.
+
+```text
+gravitino.authenticator = oauth
Review Comment:
I remember this key has been replaced with `gravitino.authenticators`, Am I correct?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
Review Comment:
catalog, too -> catalog too.
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,173 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple, OAuth and Kerberos.
+If you don't enable authentication for your client and server explicitly, you will use anonymous to access the server.
+
+### Simple mode
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` in the client isn't set, the client uses the user logging in the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
Review Comment:
ditto
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
Review Comment:
Should we support setting a custom user name?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718027037
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|------------------------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Whether Gravitino enable authorization or not. | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, Multiple admins are spitted by comma. | (none) | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
Review Comment:
what's the relationship of add user and external systems?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718025607
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715469738
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
Review Comment:
Added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716797505
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
What is `metadata authentication` ? and As I know Gravitino doesn't support authorization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718006128
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
Review Comment:
then, please add the table(fileset, topic) to the doc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716424730
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
I'm confused about this, if user doesn't set authentication, it will be simple mode, the user is `anonymous` or from `GRAVITINO_USER` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716441009
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
I don't know to how to make it clearer. Do you have some suggestion?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716601760
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
Review Comment:
I can remove this sentence.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716604825
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
Review Comment:
They will get the privileges.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "qqqttt123 (via GitHub)" <gi...@apache.org>.
qqqttt123 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716418195
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,663 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denys to use the catalog, the user isn't able to use the catalog.
Review Comment:
Fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#issuecomment-2286464332
> Can you please add a chapter about security in the `index.md`.
I updated the index.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716432568
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
Review Comment:
Iceberg REST server doesn't have delicated configuration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716465225
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
Review Comment:
What's `GroupMappingService`?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
Review Comment:
So the table, topic and fileset will not automatically get the privileges?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
Review Comment:
Can you provide an example of metalake metadata objects?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
"doesn't support metadata authentication"
Why do we mention `authentication` in the access control chapter?
Furthermore, I believe you need to add more words to make the sentence more natural. for example
```
Gravitino only supports authorization for secureable objects, when it comes to authentication. Gravitino doesn't support metadata authentication.
```
##########
docs/index.md:
##########
@@ -144,11 +144,17 @@ Gravitino provides a Flink connector to manage metadata in a unified way. To use
Gravitino provides several ways to configure and manage the Gravitino server. See:
-* [Security](./security.md): provides security configurations for Gravitino, including HTTPS
- and OAuth2 configurations.
* [Gravitino metrics](./metrics.md): provides metrics configurations and detailed a metrics list
of the Gravitino server.
+### Security
+
+Gravitino provides security configurations for Gravitino, including HTTPS, authentication and access control configurations.
Review Comment:
for Gravitino server.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
Review Comment:
Please format the markdown file here. I don't think it will look very well.
<img width="987" alt="image" src="https://github.com/user-attachments/assets/1d12d2be-2ea9-4b36-9303-e58dd0ce870b">
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
Review Comment:
What's the difference between `CreateFileset` and `WriteFileset`?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
Review Comment:
I can't get what the picture means, could you add some description in the picture?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
Review Comment:
`Enable the authorization` -> Whether Gravtino enable authorization or not
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
Review Comment:
`GRAVITINO_USER` in the client-server....
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
Review Comment:
Space before `OAuth`
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
if users do not set the authentication explicitly, they will use the simple mode to access the Gravitino server and the corresponding user name is `anonymous`.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
Review Comment:
> For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
From this word, I only get the message that `deny` is prior to `allow`. How to improve `the parent securable privilege will still take effect`?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, is spitted by comma. | | Yes if enables the authorization | 0.5.0 |
Review Comment:
The default value is missing. moreover, you'd better to standardize the sentence. the sentence `is splited by comma` has not subject.
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
Review Comment:
What is the meaning of `user of the machine`? Is the user currently logged into the client machine?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, is spitted by comma. | | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
Review Comment:
What is `Scim`?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
Review Comment:
Besides, please refine the picture like
```
Role Table1 reviewer -> Role: Table1 reviewer
Role Fileset 3 scientist -> Role: Fileset3 scientist.
```
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
Review Comment:
I think you may need to add the following contents: Securable objects consist of metadata object and a set of privileges for the securable objects.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716589797
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
Review Comment:
What's your suggestion?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716780379
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
Review Comment:
Can you put them into paragraphs, currently each sentence is a paragraph.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718007928
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
Review Comment:
Table won't have any child securable object.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718023688
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,173 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple, OAuth and Kerberos.
+If you don't enable authentication for your client and server explicitly, you will use anonymous to access the server.
+
+### Simple mode
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` in the client isn't set, the client uses the user logging in the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
+
+| Configuration item | Description | Default value | Required | Since version |
+|---------------------------------------------------|-----------------------------------------------------------------------------------------------------|-------------------|--------------------------------------------|---------------|
+| `gravitino.authenticator` | The authenticator which Gravitino uses, setting as `simple`,`oauth` or `kerberos`. | `simple` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serviceAudience` | The audience name when Gravitino uses OAuth as the authenticator. | `GravitinoServer` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.allowSkewSecs` | The JWT allows skew seconds when Gravitino uses OAuth as the authenticator. | `0` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.defaultSignKey` | The signing key of JWT when Gravitino uses OAuth as the authenticator. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.signAlgorithmType` | The signature algorithm when Gravitino uses OAuth as the authenticator. | `RS256` | No | 0.3.0 |
+| `gravitino.authenticator.oauth.serverUri` | The URI of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.oauth.tokenPath` | The path for token of the default OAuth server. | (none) | Yes if use `oauth` as the authenticator | 0.3.0 |
+| `gravitino.authenticator.kerberos.principal` | Indicates the Kerberos principal to be used for HTTP endpoint. Principal should start with `HTTP/`. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+| `gravitino.authenticator.kerberos.keytab` | Location of the keytab file with the credentials for the principal. | (none) | Yes if use `kerberos` as the authenticator | 0.4.0 |
+
+The signature algorithms that Gravitino supports follows:
+
+| Name | Description |
+|-------|------------------------------------------------|
+| HS256 | HMAC using SHA-25A |
+| HS384 | HMAC using SHA-384 |
+| HS512 | HMAC using SHA-51 |
+| RS256 | RSASSA-PKCS-v1_5 using SHA-256 |
+| RS384 | RSASSA-PKCS-v1_5 using SHA-384 |
+| RS512 | RSASSA-PKCS-v1_5 using SHA-512 |
+| ES256 | ECDSA using P-256 and SHA-256 |
+| ES384 | ECDSA using P-384 and SHA-384 |
+| ES512 | ECDSA using P-521 and SHA-512 |
+| PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 |
+| PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 |
+| PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 |
+
+### Example
+
+You can follow the steps to set up an OAuth mode Gravitino server.
+
+1. Prerequisite
+
+ You need to install the JDK8 and Docker.
+
+2. Set up an external OAuth 2.0 server
+
+ There is a sample-authorization-server based on [spring-authorization-server](https://github.com/spring-projects/spring-authorization-server/tree/1.0.3).
+
+ The image has registered client information in the external OAuth 2.0 server.
+
+ Its clientId is `test`. Its secret is `test`. Its scope is `test`.
+
+```shell
+ docker run -p 8177:8177 --name sample-auth-server -d datastrato/sample-authorization-server:0.3.0
+```
+
+3. Open [the JWK URL of the Authorization server](http://localhost:8177/oauth2/jwks) in the browser and you can get the JWK.
+
+ 
+
+4. Convert the JWK to PEM. You can use the [online tool](https://8gwifi.org/jwkconvertfunctions.jsp#google_vignette) or other tools.
+
+ 
+
+5. Copy the public key and remove the character `\n` and you can get the default signing key of Gravitino server.
+
+6. You can refer to the [Configurations](gravitino-server-config.md) and append the configurations to the conf/gravitino.conf.
+
+```text
+gravitino.authenticator = oauth
Review Comment:
We don't merge this document.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718024445
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
Review Comment:
I can remove this sentence.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718033661
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
Review Comment:
Sure, Hadoop has the similar behaviour.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718077914
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,641 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for securable objects, when Gravitino supports to pass the privileges to underlying authorization plugin.
+Gravitino doesn't support metadata authentication. It means that Gravitino won't check the privileges when Gravitino receives the requests.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
Review Comment:
Excessive empty space before `External`.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,641 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for securable objects, when Gravitino supports to pass the privileges to underlying authorization plugin.
+Gravitino doesn't support metadata authentication. It means that Gravitino won't check the privileges when Gravitino receives the requests.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
Review Comment:
a `METALAKE` object.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,641 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for securable objects, when Gravitino supports to pass the privileges to underlying authorization plugin.
+Gravitino doesn't support metadata authentication. It means that Gravitino won't check the privileges when Gravitino receives the requests.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
Review Comment:
Please optimize these three sentences that start with `The owner`. It's too tedious to have the same starting points.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718022850
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718022645
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718029854
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
yes, but you said the default authentication is `simple` in which the user is not `anonymous`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717863468
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
Review Comment:
Done.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|-------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Enable the authorization | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, is spitted by comma. | | Yes if enables the authorization | 0.5.0 |
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717889151
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
Review Comment:
You can see the above sentence.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718007928
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
Review Comment:
Table won't any child securable object.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718039224
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
Review Comment:
Added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716429782
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
Review Comment:
Could the user provide a dynamic token, not a credential?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716431579
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
anonymous
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718035267
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
If request don't have credential, simple mode think it's anonymous.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718015028
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
Review Comment:
"relationship"
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
Review Comment:
What's the meaning of "when it comes to authentication", this sentence is hard to understand.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
Review Comment:
Remove this one blank line here.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
Review Comment:
Remove one blank line.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
Review Comment:
What is the meaning of "You can understand"?
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|------------------------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Whether Gravitino enable authorization or not. | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, Multiple admins are spitted by comma. | (none) | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
+You should add the user to your metalake before you use the authorization.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ "name": "user1",
+}' http://localhost:8090/api/metalakes/test/users
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.addUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Get a user
+
+You can get a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.getUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a user
+
+You can delete a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+## Group Operation
+
Review Comment:
Remove this one blank line here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718023931
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
Review Comment:
Iceberg REST server configuration has the prefix `gravitino.iceberg-rest.`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718023285
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
+Gravitino doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE". `METALAKE` object has a name "metalake1".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+Every securable object resides within a logical container in a hierarchy of containers.
+The top container is the metalake. You can understand that metalake a customer organization.
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+Schemas are under the catalog. There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+The owner have all the privileges of the metadata object.
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+`deny` means that you aren't able to use the privilege.
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the securable object won't override the parent object privilege.
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
+If securable metalake object denies to use the catalog, but securable catalog allows to use the catalog, the user isn't able to use the catalog, too.
+
+
+
+## Server Configuration
+
+If you want to enable the access control, you should enable the authorization.
+
+The related configuration is as follows.
+
+| Configuration item | Description | Default value | Required | Since Version |
+|------------------------------------------|------------------------------------------------------------------------|---------------|----------------------------------|---------------|
+| `gravitino.authorization.enable` | Whether Gravitino enable authorization or not. | false | No | 0.5.0 |
+| `gravitino.authorization.serviceAdmins` | The admins of Gravitino service, Multiple admins are spitted by comma. | (none) | Yes if enables the authorization | 0.5.0 |
+
+
+## User Operation
+
+### Add a user
+
+The external systems like LDAP, Scim and etc manage the user.
+You should add the user to your metalake before you use the authorization.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+ "name": "user1",
+}' http://localhost:8090/api/metalakes/test/users
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.addUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Get a user
+
+You can get a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+User user =
+ client.getUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+### Delete a user
+
+You can delete a user by its name.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" http://localhost:8090/api/metalakes/test/users/user1
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient client = ...
+boolean deleted =
+ client.deleteUser("user1");
+```
+
+</TabItem>
+</Tabs>
+
+## Group Operation
+
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1718022019
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,646 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization for secureable objects, when it comes to authentication.
Review Comment:
cc @yuqi1129
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717848209
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
Review Comment:
Many systems have similar logic. If user doesn't enable authentication, the user uses `anonymous`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717853378
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
Review Comment:
I merged them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717853716
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
Review Comment:
Corrected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717853467
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717868840
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
Review Comment:
> What's `GroupMappingService`?
I will changed it to external user system.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717872379
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1717887580
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,659 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denies to use the catalog, the user isn't able to use the catalog.
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715446536
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
Review Comment:
OK, I remove this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715128087
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
Review Comment:
I think you don't have to mention the supported catalogs here, we will add more catalogs, so it needs to be updated continuously. Removing this sentence, so we don't have to update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1715129500
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,671 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Gravitino supports Hive, Iceberg, MySQL, PostgreSQL, Hadoop, and Kafka catalogs.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
Review Comment:
I suggest you write an image about the hierarchical structure of metadata objects here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716412694
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,663 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
Review Comment:
This one-line sentence will break into two lines according to your current way of writing markdown.
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,663 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
+
+## Privilege Condition
+
+The privilege supports two condition: `allow` and `deny`. `allow` means that you are able to use the privilege,
+
+`deny` means that you aren't able to use the privilege.
+
+`deny` condition is prior to `allow` condition. If a role has the `allow` condition and `deny` condition at the same time.
+The user won't be able to use the privilege.
+
+If parent securable object has the same privilege name with different condition, the parent securable privilege will still take effect.
+
+For example, securable metalake object allows to use the catalog, but securable catalog denys to use the catalog, the user isn't able to use the catalog.
Review Comment:
denies.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "qqqttt123 (via GitHub)" <gi...@apache.org>.
qqqttt123 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716421377
##########
docs/security/access-control.md:
##########
@@ -0,0 +1,663 @@
+---
+title: "Access Control"
+slug: /security/access-control
+keyword: security
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+Gravitino adopts RBAC and DAC.
+
+Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users or groups.
+
+Discretionary Access Control(DAC): Each metadata object has an owner, who can in turn grant access to that object.
+
+:::info
+
+Gravitino only supports authorization and doesn't support metadata authentication.
+
+:::
+
+
+## Concept
+
+### Role
+
+A metadata object to which privileges can be granted. Roles are in turn assigned to users or groups.
+
+### Privilege
+
+A defined level of access to an object. Multiple distinct privileges may be used to control the granularity of access granted.
+
+### User
+
+A user identity recognized by Gravitino. External user system instead of Gravitino manages users.
+
+### Group
+
+A group identity recognized by Gravitino. External user system instead of Gravitino manages groups.
+
+### Metadata objects
+
+Metadata objects are managed in Gravitino, such as `CATALOG`, `SCHEMA`, `TABLE`,
+`COLUMN`, `FILESET`, `TOPIC`, `COLUMN`, `ROLE`, `METALAKE`. A metadata object is combined by a `type` and a
+comma-separated `name`. For example, a `CATAGLOG` object has a name "catalog1" with type
+"CATALOG", a `SCHEMA` object has a name "catalog1.schema1" with type "SCHEMA", a `TABLE`
+object has a name "catalog1.schema1.table1" with type "TABLE".
+
+### Securable objects
+
+A metadata object to which access can be granted. Unless allowed by a grant, access is denied.
+
+Every securable object resides within a logical container in a hierarchy of containers.
+
+The top container is the metalake. You can understand that metalake a customer organization.
+
+Catalogs are under the metalake. Catalogs represent different kinds of data sources.
+
+Schemas are under the catalog.
+
+There are tables, topics, or filesets under the schema.
+
+
+
+The relationship of the concepts is as below.
+
+
+
+
+### Ownership
+
+Every metadata object has an owner. The owner could be a user or group.
+
+The owner have all the privileges of the metadata object.
+
+The owner could be transferred to another user or group.
+
+## The types of roles
+
+### Service Admin
+
+Service admin is only used for managing the metalakes. Usually, this role is for the maintainer of the service.
+
+### Custom Roles
+
+You can also create a dedicated role for your business by API or the client.
+
+## The types of privileges
+
+### User privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|---------------------------|---------------------|
+| ManageUsers | Metalake | Add or remove users |
+
+
+### Group privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|----------------------|
+| ManageGroups | Metalake | Add or remove groups |
+
+### Role privileges
+
+| Name | Supports Securable Object | Operation |
+|------------|---------------------------|---------------|
+| CreateRole | Metalake | Create a role |
+
+### Permission privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|------------------------|
+| ManageGrants | Metalake | grant or revoke a role |
+
+### Catalog privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|---------------------------|------------------|
+| CreateCatalog | Metalake | Create a catalog |
+| UseCatalog | Metalake, Catalog | |
+
+:::info
+
+`USE_CATALOG` is needed for a user to interact with any object within the catalog.
+
+For example, to select data from a table, users need to have the SELECT_TABLE privilege on that table and
+
+`USE CATALOG` privileges on its parent catalog as well as `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+
+### Schema privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|---------------------------|-----------------|
+| CreateSchema | Metalake, Catalog | Create a schema |
+| UseSchema | Metalake, Catalog, Schema | Use a schema |
+
+:::info
+
+`UseSchema`is needed for a user to interact with any object within the schema.
+
+For example, to select data from a table, users need to have the `SELECT_TABLE` privilege on that table
+
+and `USE SCHEMA` privileges on its parent schema.
+
+:::
+
+### Table privileges
+
+| Name | Supports Securable Object | Operation |
+|-------------|-----------------------------------|------------------------------------------------|
+| CreateTable | Metalake, Catalog, Schema | Create a table |
+| ModifyTable | Metalake, Catalog, Schema, Table | Use the SQL `UPDATE`,`DELETE`,`INSERT` a table |
+| SelectTable | Metalake, Catalog, Schema, Table | Use the SQL `SELECT` data from a table |
+
+### Topic privileges
+
+| Name | Supports Securable Object | Operation |
+|--------------|----------------------------------|-------------------------------------------|
+| CreateTopic | Metalake, Catalog, Schema | Create a topic |
+| ProduceTopic | Metalake, Catalog, Schema, Topic | Produce a topic (including alter a topic) |
+| ConsumeTopic | Metalake, Catalog, Schema, Topic | Consume a topic |
+
+### Fileset privileges
+
+| Name | Supports Securable Object | Operation |
+|---------------|------------------------------------|---------------------------------------------|
+| CreateFileset | Metalake, Catalog, Schema | Create a fileset |
+| WriteFileset | Metalake, Catalog, Schema, Fileset | Write a fileset (including alter a fileset) |
+| ReadFileset | Metalake, Catalog, Schema, Fileset | read a fileset |
+
+## Inheritance Model
+
+Securable objects in Gravitino are hierarchical and privileges are inherited downward.
+
+This means that granting a privilege on a metalake, catalog or schema automatically grants
+
+the privilege to all current and future objects within the metalake, catalog or schema.
+
+For example, if you give a use that `SELECT_TABLE` privilege on a catalog, then that the user
+
+will be able to select(read) all tables in that catalog.
Review Comment:
OK, I checked other places, too. Fix them by the way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4467] docs: Refactor the security document and add access control page [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #4496:
URL: https://github.com/apache/gravitino/pull/4496#discussion_r1716422457
##########
docs/security/how-to-authenticate.md:
##########
@@ -0,0 +1,176 @@
+---
+title: "How to authenticate"
+slug: /security/how-to-authenticate
+keyword: security authentication oauth kerberos
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Authentication
+
+Apache Gravitino supports three kinds of authentication mechanisms: simple,OAuth and Kerberos.
+
+### Simple mode
+
+Simple mode is the default authentication option of the server.
+
+For the client side, if it doesn't set the authentication explicitly, it will use anonymous to access the server.
+
+If the client sets the simple mode, it will use the environment variable `GRAVITINO_USER` as the user.
+
+If the environment variable `GRAVITINO_USER` isn't set, the client uses the user of the machine that sends requests.
+
+For the client side, users can enable `simple` mode by the following code:
+
+```java
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withSimpleAuth()
+ .build();
+```
+
+### OAuth mode
+
+Gravitino only supports external OAuth 2.0 servers.
+
+First, users need to guarantee that the external correctly configured OAuth 2.0 server supports Bearer JWT.
+
+Then, on the server side, users should set `gravitino.authenticator` as `oauth` and give
+`gravitino.authenticator.oauth.defaultSignKey`, `gravitino.authenticator.oauth.serverUri` and
+`gravitino.authenticator.oauth.tokenPath` a proper value.
+
+Next, for the client side, users can enable `OAuth` mode by the following code:
+
+```java
+DefaultOAuth2TokenProvider authDataProvider = DefaultOAuth2TokenProvider.builder()
+ .withUri("oauth server uri")
+ .withCredential("yy:xx")
+ .withPath("oauth/token")
+ .withScope("test")
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withOAuth(authDataProvider)
+ .build();
+```
+
+### Kerberos mode
+
+Gravitino supports Kerberos mode.
+
+For the server side, users should set `gravitino.authenticator` as `kerberos` and give
+`gravitino.authenticator.kerberos.principal` and `gravitino.authenticator.kerberos.keytab` a proper value.
+
+For the client side, users can enable `kerberos` mode by the following code:
+
+```java
+// Use keytab to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .withKeyTabFile(new File(keytabFile))
+ .build();
+
+// Use ticketCache to create KerberosTokenProvider
+KerberosTokenProvider provider = KerberosTokenProvider.builder()
+ .withClientPrincipal(clientPrincipal)
+ .build();
+
+GravitinoClient client = GravitinoClient.builder(uri)
+ .withMetalake("metalake")
+ .withKerberosAuth(provider)
+ .build();
+```
+
+:::info
+Now Iceberg REST service doesn't support Kerberos authentication.
+The URI must use the hostname of server instead of IP.
+:::
+
+### Server configuration
Review Comment:
missing Iceberg REST server configuration?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org