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

enhance: support tls protocol in asterisk logs #1124

Merged
merged 2 commits into from
Oct 2, 2024
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
8 changes: 6 additions & 2 deletions .index.json
Original file line number Diff line number Diff line change
Expand Up @@ -6640,7 +6640,7 @@
"crowdsecurity/asterisk-logs": {
"path": "parsers/s01-parse/crowdsecurity/asterisk-logs.yaml",
"stage": "s01-parse",
"version": "0.4",
"version": "0.5",
"versions": {
"0.1": {
"digest": "6c32f0c5c37b86d83b35c9c90aee2550b8c2d59748a31bd2ba95842be35bf031",
Expand All @@ -6657,10 +6657,14 @@
"0.4": {
"digest": "9679a5939331f6d40527c715e112cc5df7619374213801a57542712a7f305945",
"deprecated": false
},
"0.5": {
"digest": "1a3d1f0f9808428c88bbff7d88c73ef3816a4465f2a8948bd1c95c156334f2ea",
"deprecated": false
}
},
"long_description": "UGFyc2VyIGZvciBhc3RlcmlzayBsb2dzIChwYXJzZSBvbmx5IGZhaWxlZCBhdXRoZW50aWNhdGlvbiBsb2dzIGZvciB0aGUgbW9tZW50KS4=",
"content": "bmFtZTogY3Jvd2RzZWN1cml0eS9hc3Rlcmlzay1sb2dzCmRlc2NyaXB0aW9uOiAiUGFyc2UgQXN0ZXJpc2sgbG9ncyIKZmlsdGVyOiAiZXZ0LlBhcnNlZC5wcm9ncmFtID09ICdhc3RlcmlzayciCm9uc3VjY2VzczogbmV4dF9zdGFnZQpub2RlczoKICAtIGdyb2s6CiAgICAgIHBhdHRlcm46ICcoXFsle0RBVEE6dGltZXN0YW1wfVxdICk/U0VDVVJJVFlcWyV7TlVNQkVSfVxdLiogU2VjdXJpdHlFdmVudD0iSW52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VExTKS8le0lQT1JIT1NUOnRhcmdldF9pcH0vJXtOVU1CRVI6dGFyZ2V0X3BvcnR9IixSZW1vdGVBZGRyZXNzPSJJUFYle05VTUJFUn0vKFVEUHxUQ1B8VExTKS8le0lQT1JIT1NUOnNvdXJjZV9pcH0vJXtOVU1CRVI6c291cmNlX3BvcnR9IicKICAgICAgYXBwbHlfb246IG1lc3NhZ2UKICAgICAgc3RhdGljczoKICAgICAgICAtIG1ldGE6IGxvZ190eXBlCiAgICAgICAgICB2YWx1ZTogYXN0ZXJpc2tfZmFpbGVkX2F1dGgKICAgICAgICAtIHRhcmdldDogZXZ0LlN0clRpbWUKICAgICAgICAgIGV4cHJlc3Npb246IGV2dC5QYXJzZWQudGltZXN0YW1wCiAgICAgICAgLSBtZXRhOiB0YXJnZXRfdXNlcgogICAgICAgICAgZXhwcmVzc2lvbjogZXZ0LlBhcnNlZC51c2VybmFtZQogICAgICAgIC0gbWV0YTogc2Vzc2lvbl9pZAogICAgICAgICAgZXhwcmVzc2lvbjogZXZ0LlBhcnNlZC5hc3Rlcmlza19zZXNzaW9uX2lkCiAgICAgICAgLSBtZXRhOiBhc3Rlcmlza19zZXJ2aWNlCiAgICAgICAgICBleHByZXNzaW9uOiBldnQuUGFyc2VkLmFzdGVyaXNrX3NlcnZpY2UKc3RhdGljczoKICAgIC0gbWV0YTogc2VydmljZQogICAgICB2YWx1ZTogYXN0ZXJpc2sKICAgIC0gbWV0YTogc291cmNlX2lwCiAgICAgIGV4cHJlc3Npb246IGV2dC5QYXJzZWQuc291cmNlX2lwCg==",
"description": "Parse Asterisk logs",
"author": "crowdsecurity",
"labels": null
Expand Down
2 changes: 1 addition & 1 deletion .tests/asterisk-bf/asterisk-bf.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
[Dec 21 12:57:02] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2021-12-21T12:57:01.209+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/54784",Challenge="1640091422/edc27724b23967f2cb58e348c4e578eb",Response="3b0bbeda2ac7623e8f39fd45cacd9ca0",ExpectedResponse=""
[Dec 21 12:57:03] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2021-12-21T12:57:01.209+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/54784",Challenge="1640091422/edc27724b23967f2cb58e348c4e578eb",Response="3b0bbeda2ac7623e8f39fd45cacd9ca0",ExpectedResponse=""
[Dec 21 12:57:04] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2021-12-21T12:57:01.209+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/54784",Challenge="1640091422/edc27724b23967f2cb58e348c4e578eb",Response="3b0bbeda2ac7623e8f39fd45cacd9ca0",ExpectedResponse=""
[Dec 21 12:57:04] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2021-12-21T12:57:01.209+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/54784",Challenge="1640091422/edc27724b23967f2cb58e348c4e578eb",Response="3b0bbeda2ac7623e8f39fd45cacd9ca0",ExpectedResponse=""
[Dec 21 12:57:04] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2021-12-21T12:57:01.209+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/TLS/172.17.0.2/5061",RemoteAddress="IPV4/TLS/172.17.0.1/54784",Challenge="1640091422/edc27724b23967f2cb58e348c4e578eb",Response="3b0bbeda2ac7623e8f39fd45cacd9ca0",ExpectedResponse=""
1 change: 1 addition & 0 deletions .tests/asterisk-logs/asterisk-logs.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[Dec 21 12:56:59] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="InvalidAccountID",EventTV="2021-12-21T12:56:59.192+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/55287"
[Dec 21 12:57:00] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2021-12-21T12:57:00.209+0000",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="6001",SessionID="2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/54784",Challenge="1640091422/edc27724b23967f2cb58e348c4e578eb",Response="3b0bbeda2ac7623e8f39fd45cacd9ca0",ExpectedResponse=""
[Mar 6 08:44:27] SECURITY[1310] res_security_log.c: SecurityEvent="InvalidPassword",EventTV="2022-03-06T08:44:27.151+1100",Severity="Error",Service="SIP",EventVersion="2",AccountID="6001",SessionID="0x7fa52803a000",LocalAddress="IPV4/UDP/172.17.0.2/5060",RemoteAddress="IPV4/UDP/172.17.0.1/56433",Challenge="62790d2c",ReceivedChallenge="62790d2c",ReceivedHash="c3b9d05b8f36265eb89edee60aad693a"
[Mar 6 08:44:25] SECURITY[1310] res_security_log.c: SecurityEvent="InvalidPassword",EventTV="2022-03-06T08:44:25.151+1100",Severity="Error",Service="SIP",EventVersion="2",AccountID="6001",SessionID="0x7fa52803a000",LocalAddress="IPV4/TLS/172.17.0.2/5061",RemoteAddress="IPV4/TLS/172.17.0.1/56433",Challenge="62790d2c",ReceivedChallenge="62790d2c",ReceivedHash="c3b9d05b8f36265eb89edee60aad693a"
8 changes: 4 additions & 4 deletions .tests/asterisk-logs/parser.assert
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
len(results) == 4
len(results["s00-raw"]["crowdsecurity/non-syslog"]) == 3
len(results["s00-raw"]["crowdsecurity/non-syslog"]) == 4
results["s00-raw"]["crowdsecurity/non-syslog"][0].Success == true
results["s00-raw"]["crowdsecurity/non-syslog"][0].Evt.Parsed["message"] == "[Dec 21 12:56:59] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent=\"InvalidAccountID\",EventTV=\"2021-12-21T12:56:59.192+0000\",Severity=\"Error\",Service=\"PJSIP\",EventVersion=\"1\",AccountID=\"6001\",SessionID=\"2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX\",LocalAddress=\"IPV4/UDP/172.17.0.2/5060\",RemoteAddress=\"IPV4/UDP/172.17.0.1/55287\""
results["s00-raw"]["crowdsecurity/non-syslog"][0].Evt.Parsed["program"] == "asterisk"
Expand All @@ -15,11 +15,11 @@ results["s00-raw"]["crowdsecurity/non-syslog"][2].Evt.Parsed["message"] == '[Mar
results["s00-raw"]["crowdsecurity/non-syslog"][2].Evt.Parsed["program"] == "asterisk"
results["s00-raw"]["crowdsecurity/non-syslog"][2].Evt.Meta["datasource_path"] == "asterisk-logs.log"
results["s00-raw"]["crowdsecurity/non-syslog"][2].Evt.Meta["datasource_type"] == "file"
len(results["s00-raw"]["crowdsecurity/syslog-logs"]) == 3
len(results["s00-raw"]["crowdsecurity/syslog-logs"]) == 4
results["s00-raw"]["crowdsecurity/syslog-logs"][0].Success == false
results["s00-raw"]["crowdsecurity/syslog-logs"][1].Success == false
results["s00-raw"]["crowdsecurity/syslog-logs"][2].Success == false
len(results["s01-parse"]["crowdsecurity/asterisk-logs"]) == 3
len(results["s01-parse"]["crowdsecurity/asterisk-logs"]) == 4
results["s01-parse"]["crowdsecurity/asterisk-logs"][0].Success == true
results["s01-parse"]["crowdsecurity/asterisk-logs"][0].Evt.Parsed["message"] == "[Dec 21 12:56:59] SECURITY[77]: res_security_log.c:114 security_event_stasis_cb: SecurityEvent=\"InvalidAccountID\",EventTV=\"2021-12-21T12:56:59.192+0000\",Severity=\"Error\",Service=\"PJSIP\",EventVersion=\"1\",AccountID=\"6001\",SessionID=\"2kOigHiNhyip1cGGyzdgMkqKV9a0F_G7kVfGdCUA12qsTwyHlQox1T7LSWAX\",LocalAddress=\"IPV4/UDP/172.17.0.2/5060\",RemoteAddress=\"IPV4/UDP/172.17.0.1/55287\""
results["s01-parse"]["crowdsecurity/asterisk-logs"][0].Evt.Parsed["source_ip"] == "172.17.0.1"
Expand Down Expand Up @@ -80,7 +80,7 @@ results["s01-parse"]["crowdsecurity/asterisk-logs"][2].Evt.Meta["datasource_type
results["s01-parse"]["crowdsecurity/asterisk-logs"][2].Evt.Meta["log_type"] == "asterisk_failed_auth"
results["s01-parse"]["crowdsecurity/asterisk-logs"][2].Evt.Meta["service"] == "asterisk"
results["s01-parse"]["crowdsecurity/asterisk-logs"][2].Evt.Meta["session_id"] == "0x7fa52803a000"
len(results["s02-enrich"]["crowdsecurity/dateparse-enrich"]) == 3
len(results["s02-enrich"]["crowdsecurity/dateparse-enrich"]) == 4
results["s02-enrich"]["crowdsecurity/dateparse-enrich"][0].Success == true
results["s02-enrich"]["crowdsecurity/dateparse-enrich"][0].Evt.Parsed["source_port"] == "55287"
results["s02-enrich"]["crowdsecurity/dateparse-enrich"][0].Evt.Parsed["target_ip"] == "172.17.0.2"
Expand Down
3 changes: 2 additions & 1 deletion .tests/asterisk-syslogs/asterisk-logs.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Jul 08 22:25:10 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114
Jul 08 22:55:41 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114 in security_event_stasis_cb: SecurityEvent="InvalidAccountID",EventTV="2024-07-08T22:55:41.434-0600",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="kiwi",SessionID="a79da57d-7fc3-440c-aca8-72afcdb600b8",LocalAddress="IPV4/TCP/192.168.100.62/5060",RemoteAddress="IPV4/TCP/192.168.100.12/46417"
Jul 08 22:55:41 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114 in security_event_stasis_cb: SecurityEvent="ChallengeSent",EventTV="2024-07-08T22:55:41.434-0600",Severity="Informational",Service="PJSIP",EventVersion="1",AccountID="<unknown>",SessionID="a79da57d-7fc3-440c-aca8-72afcdb600b8",LocalAddress="IPV4/TCP/192.168.100.62/5060",RemoteAddress="IPV4/TCP/192.168.100.12/46417",Challenge=""
Jul 08 22:55:41 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114 in security_event_stasis_cb: SecurityEvent="InvalidAccountID",EventTV="2024-07-08T22:55:41.470-0600",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="kiwi",SessionID="a79da57d-7fc3-440c-aca8-72afcdb600b8",LocalAddress="IPV4/TCP/192.168.100.62/5060",RemoteAddress="IPV4/TCP/192.168.100.12/46417"
Jul 08 22:55:41 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114 in security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2024-07-08T22:55:41.470-0600",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="<unknown>",SessionID="a79da57d-7fc3-440c-aca8-72afcdb600b8",LocalAddress="IPV4/TCP/192.168.100.62/5060",RemoteAddress="IPV4/TCP/192.168.100.12/46417",Challenge="1720500941/6d51e429179e8eb334e121cbdcb4c74a",Response="1c672c6aa470212c9c8b57bb53a090c8",ExpectedResponse=""
Jul 08 22:55:41 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114 in security_event_stasis_cb: SecurityEvent="ChallengeResponseFailed",EventTV="2024-07-08T22:55:41.470-0600",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="<unknown>",SessionID="a79da57d-7fc3-440c-aca8-72afcdb600b8",LocalAddress="IPV4/TCP/192.168.100.62/5060",RemoteAddress="IPV4/TCP/192.168.100.12/46417",Challenge="1720500941/6d51e429179e8eb334e121cbdcb4c74a",Response="1c672c6aa470212c9c8b57bb53a090c8",ExpectedResponse=""
Jul 08 22:55:41 alba asterisk[112836]: SECURITY[112882]: res_security_log.c:114 in security_event_stasis_cb: SecurityEvent="InvalidAccountID",EventTV="2024-07-08T22:55:41.434-0600",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="kiwi",SessionID="a79da57d-7fc3-440c-aca8-72afcdb600b8",LocalAddress="IPV4/TLS/192.168.100.62/5061",RemoteAddress="IPV4/TLS/192.168.100.12/46417"
Loading