PowerShell 로그 수집
이 문서에서는 Bindplane을 사용하여 PowerShell 로그를 Google Security Operations에 수집하는 방법을 설명합니다. 파서는 원시 Microsoft PowerShell 로그를 통합 데이터 모델 (UDM)로 변환합니다. 먼저 원시 로그 메시지에서 필드를 추출하고 UDM 필드로 정규화한 다음 특정 이벤트 ID를 기반으로 추가 컨텍스트를 사용하여 데이터를 보강하여 보안 분석을 위한 구조화된 UDM 이벤트를 생성합니다.
시작하기 전에
- Google SecOps 인스턴스가 있는지 확인합니다.
- Windows 2016 이상이 설치되어 있는지 확인합니다.
- 프록시 뒤에서 실행하는 경우 방화벽 포트가 열려 있는지 확인합니다.
Google SecOps 수집 인증 파일 가져오기
- Google SecOps 콘솔에 로그인합니다.
- SIEM 설정 > 수집 에이전트로 이동합니다.
- 수집 인증 파일을 다운로드합니다. Bindplane이 설치될 시스템에 파일을 안전하게 저장합니다.
Google SecOps 고객 ID 가져오기
- Google SecOps 콘솔에 로그인합니다.
- SIEM 설정 > 프로필로 이동합니다.
- 조직 세부정보 섹션에서 고객 ID를 복사하여 저장합니다.
Windows에 Bindplane 에이전트 설치
- 명령 프롬프트 또는 PowerShell을 관리자로 엽니다.
다음 명령어를 실행합니다.
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
추가 설치 리소스
- 추가 설치 옵션은 이 설치 가이드를 참고하세요.
Syslog를 수집하여 Google SecOps로 전송하도록 Bindplane 에이전트 구성
- YAML 파일을 구성하기 전에 서비스 패널에서
observIQ Distro for Open Telemetry Collector
서비스를 중지합니다. 구성 파일에 액세스합니다.
config.yaml
파일을 찾습니다. 일반적으로 Linux에서는/etc/bindplane-agent/
디렉터리에 있고 Windows에서는 설치 디렉터리에 있습니다.- 텍스트 편집기 (예:
nano
,vi
, 메모장)를 사용하여 파일을 엽니다.
다음과 같이
config.yaml
파일을 수정합니다.receivers: windowseventlog/powershell: channel: Microsoft-Windows-PowerShell/Operational max_reads: 100 poll_interval: 5s raw: true start_at: end processors: batch: exporters: chronicle/powershell: endpoint: malachiteingestion-pa.googleapis.com # Adjust the path to the credentials file you downloaded in Step 1 creds: '/path/to/ingestion-authentication-file.json' log_type: 'POWERSHELL' override_log_type: false raw_log_field: body customer_id: '<customer_id>' service: pipelines: logs/winpowershell: receivers: - windowseventlog/powershell processors: [batch] exporters: [chronicle/powershell]
<customer_id>
를 실제 고객 ID로 바꿉니다.Google SecOps 수집 인증 파일 가져오기 섹션에서 인증 파일이 저장된 경로로
/path/to/ingestion-authentication-file.json
를 업데이트합니다.config.yaml
파일을 저장한 후observIQ Distro for Open Telemetry Collector
서비스를 시작합니다.
Bindplane 에이전트를 다시 시작하여 변경사항 적용
Windows에서 Bindplane 에이전트를 다시 시작하려면 서비스 콘솔을 사용하거나 다음 명령어를 입력하면 됩니다.
net stop BindPlaneAgent && net start BindPlaneAgent
UDM 매핑 테이블
로그 필드 | UDM 매핑 | 논리 |
---|---|---|
AccountName | principal.user.userid | 원시 로그의 AccountName 필드에서 직접 매핑됩니다. |
ActivityID | security_result.detection_fields[0].value | 원시 로그의 ActivityID 필드에서 직접 매핑됩니다. 중괄호가 삭제됩니다. |
채널 | IDM 객체에 매핑되지 않았습니다. | |
collection_time.nanos | IDM 객체에 매핑되지 않았습니다. | |
collection_time.seconds | IDM 객체에 매핑되지 않았습니다. | |
명령어 | IDM 객체에 매핑되지 않았습니다. | |
CommandLine | IDM 객체에 매핑되지 않았습니다. | |
컴퓨터 | principal.hostname | 있는 경우 원시 로그의 Computer 필드에서 직접 매핑됩니다. |
ContextInfo | IDM 객체에 매핑되지 않았습니다. | |
ContextInfo_Command Name | security_result.detection_fields[0].value | 있는 경우 원시 로그의 ContextInfo_Command Name 필드에서 직접 매핑됩니다. |
ContextInfo_Command 유형 | security_result.detection_fields[1].value | 있는 경우 원시 로그의 ContextInfo_Command Type 필드에서 직접 매핑됩니다. |
ContextInfo_호스트 애플리케이션 | target.process.command_line | powershell.Host Application 이 없는 경우 원시 로그의 ContextInfo_Host Application 필드에서 직접 매핑됩니다. |
ContextInfo_Host ID | target.asset.asset_id | powershell.Host ID 이 없는 경우 원시 로그의 ContextInfo_Host ID 필드에서 직접 매핑됩니다. 값에 Host ID: 이 프리픽스로 붙습니다. |
ContextInfo_Host Name | target.hostname | powershell.Host Name 이 없는 경우 원시 로그의 ContextInfo_Host Name 필드에서 직접 매핑됩니다. |
ContextInfo_Script Name | target.process.file.full_path | script_name 이 없는 경우 원시 로그의 ContextInfo_Script Name 필드에서 직접 매핑됩니다. |
ContextInfo_Sequence Number | security_result.detection_fields[2].value | 있는 경우 원시 로그의 ContextInfo_Sequence Number 필드에서 직접 매핑됩니다. 문자열로 변환되었습니다. |
ContextInfo_Severity | IDM 객체에 매핑되지 않았습니다. | |
create_time.nanos | IDM 객체에 매핑되지 않았습니다. | |
create_time.seconds | IDM 객체에 매핑되지 않았습니다. | |
customer_id | IDM 객체에 매핑되지 않았습니다. | |
데이터 | IDM 객체에 매핑되지 않았습니다. | |
데이터 | security_result.detection_fields[0].value | 있는 경우 원시 로그의 Data 필드에서 직접 매핑됩니다. |
Data_1 | security_result.detection_fields[1].value | 있는 경우 원시 로그의 Data_1 필드에서 직접 매핑됩니다. |
Data_2 | security_result.detection_fields[2].value | 있는 경우 원시 로그의 Data_2 필드에서 직접 매핑됩니다. |
도메인 | principal.administrative_domain | 원시 로그의 Domain 필드에서 직접 매핑됩니다. |
entries | IDM 객체에 매핑되지 않았습니다. | |
ERROR_EVT_UNRESOLVED | IDM 객체에 매핑되지 않았습니다. | |
EventCategory | IDM 객체에 매핑되지 않았습니다. | |
EventData | IDM 객체에 매핑되지 않았습니다. | |
EventID | metadata.product_event_type, security_result.rule_name | 원시 로그의 EventID 필드에서 직접 매핑됩니다. security_result.rule_name 필드의 값에는 EventID: 이 접두사로 붙습니다. |
EventLevel | IDM 객체에 매핑되지 않았습니다. | |
EventLevelName | security_result.severity | EventLevelName 값에 따라 매핑됩니다. ~ Information 는 INFORMATIONAL 에 매핑됩니다.- Verbose 이 LOW 에 매핑됩니다. |
EventLog | IDM 객체에 매핑되지 않았습니다. | |
EventReceivedTime | IDM 객체에 매핑되지 않았습니다. | |
EventType | IDM 객체에 매핑되지 않았습니다. | |
EventTime | metadata.event_timestamp | 있는 경우 타임스탬프를 추출하는 데 사용됩니다. |
ExecutionProcessID | principal.process.pid | 원시 로그의 ExecutionProcessID 필드에서 직접 매핑됩니다(있는 경우, 비어 있지 않거나 0이 아닌 경우). 문자열로 변환되었습니다. |
ExecutionThreadID | security_result.detection_fields[2].value | 원시 로그의 ExecutionThreadID 필드에서 직접 매핑됩니다(있는 경우, 비어 있지 않거나 0이 아닌 경우). 문자열로 변환되었습니다. |
파일 | target.process.file.full_path | 있는 경우 원시 로그의 File 필드에서 직접 매핑됩니다. |
호스트 애플리케이션 | IDM 객체에 매핑되지 않았습니다. | |
HostApplication | IDM 객체에 매핑되지 않았습니다. | |
호스트 이름 | principal.hostname | 원시 로그의 Hostname 필드에서 직접 매핑됩니다. |
id | IDM 객체에 매핑되지 않았습니다. | |
키워드 | IDM 객체에 매핑되지 않았습니다. | |
log_type | metadata.log_type | 원시 로그의 log_type 필드에서 직접 매핑됩니다. |
머신 | principal.asset.asset_id, principal.asset.platform_software.platform_version | Machine 필드는 머신 ID와 플랫폼 정보를 추출하기 위해 파싱됩니다. 머신 ID에는 Machine ID: 프리픽스가 붙습니다. 플랫폼은 값에 따라 UDM enum에 매핑됩니다. ~ win 은 WINDOWS 에 매핑됩니다.- mac 이 MAC 에 매핑됩니다.- lin 이 LINUX 에 매핑됩니다.- 기타 값은 UNKNOWN_PLATFORM 에 매핑됩니다. |
ManagementGroupName | additional.fields[0].value.string_value | 있는 경우 원시 로그의 ManagementGroupName 필드에서 직접 매핑됩니다. |
Message.EventTime | metadata.event_timestamp | 있는 경우 타임스탬프를 추출하는 데 사용됩니다. 문자열로 변환되었습니다. |
Message.Message | security_result.description | EventID 이 [403 , 4103 , 4104 ] 및 message_message_not_found 에 있는 경우 원시 로그의 Message.Message 필드에서 직접 매핑됩니다. 캐리지 리턴과 탭은 쉼표로 바뀝니다. |
메시지 | security_result.description | 있는 경우 원시 로그의 Message 필드에서 직접 매핑됩니다. |
MessageNumber | IDM 객체에 매핑되지 않았습니다. | |
MessageSourceAddress | principal.ip | 있는 경우 원시 로그의 MessageSourceAddress 필드에서 직접 매핑됩니다. |
MessageTotal | IDM 객체에 매핑되지 않았습니다. | |
MG | IDM 객체에 매핑되지 않았습니다. | |
명령 코드 | metadata.description | 원시 로그의 Opcode 필드에서 직접 매핑됩니다. |
OpcodeValue | IDM 객체에 매핑되지 않았습니다. | |
출력 | security_result.detection_fields[0].value | 있는 경우 원시 로그의 Output 필드에서 직접 매핑됩니다. |
powershell.명령어 이름 | security_result.detection_fields[0].value | 있는 경우 powershell.Command Name 필드에서 직접 매핑됩니다. |
powershell.Command 유형 | security_result.detection_fields[1].value | 있는 경우 powershell.Command Type 필드에서 직접 매핑됩니다. |
powershell.Host Application | target.process.command_line | 있는 경우 원시 로그의 powershell.Host Application 필드에서 직접 매핑됩니다. |
powershell.Host ID | target.asset.asset_id | 있는 경우 원시 로그의 powershell.Host ID 필드에서 직접 매핑됩니다. 값에 Host ID: 이 프리픽스로 붙습니다. |
powershell.호스트 이름 | target.hostname | 있는 경우 원시 로그의 powershell.Host Name 필드에서 직접 매핑됩니다. |
powershell.HostApplication | target.process.command_line | 있는 경우 원시 로그의 powershell.HostApplication 필드에서 직접 매핑됩니다. |
powershell.HostId | target.asset.asset_id | 있는 경우 원시 로그의 powershell.HostId 필드에서 직접 매핑됩니다. 값에 Host ID: 이 프리픽스로 붙습니다. |
powershell.HostName | target.hostname | 있는 경우 원시 로그의 powershell.HostName 필드에서 직접 매핑됩니다. |
powershell.스크립트 이름 | target.process.file.full_path | 있는 경우 원시 로그의 powershell.Script Name 필드에서 직접 매핑됩니다. |
powershell.ScriptName | target.process.file.full_path | 있는 경우 원시 로그의 powershell.ScriptName 필드에서 직접 매핑됩니다. |
powershell.Sequence Number | security_result.detection_fields[2].value | 있는 경우 원시 로그의 powershell.Sequence Number 필드에서 직접 매핑됩니다. |
powershell.SequenceNumber | security_result.detection_fields[0].value | 있는 경우 원시 로그의 powershell.SequenceNumber 필드에서 직접 매핑됩니다. |
powershell.UserId | principal.user.userid | 있는 경우 원시 로그의 powershell.UserId 필드에서 직접 매핑됩니다. |
프로세스 ID | principal.process.pid | ExecutionProcessID 및 ProcessID 가 없거나 비어 있거나 0인 경우 원시 로그의 Process ID 필드에서 직접 매핑됩니다. 문자열로 변환되었습니다. |
ProcessID | principal.process.pid | ExecutionProcessID 이 없거나 비어 있거나 0인 경우 원시 로그의 ProcessID 필드에서 직접 매핑됩니다. 문자열로 변환되었습니다. |
ProviderGuid | metadata.product_deployment_id | 원시 로그의 ProviderGuid 필드에서 직접 매핑됩니다. 중괄호가 삭제됩니다. |
PSEdition | IDM 객체에 매핑되지 않았습니다. | |
PSRemotingProtocolVersion | IDM 객체에 매핑되지 않았습니다. | |
PSVersion | IDM 객체에 매핑되지 않았습니다. | |
RecordNumber | metadata.product_log_id | 원시 로그의 RecordNumber 필드에서 직접 매핑됩니다. 문자열로 변환되었습니다. |
RenderedDescription | security_result.description | 있는 경우 원시 로그의 RenderedDescription 필드에서 직접 매핑됩니다. |
RunAs 사용자 | IDM 객체에 매핑되지 않았습니다. | |
ScriptBlockId | IDM 객체에 매핑되지 않았습니다. | |
ScriptBlockText | security_result.detection_fields[0].value | 있는 경우 원시 로그의 ScriptBlockText 필드에서 직접 매핑됩니다. |
ScriptBlock ID | IDM 객체에 매핑되지 않았습니다. | |
심각도 | security_result.severity, security_result.severity_details | Severity 값에 따라 매핑됩니다. ~ verbose 또는 info 은 LOW 에 매핑됩니다.- warn 또는 err 이 MEDIUM 에 매핑됩니다.- crit 이 HIGH 에 매핑됩니다.원시 값도 security_result.severity_details 에 매핑됩니다. |
source.collector_id | IDM 객체에 매핑되지 않았습니다. | |
source.customer_id | IDM 객체에 매핑되지 않았습니다. | |
소스 | additional.fields[1].value.string_value | 있는 경우 원시 로그의 Source 필드에서 직접 매핑됩니다. |
SourceModuleName | principal.resource.name | 원시 로그의 SourceModuleName 필드에서 직접 매핑됩니다. |
SourceModuleType | principal.resource.resource_subtype | 원시 로그의 SourceModuleType 필드에서 직접 매핑됩니다. |
SourceName | metadata.product_name | 원시 로그의 SourceName 필드에서 직접 매핑됩니다. |
start_time.nanos | IDM 객체에 매핑되지 않았습니다. | |
start_time.seconds | IDM 객체에 매핑되지 않았습니다. | |
TenantId | additional.fields[2].value.string_value | 있는 경우 원시 로그의 TenantId 필드에서 직접 매핑됩니다. |
ThreadID | IDM 객체에 매핑되지 않았습니다. | |
timestamp.nanos | IDM 객체에 매핑되지 않았습니다. | |
timestamp.seconds | IDM 객체에 매핑되지 않았습니다. | |
유형 | IDM 객체에 매핑되지 않았습니다. | |
UserID | principal.user.windows_sid | 원시 로그의 UserID 필드에서 직접 매핑됩니다. |
사용자 이름 | principal.user.userid | AccountName 이 없는 경우 원시 로그의 Username 필드에서 직접 매핑됩니다. |
metadata.vendor_name | Microsoft 로 설정합니다. |
|
metadata.event_type | EventID 이 4104 이고 _Path 이 Message 에 있거나 EventID 이 4103 이거나 EventID 이 [800 , 600 , 400 ] 에 있고 powershell.ScriptName 및 powershell.HostApplication 이 있는 경우 PROCESS_LAUNCH 로 설정합니다. EventID 이 403 이고 _HostApplication 이 Message 에 있거나 EventID 이 403 이고 NewEngineState 이 Stopped 인 경우 PROCESS_TERMINATION 로 설정합니다. EventID 이 4104 이고 _Path 이 Message 에 없거나, EventID 이 4103 이고 no_value , script_name 이 비어 있고 script_name_not_found , host_application_not_found 이 모두 true이거나, EventID 이 53504 이거나, EventID 이 40962 이거나, EventID 이 40961 이거나, EventID 이 비어 있고 MessageSourceAddress 이 있는 경우 STATUS_UPDATE 로 설정합니다. EventID 이 비어 있고 Username 이 있으면 USER_UNCATEGORIZED 로 설정합니다. EventID 이 비어 있고 MessageSourceAddress 및 Username 이 없는 경우 GENERIC_EVENT 로 설정됩니다. |
|
metadata.product_name | SourceName 이 없으면 Powershell 로 설정합니다. |
|
security_result.action | ALLOW 로 설정합니다. |
|
security_result.detection_fields[0].key | Activity ID 로 설정합니다. |
|
security_result.detection_fields[1].key | Sequence Number 로 설정합니다. |
|
security_result.detection_fields[2].key | ExecutionThreadID 로 설정합니다. |
|
additional.fields[0].key | Management Group Name 로 설정합니다. |
|
additional.fields[1].key | Source 로 설정합니다. |
|
additional.fields[2].key | TenantId 로 설정합니다. |
|
principal.asset.platform_software.platform | platform_software 에 win 이 포함되어 있으면 WINDOWS 로 설정하고, mac 이 포함되어 있으면 MAC 로 설정하고, lin 이 포함되어 있으면 LINUX 로 설정하고, 그렇지 않으면 UNKNOWN_PLATFORM 로 설정합니다. |
|
target.process.file.full_path | EventID 이 4104 이고 _Path 이 Message 에 있으면 _Path 로 설정합니다. EventID 이 4104 이고 file_path 이 Message 에 있으면 file_path 로 설정합니다. EventID 이 403 이고 _HostApplication 이 Message 에 있으면 _HostApplication 로 설정합니다. |
도움이 더 필요하신가요? 커뮤니티 회원 및 Google SecOps 전문가로부터 답변을 받으세요.