elastic / elastic/integrations

Modsecurity 1.6.0 Grok errors in logs-modsecurity.auditlog-1.6.0-apache-modsec pipeline

Open
#5,569 3 comments 0 reactions 0 assignees View on GitHub
bug Integration:modsecurity Stalled Team:Security-Deployment and Devices
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
2d 18h
Merged PRs (30d)
182

Description

Hi,
I'm using the modsecurity 1.6.0 integration and some logs are not properly parsed.
(Audit logs are configured as it is explained in the documentation)
I've modified the pipeline like this and seems not have further errors
Replace this
```
{
"grok": {
"field": "json.request.request_line",
"patterns": [
"%{NOTSPACE:http.request.method} %{URIPATHPARAM:url.original}(?: HTTP/%{NUMBER:http.version})"
]
}
}

```
For this
```
{
"grok": {
"field": "json.request.request_line",
"patterns": [
"%{NOTSPACE:http.request.method} %{URIPATHPARAM:url.original}(?: HTTP/%{NUMBER:http.version})",
"%{NOTSPACE:http.request.method} %{URI:url.original}(?: HTTP/%{NUMBER:http.version})",
"%{NOTSPACE:http.request.method} %{URIHOST:url.original}(?: HTTP/%{NUMBER:http.version})",
"%{GREEDYDATA:http.request.method}%{SPACE}HTTP/%{NUMBER:http.version}"
]
}
}
```
These are the errors I have so far
**error.message**
"Provided Grok expressions do not match field value: [CONNECT google.com:443 HTTP/1.1]"
**json.request.request_line**
"CONNECT google.com:443 HTTP/1.1"
**error.message**
"Provided Grok expressions do not match field value: [GET /Electron/download/windows/\\Windows\\win.ini HTTP/1.0]
**json.request.request_line**
"GET /Electron/download/windows/\Windows\win.ini HTTP/1.0"
**error.message**
"Provided Grok expressions do not match field value: [POST http://127.0.0.1/iControl/iControlPortal.cgi HTTP/1.1]
**json.request.request_line**
"POST http://127.0.0.1/iControl/iControlPortal.cgi HTTP/1.1"
**error.message**
"Provided Grok expressions do not match field value: [POST http://127.0.0.1/iControl/iControlPortal.cgi HTTP/1.1]
**json.request.request_line**
"POST http://127.0.0.1/iControl/iControlPortal.cgi HTTP/1.1"
**error.message**
Provided Grok expressions do not match field value: [GET /s6fzf2bt.x? HTTP/1.1]
**json.request.request_line**
"GET /s6fzf2bt.x? HTTP/1.1"""
**error.message**
Provided Grok expressions do not match field value: [GET https://site.ad/authentication/login/ HTTP/1.1]
**json.request.request_line**
"GET https://site.ad/authentication/login/ HTTP/1.1"
**error.message**
Provided Grok expressions do not match field value: [GET https://www.site.ad/ HTTP/1.1]
**json.request.request_line**
"GET https://www.site.ad/ HTTP/1.1"


Thanks!
PS: I'm not attaching the complete event.original. Since it is an Audit log it has a lot of sensitive information, so I'm only putting the field that is parsed by the grok processor

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.