Azure kusto集群表通过数据列实现行级安全性,基于哪些数据列可以跨多个表进行过滤?

标签 azure azure-data-explorer row-level-security

我正在尝试在 Azure Kusto 集群表中实现行级安全性,但我看到的所有示例都仅适用于单个表数据。在我的例子中,要应用过滤器,我需要连接两个表。例如我有表 X 和 Y,我需要在表 X 上应用行级安全性,但表 X 中没有可以帮助我应用过滤器的列,该列/数据位于表 Y 中。 那么,这种情况在 ADX 中可能吗?

最佳答案

是的,支持。
这是一个快速演示

.set-or-replace MyEventsTable <|
range EventID from 1 to 10 step 1
| extend EventTimestamp = ago(365d*rand())
| extend UserID = tolong(rand(3))
<小时/>
MyEventsTable
<表类=“s-表”> <标题> 事件ID 事件时间戳 用户ID <正文> 1 2021-06-29T12:52:38.8227264Z 2 9 2021-09-11T12:53:42.8539446Z 0 8 2021-10-09T05:29:14.3731005Z 2 4 2021-11-09T09:59:12.1653628Z 0 7 2021-11-15T08:10:06.9281365Z 1 6 2022-01-02T09:46:46.9731912Z 1 2 2022-03-09T07:44:31.2875361Z 0 10 2022-03-14T01:10:23.1950573Z 0 3 2022-04-28T08:03:51.4099464Z 0 5 2022-05-04T05:08:15.941019Z 2
.set-or-replace MyUsersTable <|
print UserEmail = pack_array("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="75011c1635181c16071a061a13015b161a18" rel="noreferrer noopener nofollow">[email protected]</a>", "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7501141635181c16071a061a13015b161a18" rel="noreferrer noopener nofollow">[email protected]</a>", current_principal_details().UserPrincipalName)
| mv-expand with_itemindex=UserID UserEmail to typeof(string)
| project-reorder UserID
<小时/>
MyUsersTable
<表类=“s-表”> <标题> 用户ID 用户电子邮件 <正文> 0 [email protected] 1 [email protected] 2 {手动编辑}@microsoft.com
.create-or-alter function MyEventsTable_RLS(){
    MyEventsTable
    | where UserID == toscalar(MyUsersTable | where UserEmail == current_principal_details().UserPrincipalName | project UserID)
}
<小时/>
.alter table MyEventsTable policy row_level_security enable "MyEventsTable_RLS"
<小时/>
MyEventsTable
<表类=“s-表”> <标题> 事件ID 事件时间戳 用户ID <正文> 1 2021-06-29T12:52:38.8227264Z 2 8 2021-10-09T05:29:14.3731005Z 2 5 2022-05-04T05:08:15.941019Z 2

关于Azure kusto集群表通过数据列实现行级安全性,基于哪些数据列可以跨多个表进行过滤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72309127/

相关文章:

powershell - 具有大型包的 Set-AzureVMDscExtension 会导致 PowerShell DSC 扩展中的内存使用量极大

postgresql - 如何在 Postgresql 中优化行级安全性

postgresql - 使用行级安全设置进行选择

azure - 如何列出通过链接的 ARM 模板部署的存储帐户上的 key ?

c# - Azure Functions无法将队列绑定(bind)到CloudQueue类型

azure - 从 Azure Blob 存储剪切视频

azure - 库斯托 : make-series stops with first day - doesnt work as expected

Azure Sentinel 基于来自 KQL 的 5 分钟数据间隔发出警报

Azure 数据资源管理器 oneclick 从 blob 容器提取 (UI)

c# - Entity Framework - 使用 IDbConnectionInterceptor 设置 session_context