- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在尝试监视我们的订阅示例中发生的任何 RBAC 更改:John.Doe 将 Sue.Jones 添加为资源组 rg-test 的读者。有没有什么可以实现我正在尝试使用 powershell/cli/rest.从我的尝试和研究来看,事实并非如此。
查看事件日志,对于 Write RoleAssignments 操作,摘要包含我需要的所有输出,但使用 powershell/cli 时,您无法获取分配了什么角色或分配给谁。在摘要中,您得到:
操作名称
编写角色分配
时间戳
周三(东部夏令时间)
事件发起者:John.Doe
与“Sue.Jones”共享消息。
角色:读者
范围资源组:“rg-test”
使用 powershell/cli/alerts 你得到
事件日志警报警报-iamtesting时间 2021年5月19日 15:29 UTC类别 行政操作名称 Microsoft.Authorization/roleAssignments/write
关联 ID 0000000-000000000-000000000
级别信息
资源 ID/subscriptions/0000000-000000000-000000000/resourceGroups/rg-test/providers/Microsoft.Authorization/roleAssignments/0000000-000000000-000000000
来电者 John.Doe
属性 {"statusCode":"已创建","serviceRequestId":"0000000-000000000-000000000","eventCategory":"管理","entity":"/subscriptions/0000000-000000000-000000000/resourceGroups/rg -test/providers/Microsoft.Authorization/roleAssignments/00000000000000000
最佳答案
当您在 Azure 门户中查看事件日志时,它会调用 3 个 API 端点。
第一个是Activity Logs - List :
GET https://management.azure.com/subscriptions/{subscription id}/providers/microsoft.insights/eventtypes/management/values?api-version=2017-03-01-preview&$filter=eventTimestamp ge '2021-05-19T19:52:43Z' and eventTimestamp le '2021-05-20T01:52:43Z' and eventChannels eq 'Admin, Operation' and resourceGroupName eq '{resource group name}' and operations eq 'Microsoft.Authorization/roleAssignments/write' and levels eq 'Critical,Error,Warning,Informational'
它返回调用者、操作名称、事件时间戳、资源组和对象 ID目标用户和角色的RoleDefinitionId。
第二个是获取目标用户:
GET https://graph.windows.net/hanxia.onmicrosoft.com/users/{user object id}?api-version=1.6
最后一个正在获取角色:
GET https://management.azure.com/subscriptions/{subscription id}/providers/Microsoft.Authorization/roleDefinitions/{RoleDefinitionId}?api-version=2015-07-01
这样您就可以获得所需的所有信息。
当我们使用Azure CLI时,我们应该选择az monitor activity-log list 。 但是它仅相当于上面的第一个调用。我们得到一个名为 resourceId 的属性,它是 roleAssignment id。
所以我们仍然需要获取带有id的roleAssignment。这是一个简单的脚本。
# list the activity logs of resource group "AllenTestRG01" in the past 4 hours
$logs = az monitor activity-log list -g AllenTestRG01 --offset 4h | ConvertFrom-Json
# I assume that the first $logs[0] is the log you are tracking. (you should implement your logic here to find the log you need)
$logs[0].resourceId
# list the role assignments for resource group "AllenTestRG01"
$assignments = az role assignment list -g AllenTestRG01 | ConvertFrom-Json
# do a match
foreach ($assignment in $assignments){
if ($assignment.id -eq $a[0].resourceId) {
Write-Host "assigned user: " $assignment.principalName " role: "
$assignment.roleDefinitionName
}
}
关于azure - 如何使用alerts/powershell/cli获取Azure事件日志摘要?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67608245/
我如何在 HP Fortify SSC 上定义警报,只有在发现新问题或自上次扫描以来问题数量增加时才会发出警报。 我可以定义一个包含静态问题数量的警报,但每次警报数量发生变化时都需要手动更新,我想避免
由于未知原因,我的 Alert.alert 拒绝工作。我基本上是在重用之前工作的代码。获取错误: Exception NSArrayl length; unrecognized selector se
我的注销用户功能似乎根本不起作用。我在登录时通过警报调用它,但它似乎没有调用它。如果我尝试在末尾添加“()”,它只会给我一个错误。 loginUser = (email, password) => {
alert() 和 window.alert() 函数有什么区别?看起来效果一样。 最佳答案 因为 window 是全局对象,您可以通过简写调用 alert:alert( 'Hello!' ); 或通
我正在尝试整理此错误消息: Exception '-[_NSDisctionary0 length]: unrecognized selector sent to instance 0x7896412
有什么方法可以改变 JavaScript 中alert 或prompt 的外观吗?诸如添加图像、更改字体颜色或大小之类的事情,以及任何会使它看起来不同的事情。 最佳答案 扩展 Matthew Abbo
我正在尝试创建一个警报,以确保用户提交了正确的信息,如果单击“确定”而不是取消,则单击链接并 发送。我几乎已经实现了,警报激活,但如果单击确定则不会激活。不幸的是,我还不是 js 向导...... 编
看起来 AngularJS $window.alert() 和 Javascript alert() 是一样的。在什么条件下我们应该使用其中的哪一个?还是根本没有区别? 最佳答案 这是一回事——Jav
我的应用需要在不同时间向用户显示一些信息。我决定使用 AlertControllers 但我不能同时显示两个 Alert Controllers。因此我需要知道是否显示了警报 Controller ,
在 Brad's tutorial Alerts 组件使用以下方式导出: export default withAlert(Alerts) 这导致了错误: The above error occurr
我正在使用 Twitter Bootstrap 3 并使用 jQuery AJAX 发送表单数据。这是我的代码: $.ajax({ type: $(form).attr('method
我遇到了 的问题(SSL 警报编号 46) 140097325019584:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certif
我正在尝试使用 Alert React Native 中的组件以在 Android 和 iOS 之间创建一致的体验。我正在尝试运行示例警报。我导入了警报组件(为简洁起见省略了其他导入): import
考虑这段代码: var input = document.getElementById("hello"); input.addEventListener('blur', function() {
请检查代码, import { Alert, } from 'react-native'; checkForSendingOtp = () => { let hash = 'aBcDeG
我刚开始学习和练习 React Native,我遇到了第一个我自己似乎无法解决的问题。 我有以下代码,非常简单,但是当我在网络上运行时 Alert.alert() 不起作用。如果我单击该按钮,则没有任
在 Safari 浏览器中遇到一个问题,以下是我的场景(带示例)。 当我点击删除帐户的按钮时,我会打开警告消息。在该警报窗口中有两个操作“确定”和“取消”。如果我单击"is",它将重定向到另一个 UR
使用 Cordova CLI 版本 5.4.1,平台是iOS,在 iOS 模拟器上运行 来 self 应用的 onDeviceReady处理程序,我正在调用一个函数来设置一个 Hook ,以便使用 n
我正在使用 selenium IDE。我需要验证在成功填写数据并单击保存按钮后显示的闪现消息。 我正在使用 assertText css=div.alert.alert-success × Succe
我有一个 .pfx 文件,在 Windows 客户端上使用时可以完美连接到远程服务器。我现在想使用 Linux 客户端连接到服务器。 问题 1) 我使用以下 openssl 命令从 pfx 文件中提取
我是一名优秀的程序员,十分优秀!