[Bug] [AUTHZ]ALTER operation to change the table name don't require any permission
- Dominant language
- Scala
- Stars
- 2.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [x] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
### Describe the bug
Describe the bug
I'm using Iceberg table version 1.9.0 and try to rename table using `ALTER TABLE t1 rename to t2`
In my current situation, despite having revoked all my permissions, I am still able to change my table name using the `ALTER TABLE RENAME` command. Furthermore, I can even move a table from one schema to another using a command like `ALTER TABLE schema_a.my_table RENAME TO schema_bb.my_table` without any apparent permissions.
I try to another ALTER TABLE command, for example `ALTER TABLE ADD COLUMNS` and it deny my command as our expectation.
**However, the `ALTER TABLE RENAME` command appears to run regardless of whether the user has the ALTER permission or not. I believe this constitutes a critical security or data governance issue.**
What happens here?
### Affects Version(s)
master
### Expectation
**Ranger check support iceberg all operation permission check**
----
## Task list
Spark 3 Reference: https://iceberg.apache.org/docs/1.9.0/spark-getting-started/
- DDL: https://iceberg.apache.org/docs/1.9.0/spark-ddl/
- Queries: https://iceberg.apache.org/docs/1.9.0/spark-queries/
- Procedures: https://iceberg.apache.org/docs/1.9.0/spark-procedures/
- Write: https://iceberg.apache.org/docs/1.9.0/spark-writes/#writing-with-sql
### DDL
- [ ] **[Create Table](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#create-table):**
- [ ] Create Table Partitioned By
- [ ] **[Create Table As Select](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#create-table-as-select):**
- [ ] **[Replace Table As Select](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#replace-table-as-select):**
- [ ] **[Drop table](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#drop-table):**
- [ ] Drop table
- [ ] Drop table purge
- [x] **[Alter table](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#alter-table):** https://github.com/apache/kyuubi/issues/7099
- [x] Alter Table Rename To
- [x] Alter Table Set Properties
- [x] Alter Table Unset Properties
- [x] Alter Table Add Column
- [x] Alter Table Rename Column
- [x] Alter Table Alter Column
- [x] Alter Table Drop Column
- [x] **[Alter Table SQL Extensions](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#alter-table-sql-extensions): #7066**
- [x] Alter Table Add Partition Field
- [x] Alter Table Drop Partition Field
- [x] Alter Table Replace Partition Field
- [x] Alter Table Write Ordered By
- [x] Alter Table Write Distributed By Partition
- [x] Alter Table Set Identifier Fields
- [x] Alter Table Drop Identifier Fields
- [x] **[Branching and Tagging DDL](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#branching-and-tagging-ddl): #7068**
- [x] Alter Table Create Branch
- [x] Alter Table Create Tag
- [x] Alter Table Replace Branch
- [x] Alter Table Replace Tag
- [x] Alter Table Drop Branch
- [x] Alter Table Drop Tag
- [x] **[View](https://iceberg.apache.org/docs/1.9.0/spark-ddl/#iceberg-views-in-spark): #7136**
- [x] Creating view
- [x] Creating view with properties
- [x] Dropping view
- [x] Replacing view
- [x] Setting and removing view properties
- [x] Showing views
- [x] Showing the CREATE statement of view
- [x] Displaying view details
### Writing with SQL:
- [ ] **[Write to table](https://iceberg.apache.org/docs/1.9.0/spark-writes/#writing-with-sql):**
- [ ] Inserting into table
- [ ] Inserting overwrite table
- [x] Updating table
- [x] Deleting from table
- [x] Merging into table
- [ ] **[Write to branch](https://iceberg.apache.org/docs/1.9.0/spark-writes/#writing-to-branches):**
### Procedures:
- [x] **[Snapshot Management](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#snapshot-management): #7136**
- [x] Rolling back to snapshot
- [x] Rolling back to timestamp
- [x] Setting current snapshot
- [x] Cherry picking snapshot
- [x] Publish change
- [x] Fast forward
- [x] **[Metadata Management](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#metadata-management): #7136**
- [x] Expiring snapshot
- [x] Removing orphan files
- [x] Rewriting data files
- [x] Rewriting manifests
- [x] Rewriting position delete files
- [x] **[Migration](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#table-migration): #7136**
- [x] Snapshotting
- [x] Migrating
- [x] Adding files
- [x] Registering table
- [x] **[Metadata information](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#metadata-information): #7136**
- [x] Ancestors of
- [x] **[Change Data Capture](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#change-data-capture): #7136**
- [x] Creating change log view
- [x] **[Table Statistics](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#table-statistics): #7136**
- [x] Compute table stats
- [x] **[Table Replication](https://iceberg.apache.org/docs/1.9.0/spark-procedures/#table-replication): #7136**
- [x] Rewrite table stats
### Queries
- [ ] **[Select table](https://iceberg.apache.org/docs/1.9.0/spark-queries/#querying-with-sql)**
- [ ] Select view
- [ ] **[Time traveling](https://iceberg.apache.org/docs/1.9.0/spark-queries/#time-travel)**
- [ ] **[Inspecting table](https://iceberg.apache.org/docs/1.9.0/spark-queries/#inspecting-tables):**
## Are you willing to submit PR?
- [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
- [x] No. I cannot submit a PR at this time.
Contributor guide
Research direction
Start by reproducing ALTER TABLE RENAME with Iceberg 1.9.0 and compare it with ALTER TABLE ADD COLUMNS, using the Spark 3 DDL and Kyuubi Ranger authorization context described in the issue. Trace how rename operations handle ALTER permission, including moves between schemas. Done means unauthorized renames are rejected consistently and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, spark, sql
- Domain
- authorization, backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100