2021년 5월 9일 일요일

Splunk와 Winlogbeat 차이

Winlogbeat로 이벤트 로그를 연동하면 다음 데이터를 가져온다.


이런 식.
{
  "@timestamp": "2021-05-09T02:11:41.573Z",
  "@metadata": {
    "beat": "winlogbeat",
    "type": "_doc",
    "version": "7.12.1"
  },
  "winlog": {
    "event_id": 4656,
    "event_data": {
      "ProcessId": "0x2834",
      "SubjectUserName": "Administrator",
      "HandleId": "0x94c",
      "AccessList": "%%1537\n\t\t\t\t%%1538\n\t\t\t\t%%4432\n\t\t\t\t%%4433\n\t\t\t\t%%4434\n\t\t\t\t%%4435\n\t\t\t\t%%4436\n\t\t\t\t",
      "TransactionId": "{00000000-0000-0000-0000-000000000000}",
      "SubjectDomainName": "MHKANG",
      "PrivilegeList": "-",
      "SubjectLogonId": "0x11c9b1",
      "ObjectServer": "Security",
      "AccessReason": "-",
      "SubjectUserSid": "S-1-5-21-2374157174-815110708-3001042983-500",
      "ResourceAttributes": "-",
      "ProcessName": "C:\Splunk\bin\splunkd.exe",
      "ObjectType": "Process",
      "RestrictedSidCount": "0",
      "ObjectName": "\Device\HarddiskVolume10\Windows\System32\lsass.exe",
      "AccessMask": "0x3001f"
    }
  }

이때 특정 프로세스 이름를 포함한 이벤트를 연동 대상에서 제외하고 싶다면 processors 옵션을 사용하면 된다.
processors:
  - drop_event:
      when:
        and:
          - equals.winlog.event_id: 4656
          - winlog.event_data.ProcessName: "C:\Splunk\bin\splunkd.exe"

스플렁크로 연동하면 

결과는 이렇다.


스플렁크는 원본이 아닌 번역본을 가져오는 모양.


다음은 특정 프로세스 이름을 포함한 이벤트를 제외하기 위한 inputs.conf 설정. (white/blacklist 모두 정규표현식으로 동작) 일단 white/blacklist에서 쓸만한 필드는 EventCode와 Message 정도. 그래서 제외하고 싶은 프로세스가 하나만 있으면 이렇게 하면 되는데,
[default]
host = MHKANG

[WinEventLog://Security]
whitelist = 4656
blacklist = Message="C:\\\Splunk"

주체와 대상 개체로 나뉜 프로세스 중 주체만을 특정하려다 보니 삽질 시작됨(..) 해당 데이터 구조는 이렇다. key와 value를 탭(\t) 문자로 구분.


영문 이름을 유지하는 Message 필드에 조건을 추가해봤다. 실패!
[default]
host = MHKANG

[WinEventLog://Security]
whitelist = 4656
blacklist = Message="프로세스 이름:\t\tC:\\\Splunk"

한글 문제인가 싶어 유니코드로 바꿔도 실패. 로그스태시는 되던데
[default]
host = MHKANG

[WinEventLog://Security]
whitelist = 4656
blacklist = Message="%uD504%uB85C%uC138%uC2A4 %uC774%uB984:\t\tC:\\\Splunk"

결국 다음 설정으로 해결.
[default]
host = MHKANG

[WinEventLog://Security]
whitelist = 4656
blacklist = Message=".... ..:\t\tC:\\\Splunk"

이벤트 로그를 영문으로 가져오는 방법 없나 찾아봤는데 renderXml 옵션을 사용하거나, 영문 윈도우 쓰란다. 스플렁크 쏘쿨

관련 글

댓글 없음:

댓글 쓰기

크리에이티브 커먼즈 라이선스