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

[Filebeat] Change url grok pattern in iis error fileset to accept malformed url paths #13378

Merged
merged 3 commits into from
Aug 29, 2019
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Allow path variables to be used in files loaded from modules.d. {issue}13184[13184]
- Fix incorrect references to index patterns in AWS and CoreDNS dashboards. {pull}13303[13303]
- Fix timezone parsing of system module ingest pipelines. {pull}13308[13308]
- Change iis url.path grok pattern from URIPATH to NOTSPACE. {issue}12710[12710] {pull}13225[13225]
- Change iis url path grok pattern from URIPATH to NOTSPACE. {issue}12710[12710] {pull}13225[13225] {issue}7951[7951] {pull}13378[13378]
- Add timezone information to apache error fileset. {issue}12772[12772] {pull}13304[13304]

*Heartbeat*
Expand Down
3 changes: 2 additions & 1 deletion filebeat/module/iis/error/ingest/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"grok": {
"field": "message",
"patterns": [
"%{TIMESTAMP_ISO8601:iis.error.time} %{IPORHOST:source.address} %{NUMBER:source.port:long} %{IPORHOST:destination.address} %{IPORHOST:destination.port:long} (?:HTTP/%{NUMBER:http.version}|-) (?:%{WORD:http.request.method}|-) (?:%{URIPATHPARAM:url.original}|-)(?: -)? (?:%{NUMBER:http.response.status_code:long}|-) (?:%{NUMBER}|-) (?:%{NOTSPACE:iis.error.reason_phrase}|-) (?:%{NOTSPACE:iis.error.queue_name}|-)"
"%{TIMESTAMP_ISO8601:iis.error.time} %{IPORHOST:source.address} %{NUMBER:source.port:long} %{IPORHOST:destination.address} %{IPORHOST:destination.port:long} (?:HTTP/%{NUMBER:http.version}|-) (?:%{WORD:http.request.method}|-) (?:-|%{NOTSPACE:url.original}) (?:%{NUMBER}|-) (?:%{NUMBER:http.response.status_code:long}|-) (?:%{NUMBER}|-) (?:-|%{NOTSPACE:iis.error.reason_phrase}) (?:-|%{NOTSPACE:iis.error.queue_name})",
"%{TIMESTAMP_ISO8601:iis.error.time} %{IPORHOST:source.address} %{NUMBER:source.port:long} %{IPORHOST:destination.address} %{IPORHOST:destination.port:long} (?:HTTP/%{NUMBER:http.version}|-) (?:%{WORD:http.request.method}|-) (?:-|%{NOTSPACE:url.original}) (?:%{NUMBER:http.response.status_code:long}|-) (?:%{NUMBER}|-) (?:-|%{NOTSPACE:iis.error.reason_phrase}) (?:-|%{NOTSPACE:iis.error.queue_name})"
],
"ignore_missing": true
}
Expand Down
8 changes: 8 additions & 0 deletions filebeat/module/iis/error/test/iis_error_url.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/0.9 t3 12.2.1 400 - URL -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 GET ./././././../../../../../../../../ 400 - URL -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 GET /..\pixfir~1\how_to_login.html 403 - Forbidden -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 GET ..\..\..\..\..\..\winnt\win.ini 400 - URL -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 GET /�.�./�.�./�.�./�.�./�.�./windows/win.ini 404 - NotFound -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 GET /nessus\..\..\..\..\..\..\winnt\win.ini 403 - Forbidden -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 OPTIONS * 404 - NotFound -
2018-05-05 05:05:55 149.42.83.135 12345 192.168.101.101 443 HTTP/1.1 GET /fee&fie=foe 400 - URL -
194 changes: 194 additions & 0 deletions filebeat/module/iis/error/test/iis_error_url.log-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
[
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "t3",
"http.response.status_code": 400,
"http.version": "0.9",
"iis.error.reason_phrase": "URL",
"input.type": "log",
"log.offset": 0,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "12.2.1"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "GET",
"http.response.status_code": 400,
"http.version": "1.1",
"iis.error.reason_phrase": "URL",
"input.type": "log",
"log.offset": 91,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "./././././../../../../../../../../"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "GET",
"http.response.status_code": 403,
"http.version": "1.1",
"iis.error.reason_phrase": "Forbidden",
"input.type": "log",
"log.offset": 211,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "/..\\pixfir~1\\how_to_login.html"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "GET",
"http.response.status_code": 400,
"http.version": "1.1",
"iis.error.reason_phrase": "URL",
"input.type": "log",
"log.offset": 333,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "..\\..\\..\\..\\..\\..\\winnt\\win.ini"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "GET",
"http.response.status_code": 404,
"http.version": "1.1",
"iis.error.reason_phrase": "NotFound",
"input.type": "log",
"log.offset": 450,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "/\ufffd.\ufffd./\ufffd.\ufffd./\ufffd.\ufffd./\ufffd.\ufffd./\ufffd.\ufffd./windows/win.ini"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "GET",
"http.response.status_code": 403,
"http.version": "1.1",
"iis.error.reason_phrase": "Forbidden",
"input.type": "log",
"log.offset": 602,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "/nessus\\..\\..\\..\\..\\..\\..\\winnt\\win.ini"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "OPTIONS",
"http.response.status_code": 404,
"http.version": "1.1",
"iis.error.reason_phrase": "NotFound",
"input.type": "log",
"log.offset": 733,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "*"
},
{
"@timestamp": "2018-05-05T05:05:55.000Z",
"destination.address": "192.168.101.101",
"destination.ip": "192.168.101.101",
"destination.port": 443,
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"http.request.method": "GET",
"http.response.status_code": 400,
"http.version": "1.1",
"iis.error.reason_phrase": "URL",
"input.type": "log",
"log.offset": 829,
"service.type": "iis",
"source.address": "149.42.83.135",
"source.geo.continent_name": "North America",
"source.geo.country_iso_code": "US",
"source.geo.location.lat": 37.751,
"source.geo.location.lon": -97.822,
"source.ip": "149.42.83.135",
"source.port": 12345,
"url.original": "/fee&fie=foe"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"iis.error.queue_name": "-",
"iis.error.reason_phrase": "Timer_ConnectionIdle",
"input.type": "log",
"log.offset": 195,
Expand Down
4 changes: 0 additions & 4 deletions filebeat/module/iis/error/test/test.log-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"http.request.method": "GET",
"http.response.status_code": 503,
"http.version": "1.1",
"iis.error.queue_name": "-",
"iis.error.reason_phrase": "ConnLimit",
"input.type": "log",
"log.offset": 186,
Expand All @@ -31,7 +30,6 @@
"http.request.method": "GET",
"http.response.status_code": 400,
"http.version": "1.1",
"iis.error.queue_name": "-",
"iis.error.reason_phrase": "Hostname",
"input.type": "log",
"log.offset": 286,
Expand Down Expand Up @@ -61,7 +59,6 @@
"http.request.method": "GET",
"http.response.status_code": 505,
"http.version": "2.0",
"iis.error.queue_name": "-",
"iis.error.reason_phrase": "Version_N/S",
"input.type": "log",
"log.offset": 384,
Expand All @@ -88,7 +85,6 @@
"event.dataset": "iis.error",
"event.module": "iis",
"fileset.name": "error",
"iis.error.queue_name": "-",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"iis.error.reason_phrase": "Timer_MinBytesPerSecond",
"input.type": "log",
"log.offset": 470,
Expand Down