Skip to content

[New Rule] Clearing Windows Event Logs #500

Closed
@janniten

Description

@janniten

Description

There are (to my knowledge) 3 ways of clearing the Windows Event logs:

  • Using powershell:
    powershell.exe Clear-EventLog -LogName application, system -confirm

  • Using webutil:
    WevtUtil.exe cl "Security"

  • Using the event viewer:
    image

I've been tested the rule for the 3 ways in a 2012 and 2016 DC and here the results:

  • For both webutil and powershell methods the process.args field is not completed, so there is no way to know which action (in this case Clear-EventLog for powershell and cl for wevutil) has been performed
    After the tests:
    image

When clearing from event viewer no process related data is generated, but Event logs are cleared.

In the 3 cases the event 1102 is generated. The event is ECS compliant and my own rule works for the 3 cases using this query:

event.action: "audit-log-cleared"
or works also querying the specific event
event.code: "1102"

There has been a discussion about a event category when configurations or audit are changed/modified and maybe in the future a more general query can be done (elastic/ecs#963)

Is there any reason why the clearing of event logs is not detected by the appearance of event 1102 and only by process and its arguments?
Also there is one open improvement, related to this rule (#392) but in that case is clear that proccess.args has data...
Am I missing something?
Thank you

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions