OMI RCE의 영향을 받을 수 있는 Azure VM을 나열하는 방법

OMI RCE의 영향을 받을 수 있는 Azure VM을 나열하는 방법

2022-10-05 last update

5 minutes reading infosec omi security azure
Linux 워크로드에 추가할 수 있는 여러 Azure 확장에 사용되는 OMI(Open Management Infrastructure) 프레임워크에 원격 코드 실행(RCE) 취약점이 있습니다.

자세한 내용은 here 에서 찾을 수 있습니다.

그러나 영향을 받는 VM을 어떻게 나열할 수 있습니까? Azure Resource Graph가 답입니다. 빠르고 모든 구독을 스캔하고 다양한 스크립팅 언어로 통합할 수 있습니다.
그러나 두 개의 테이블 가상 머신과 가상 머신/확장을 쿼리해야 합니다.

Resources
| where type == 'microsoft.compute/virtualmachines'
| extend
    JoinID = toupper(id),
    OSName = tostring(properties.osProfile.computerName),
    OSType = tostring(properties.storageProfile.osDisk.osType)
| where OSType =~ 'Linux'
| join kind=leftouter(
    Resources
    | where type == 'microsoft.compute/virtualmachines/extensions'
    | extend 
        VMId = toupper(substring(id, 0, indexof(id, '/extensions'))),
        ExtensionName = name
) on $left.JoinID == $right.VMId
| where ExtensionName in ('OmsAgentForLinux', 'OMSExtension')
| summarize Extensions = make_list(ExtensionName) by subscriptionId, resourceGroup,name, OSName


확장 목록이 에서 완전하지 않습니다.

where ExtensionName in ('OmsAgentForLinux', 'OMSExtension')


Microsoft post에서 전체 확장 목록을 추가해야 합니다.

편집: Microsoft에서 게시한 이 스크립트를 GitHub to find and update VM in your subscriptions에 사용할 수도 있습니다.