Skip to content

Commit

Permalink
Update parser to look at both sshd and sshd-session log lines (#1093)
Browse files Browse the repository at this point in the history
* Update parser to look at both sshd and sshd-session log lines

* Add parser assertions to ensure that sshd-session & sshd are parsed
correctly.

Both are set to 'ssh' as the service name

* enhance: Move log line to parser assert file instead of bf file, remove changes to bf test config

* enhance: run index workflow manually cause of fork; prepped for merge

---------

Co-authored-by: Laurence <[email protected]>
  • Loading branch information
hobeone and LaurenceJJones authored Aug 28, 2024
1 parent 40692b8 commit c9c4fd0
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .index.json
Original file line number Diff line number Diff line change
Expand Up @@ -7812,7 +7812,7 @@
"crowdsecurity/sshd-logs": {
"path": "parsers/s01-parse/crowdsecurity/sshd-logs.yaml",
"stage": "s01-parse",
"version": "2.7",
"version": "2.8",
"versions": {
"0.1": {
"digest": "ecd40cb8cd95e2bad398824ab67b479362cdbf0e1598b8833e2f537ae3ce2f93",
Expand Down Expand Up @@ -7921,10 +7921,14 @@
"2.7": {
"digest": "7d541c12f97b090c5f7259b1d2c57fc6205aeea16fc7103d5bbf317f8023f27d",
"deprecated": false
},
"2.8": {
"digest": "8f2ba8205583b13ef3715d679accc17a503500a6cae3fd4ea4d847da22b3abdf",
"deprecated": false
}
},
"long_description": "WW91ciBvbmUgZml0cy1hbGwgc3NoIHBhcnNlciB3aXRoIHN1cHBvcnQgZm9yIHRoZSBtb3N0IGNvbW1vbiBraW5kIG9mIGZhaWxlZCBhdXRoZW50aWNhdGlvbnMgYW5kIGVycm9ycy4KCg==",
"content": "b25zdWNjZXNzOiBuZXh0X3N0YWdlCiNkZWJ1ZzogdHJ1ZQpmaWx0ZXI6ICJldnQuUGFyc2VkLnByb2dyYW0gPT0gJ3NzaGQnIgpuYW1lOiBjcm93ZHNlY3VyaXR5L3NzaGQtbG9ncwpkZXNjcmlwdGlvbjogIlBhcnNlIG9wZW5TU0ggbG9ncyIKcGF0dGVybl9zeW50YXg6C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FX0ZBSUxFRCIKICAgICAgYXBwbHlfb246IG1lc3NhZ2UKICAgICAgc3RhdGljczoKICAgICAgICAtIG1ldGE6IGxvZ190eXBlCiAgICAgICAgICB2YWx1ZTogc3NoX2ZhaWxlZC1hdXRoCiAgICAgICAgLSBtZXRhOiB0YXJnZXRfdXNlcgogICAgICAgICAgZXhwcmVzc2lvbjogImV2dC5QYXJzZWQuc3NoZF9pbnZhbGlkX3VzZXIiCiAgLSBncm9rOgogICAgICBuYW1lOiAiU1NIRF9CQURfS0VZX05FR09USUFUSU9OIgogICAgICBhcHBseV9vbjogbWVzc2FnZQogICAgICBzdGF0aWNzOgogICAgICAgIC0gbWV0YTogbG9nX3R5cGUKICAgICAgICAgIHZhbHVlOiBzc2hfYmFkX2tleWV4Y2hhbmdlCiAgLSBncm9rOgogICAgICBuYW1lOiAiU1NIRF9BVVRIX1RJTUVPVVQiCiAgICAgIGFwcGx5X29uOiBtZXNzYWdlCiAgICAgIHN0YXRpY3M6CiAgICAgICAgLSBtZXRhOiBsb2dfdHlwZQogICAgICAgICAgdmFsdWU6IHNzaF9hdXRoX3RpbWVvdXQKICAtIGdyb2s6CiAgICAgIG5hbWU6ICJTU0hEX0RJU1BBVENIX0ZBVEFMIgogICAgICBhcHBseV9vbjogbWVzc2FnZQogICAgICBzdGF0aWNzOgogICAgICAgIC0gbWV0YTogbG9nX3R5cGUKICAgICAgICAgIHZhbHVlOiBzc2hfZGlzcGF0Y2hfZmF0YWwKc3RhdGljczoKICAtIG1ldGE6IHNlcnZpY2UKICAgIHZhbHVlOiBzc2gKICAtIG1ldGE6IHNvdXJjZV9pcAogICAgZXhwcmVzc2lvbjogImV2dC5QYXJzZWQuc3NoZF9jbGllbnRfaXAiCg==",
"description": "Parse openSSH logs",
"author": "crowdsecurity",
"labels": null
Expand Down
Empty file removed .tests/ssh-bf/parser.assert
Empty file.
2 changes: 1 addition & 1 deletion .tests/ssh-bf/ssh-bf.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Feb 12 14:10:21 sd-126005 sshd[16378]: Invalid user pascal1 from 35.188.49.176 p
Feb 12 14:10:22 sd-126005 sshd[16378]: Invalid user pascal2 from 35.188.49.176 port 53502
Feb 12 14:10:22 sd-126005 sshd[16378]: Invalid user pascal3 from 35.188.49.176 port 53502
Feb 12 14:10:23 sd-126005 sshd[16378]: Invalid user pascal4 from 35.188.49.176 port 53502
Feb 12 14:10:23 sd-126005 sshd[16378]: Invalid user pascal5 from 35.188.49.176 port 53502
Feb 12 14:10:24 sd-126005 sshd-session[16379]: Invalid user pascal5 from 35.188.49.176 port 53502

30 changes: 28 additions & 2 deletions .tests/sshd-logs/parser.assert
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
len(results) == 3
len(results["s00-raw"]["crowdsecurity/syslog-logs"]) == 20
len(results["s00-raw"]["crowdsecurity/syslog-logs"]) == 21
results["s00-raw"]["crowdsecurity/syslog-logs"][0].Success == true
results["s00-raw"]["crowdsecurity/syslog-logs"][0].Evt.Parsed["logsource"] == "syslog"
results["s00-raw"]["crowdsecurity/syslog-logs"][0].Evt.Parsed["message"] == "Invalid user pascal from 35.188.49.176 port 53502"
Expand Down Expand Up @@ -200,7 +200,17 @@ results["s00-raw"]["crowdsecurity/syslog-logs"][19].Evt.Meta["datasource_path"]
results["s00-raw"]["crowdsecurity/syslog-logs"][19].Evt.Meta["datasource_type"] == "file"
results["s00-raw"]["crowdsecurity/syslog-logs"][19].Evt.Meta["machine"] == "instance-20240401-2335"
results["s00-raw"]["crowdsecurity/syslog-logs"][19].Evt.Whitelisted == false
len(results["s01-parse"]["crowdsecurity/sshd-logs"]) == 20
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Success == true
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Parsed["logsource"] == "syslog"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Parsed["message"] == "Invalid user pascal5 from 35.188.49.176 port 53502"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Parsed["pid"] == "16379"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Parsed["program"] == "sshd-session"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Parsed["timestamp"] == "Feb 12 14:10:24"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Meta["datasource_path"] == "sshd-logs.log"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Meta["datasource_type"] == "file"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Meta["machine"] == "sd-126005"
results["s00-raw"]["crowdsecurity/syslog-logs"][20].Evt.Whitelisted == false
len(results["s01-parse"]["crowdsecurity/sshd-logs"]) == 21
results["s01-parse"]["crowdsecurity/sshd-logs"][0].Success == true
results["s01-parse"]["crowdsecurity/sshd-logs"][0].Evt.Parsed["logsource"] == "syslog"
results["s01-parse"]["crowdsecurity/sshd-logs"][0].Evt.Parsed["message"] == "Invalid user pascal from 35.188.49.176 port 53502"
Expand Down Expand Up @@ -498,4 +508,20 @@ results["s01-parse"]["crowdsecurity/sshd-logs"][19].Evt.Meta["machine"] == "inst
results["s01-parse"]["crowdsecurity/sshd-logs"][19].Evt.Meta["service"] == "ssh"
results["s01-parse"]["crowdsecurity/sshd-logs"][19].Evt.Meta["source_ip"] == "192.168.9.213"
results["s01-parse"]["crowdsecurity/sshd-logs"][19].Evt.Whitelisted == false
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Success == true
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["logsource"] == "syslog"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["message"] == "Invalid user pascal5 from 35.188.49.176 port 53502"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["pid"] == "16379"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["program"] == "sshd-session"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["sshd_client_ip"] == "35.188.49.176"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["sshd_invalid_user"] == "pascal5"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Parsed["timestamp"] == "Feb 12 14:10:24"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["datasource_path"] == "sshd-logs.log"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["datasource_type"] == "file"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["log_type"] == "ssh_failed-auth"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["machine"] == "sd-126005"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["service"] == "ssh"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["source_ip"] == "35.188.49.176"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Meta["target_user"] == "pascal5"
results["s01-parse"]["crowdsecurity/sshd-logs"][20].Evt.Whitelisted == false
len(results["success"][""]) == 0
3 changes: 2 additions & 1 deletion .tests/sshd-logs/sshd-logs.log
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Feb 8 17:15:01 hostname sshd[1478159]: Connection reset by authenticating user r
2023-11-14T00:20:42.738197+01:00 myserver sshd[1112652]: User root from 192.168.1.1 not allowed because not listed in AllowUsers
Apr 6 18:51:41 eve sshd[2784424]: Failed password for invalid user root from 192.168.1.2 port 51182 ssh2
Jul 1 09:30:56 usbkey sshd[8807]: fatal: Timeout before authentication for 192.168.9.212 port 47056
Jul 2 11:32:16 instance-20240401-2335 sshd[309785]: ssh_dispatch_run_fatal: Connection from 192.168.9.213 port 48680: message authentication code incorrect [preauth]
Jul 2 11:32:16 instance-20240401-2335 sshd[309785]: ssh_dispatch_run_fatal: Connection from 192.168.9.213 port 48680: message authentication code incorrect [preauth]
Feb 12 14:10:24 sd-126005 sshd-session[16379]: Invalid user pascal5 from 35.188.49.176 port 53502
2 changes: 1 addition & 1 deletion parsers/s01-parse/crowdsecurity/sshd-logs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
onsuccess: next_stage
#debug: true
filter: "evt.Parsed.program == 'sshd'"
filter: "evt.Parsed.program in ['sshd-session', 'sshd']"
name: crowdsecurity/sshd-logs
description: "Parse openSSH logs"
pattern_syntax:
Expand Down

0 comments on commit c9c4fd0

Please sign in to comment.