dez*_*zso 5 sql-server permissions active-directory azure-synapse-analytics dedicated-sql-pool
在 Azure Synapse 专用 SQL 池中,我有以下设置:
-- a custom DB role to manage privileges
CREATE ROLE [owner];
-- there is a schema owned by this role
CREATE SCHEMA [myschema] AUTHORIZATION [owner];
-- an Azure AD group to allow its members to log in
CREATE USER [radish] FROM EXTERNAL PROVIDER;
-- the AAD group is a member of the owner role
EXEC sp_addrolemember 'owner', 'radish';
-- privileges are assigned exclusively through custom DB roles
GRANT ALTER, CONTROL on SCHEMA::[myschema] TO [owner];
Run Code Online (Sandbox Code Playgroud)
如果我作为 AAD 组的成员登录radish
,则无法在以下位置创建表myschema
:
CREATE TABLE [myschema].[test] (id int);
Msg 6004, Level 14, State 9, Line 1
User does not have permission to perform this action.
Run Code Online (Sandbox Code Playgroud)
一旦我获得 Synapse 管理员角色,这就可以了。(当成员时,SESSION_USER
是dbo
。)这并不奇怪,因为该角色基本上可以执行给定工作区的 SQL 池内的所有操作。
但是,当我从 Synapse 管理员角色中删除自己时,会发生以下情况:
DROP TABLE [myschema].[test];
-- completes successfully, but then:
CREATE TABLE [myschema].[test] (id int);
Msg 6004, Level 14, State 9, Line 1
User does not have permission to perform this action.
Run Code Online (Sandbox Code Playgroud)
也许我对必要特权如何CREATE TABLE
相互DROP TABLE
关联的理解是完全错误的,但直到现在我认为两者所需的特权是相同的。有人可以告诉我我的想法错在哪里吗?
到目前为止,我看到以下可能性:
owner
角色不适用于仅间接成为其成员的用户(即通过 AAD 组的成员身份) - 这似乎与https://learn.microsoft.com/en-us/azure/synapse-analytics/security相矛盾/如何设置访问控制#step-8-将用户添加到安全组sp_tables
报告owner
为table_owner
.另外,有趣的是,我可以成功执行GRANT ALTER, CONTROL on SCHEMA::[myschema] TO [owner];
,但创建表失败。
归档时间: |
|
查看次数: |
786 次 |
最近记录: |