限制用户在 athena 上执行 INSERT 查询
Restrict user from executing INSERT queries on athena
我想限制用户在 athena 的 master table(不是 CTAS table)中执行 INSERT 查询。
如果有办法,我能做到这一点吗?
用户将执行来自 Lambda 的查询。
Athena 仅支持 StartQueryExecution
和 StopQueryExecution
作为 IAM permission policies 中的操作 - 因此没有区别正在执行哪种类型的 SQL 命令(DDL、DML) .
但是,我认为您可以通过拒绝对 glue
和 S3
的权限来解决这个问题,这样尝试执行 INSERT 的 Athena 查询将失败:
- glue 权限可以在目录、数据库和 table 级别进行管理,一些示例可以在 AWS 中找到 Identity-Based Policies (IAM Policies) for Access Control for Glue
- 要拒绝的相关粘合操作:
BatchCreatePartition
、CreatePartition
、UpdatePartition
- 请参阅 AWS Glue 的操作、资源和条件键
- 在
S3
上,您需要拒绝 PutObject
或 Put*
以获取特定 table 的 S3 位置,请参阅 Actions defined by Amazon S3 - 同样可以在存储桶中的对象级别上定义。
我想限制用户在 athena 的 master table(不是 CTAS table)中执行 INSERT 查询。 如果有办法,我能做到这一点吗? 用户将执行来自 Lambda 的查询。
Athena 仅支持 StartQueryExecution
和 StopQueryExecution
作为 IAM permission policies 中的操作 - 因此没有区别正在执行哪种类型的 SQL 命令(DDL、DML) .
但是,我认为您可以通过拒绝对 glue
和 S3
的权限来解决这个问题,这样尝试执行 INSERT 的 Athena 查询将失败:
- glue 权限可以在目录、数据库和 table 级别进行管理,一些示例可以在 AWS 中找到 Identity-Based Policies (IAM Policies) for Access Control for Glue
- 要拒绝的相关粘合操作:
BatchCreatePartition
、CreatePartition
、UpdatePartition
- 请参阅 AWS Glue 的操作、资源和条件键 - 在
S3
上,您需要拒绝PutObject
或Put*
以获取特定 table 的 S3 位置,请参阅 Actions defined by Amazon S3 - 同样可以在存储桶中的对象级别上定义。