반응형

활동 탐색기(Activity Explorer)에는 AIP Label Log 기록됩니다.

Activity Explorer

 

Log Sample

 

그리고 2022 10월부터 Powershell 명령어로 Log 내보내기가 가능해졌습니다.

M365 RoadMap

 

Export-ActivityExplorerData (ExchangePowerShell) | Microsoft Learn

This cmdlet is available only in Security & Compliance PowerShell. For more information, see Security & Compliance PowerShell.

Use the Export-ActivityExplorerData cmdlet to export activities from Data classification > Activity Explorer in the Microsoft 365 Purview compliance portal.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.


이 cmdlet은 보안 & 준수 PowerShell에서만 사용할 수 있습니다. 자세한 내용은 보안 및 규정 준수 PowerShell을 참조하세요.

Export-ActivityExplorerData cmdlet을 사용하여 Microsoft 365 Purview 규정 준수 포털 데이터 분류> 활동 탐색기에서 활동을 내보냅니다.

아래 구문 섹션의 매개 변수 집합에 대한 자세한 내용은 Exchange cmdlet 구문을 참조하세요.

 

아래의 글을 참고하여 작성하였습니다.

Fetching Activity Explorer data via the Export-ActivityExplorerData cmdlet - Blog (michev.info)

 

Security & Compliance PowerShell 접속합니다.

Connect-IPPSSession

Security & Complinace Powershell 연결

1 1~ 4 28일까지의 기록을 JSON 형태로 내보내기를 다음 명령어로 진행합니다.

Export-ActivityExplorerData -StartTime "1 Jan 2023" -EndTime "28 Apr 2023" -OutputFormat JSON

Export-ActivityExplorerData

UI상에서 보이는 기록들은 Resultdata 있습니다. Resultdata 값을 한번 필터링이 필요합니다.

ResultData

아래와 같이 진행하여 ResultData Json으로 변환합니다.

#Export-ActivityExplorerData
$res = Export-ActivityExplorerData -StartTime "1 Jan 2023" -EndTime "28 Apr 2023" -OutputFormat JSON

#sort the output based on datetime
(($res.ResultData) | ConvertFrom-Json) | sort Happened

 

아래와 같이 정렬된 형태로 출력됩니다.

ConvertFrom-Json 결과

 

Export-CSV 이용하여 내보내기 진행

#export-csv
(($res.ResultData) | ConvertFrom-Json) | sort Happened |Export-Csv -Path F:\ChatGPTScript\json.csv -Encoding UTF8 -NoTypeInformation

 

Justification 일부 항목이 누락된 것으로 확인됩니다.

export-csv 결과

 

ChatGPT 많은 대화를 나눠도 속성 값을 자동으로 지정해주는 스크립트 구조는 찾지 못했습니다. 그래서 저의 로그상에 있는 속성 값들을 Select-Object 수동으로 지정하여 아래와 같이 제작하였습니다.

#Export-ActivityExplorerData
$res = Export-ActivityExplorerData -StartTime "1 Jan 2023" -EndTime "28 Apr 2023" -OutputFormat JSON

# Sort the output based on datetime and select the specified properties
$selectedProperties = (($res.ResultData) | ConvertFrom-Json) | sort Happened | Select-Object Happened, RecordIdentity, User, Activity, ActivityId, Application, ClientIP, DataState, DestinationLocationType, DeviceName, DlpAuditEventMetadata, EmailInfo, EndpointOperation, EnforcementMode, EvidenceFile, FileExtension, FilePath, FileSize, FileType, Hidden, HowApplied, HowAppliedDetail, IRMContentId, IsProtected, IsProtectedBefore, JitTriggered, Justification, LabelEventType, MDATPDeviceId, OldSensitivityLabel, Platform, PolicyMatchInfo, PreviousFileName, PreviousProtectionOwner, ProductVersion, ProtectionEventType, ProtectionOwner, ProtectionType, RetentionLabel, RMSEncrypted, @{Name='SensitiveInfoTypeBucketsData'; Expression={$_.SensitiveInfoTypeBucketsData -join ','}}, @{Name='SensitiveInfoTypeData'; Expression={$_.SensitiveInfoTypeData -join ','}}, SensitivityLabel, Sha1, Sha256, SourceLocationType, TargetDomain, TargetFilePath, TargetPrinterName, TemplateId, UserSku, UserType, Workload

# Export the selected properties to a CSV file
$selectedProperties | Export-Csv -Path "c:\csv\ActivityExplorerLog1.csv" -NoTypeInformation -Encoding UTF8

 

필요한 필수 값들은 대부분 내보내기가 것으로 보입니다.

Activity Explorer Log

 

반응형

+ Recent posts