Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wazuh bf #1215

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added collections/bouddha/wazuh.md
Empty file.
11 changes: 11 additions & 0 deletions collections/bouddha/wazuh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parsers:
- bouddha/wazuh-logs
scenarios:
- bouddha/wazuh-bf
description: "Wazuh support : parser and brute-force detection"
author: bouddha
tags:
- soc
- security
- wazuh
- bruteforce
3 changes: 3 additions & 0 deletions parsers/s01-parse/bouddha/wazuh-logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Wazuh authentication failure parser.

Reference:
25 changes: 25 additions & 0 deletions parsers/s01-parse/bouddha/wazuh-logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: bouddha/wazuh-logs
description: "Parse Wazuh web interface logs for failed login attempts"
filter: "evt.Parsed.program == 'opensearch-dashboards' && UnmarshalJSON(evt.Parsed.message, evt.Unmarshaled, 'wazuh') in ['', nil]"
onsuccess: next_stage
statics:
- meta: service
value: wazuh
- meta: source_ip
expression: evt.Unmarshaled.wazuh.req.remoteAddress
- meta: log_type
expression: |
(
evt.Unmarshaled.wazuh.type == 'response' &&
evt.Unmarshaled.wazuh.method == 'post' &&
evt.Unmarshaled.wazuh.statusCode in [401, '401'] &&
evt.Unmarshaled.wazuh.req.url == '/auth/login?dataSourceId='
) ? 'wazuh_failed_auth' : ''
- meta: timestamp
expression: evt.Unmarshaled.wazuh['@timestamp']
- meta: status_code
expression: evt.Unmarshaled.wazuh.statusCode
- meta: url
expression: evt.Unmarshaled.wazuh.req.url
- target: evt.StrTime
expression: evt.Unmarshaled.wazuh['@timestamp']
3 changes: 3 additions & 0 deletions scenarios/bouddha/wazuh-bf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detect failed Wazuh authentications:

- leakspeed of 10s, capacity of 5 from same IP
18 changes: 18 additions & 0 deletions scenarios/bouddha/wazuh-bf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Wazuh web auth bruteforce
type: leaky
name: bouddha/wazuh-bf
description: "Detect bruteforce attempts on Wazuh web interface"
filter: evt.Meta.log_type == 'wazuh_failed_auth'
leakspeed: "10s"
capacity: 5
groupby: evt.Meta.source_ip
blackhole: 5m
labels:
remediation: true
confidence: 3
spoofable: 0
classification:
- attack.T1110
behavior: "http:bruteforce"
label: "Wazuh Bruteforce"
service: wazuh