Security Eventlog Cleared

Some threat groups tend to delete the local 'Security' Eventlog using certain utitlities

Rule Content

- title: Security Eventlog Cleared
  id: f2f01843-e7b8-4f95-a35a-d23584476423
  description: Some threat groups tend to delete the local 'Security' Eventlog using
    certain utitlities
  tags:
  - attack.defense_evasion
  - attack.t1070
  - car.2016-04-002
  author: Florian Roth
  logsource:
    product: windows
    service: security
    category: null
  detection:
    selection:
      EventID:
      - 517
      - 1102
    condition: selection
  falsepositives:
  - Rollout of log collection agents (the setup routine often includes a reset of
    the local Eventlog)
  - System provisioning (system reset before the golden image creation)
  level: high

Querying Elasticsearch

Import Libraries


In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd

Initialize Elasticsearch client


In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-endpoint-winevent-security-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='event_id:("517" OR "1102")')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()