sudo cscli collections install crowdsecurity/asteriskInstalls 1 parser and 2 scenarios.
View Asterisk - Bruteforce Protection →sudo cscli parsers install crowdsecurity/asterisk-logsThen reload CrowdSec: sudo systemctl reload crowdsec
Sign in to see which of your engines run it →Hover a line or a note to see what each field does.
name: crowdsecurity/asterisk-logsdescription: "Parse Asterisk logs"filter: "evt.Parsed.program == 'asterisk'"onsuccess: next_stagenodes:- grok:pattern: '(\[%{DATA:timestamp}\] )?SECURITY\[%{NUMBER}\].* SecurityEvent="InvalidAccountID",EventTV="%{DATA:event_timestamp}",Severity="Error",Service="%{NOTDQUOTE:asterisk_service}",EventVersion="%{NUMBER}",AccountID="%{NOTDQUOTE:username}",SessionID="%{NOTDQUOTE:asterisk_session_id}",LocalAddress="IPV%{NUMBER}/(UDP|TCP|TLS)/%{IPORHOST:target_ip}/%{NUMBER:target_port}",RemoteAddress="IPV%{NUMBER}/(UDP|TCP|TLS)/%{IPORHOST:source_ip}/%{NUMBER:source_port}"'apply_on: messagestatics:- meta: log_typevalue: asterisk_failed_auth- target: evt.StrTimeexpression: evt.Parsed.timestamp- meta: target_userexpression: evt.Parsed.username- meta: session_idexpression: evt.Parsed.asterisk_session_id- meta: asterisk_serviceexpression: evt.Parsed.asterisk_service- grok:pattern: '(\[%{DATA:timestamp}\] )?SECURITY\[%{NUMBER}\].* SecurityEvent="ChallengeResponseFailed",EventTV="%{DATA:event_timestamp}",Severity="Error",Service="%{NOTDQUOTE:asterisk_service}",EventVersion="%{NUMBER}",AccountID="%{NOTDQUOTE:username}",SessionID="%{NOTDQUOTE:asterisk_session_id}",LocalAddress="IPV%{NUMBER}/(UDP|TCP|TLS)/%{IPORHOST:target_ip}/%{NUMBER:target_port}",RemoteAddress="IPV%{NUMBER}/(UDP|TCP|TLS)/%{IPORHOST:source_ip}/%{NUMBER:source_port}"'apply_on: messagestatics:- meta: log_typevalue: asterisk_failed_auth- target: evt.StrTimeexpression: evt.Parsed.timestamp- meta: target_userexpression: evt.Parsed.username- meta: session_idexpression: evt.Parsed.asterisk_session_id- meta: asterisk_serviceexpression: evt.Parsed.asterisk_service- grok:pattern: '(\[%{DATA:timestamp}\] )?SECURITY\[%{NUMBER}\].* SecurityEvent="InvalidPassword",EventTV="%{DATA:event_timestamp}",Severity="Error",Service="%{NOTDQUOTE:asterisk_service}",EventVersion="%{NUMBER}",AccountID="%{NOTDQUOTE:username}",SessionID="%{NOTDQUOTE:asterisk_session_id}",LocalAddress="IPV%{NUMBER}/(UDP|TCP|TLS)/%{IPORHOST:target_ip}/%{NUMBER:target_port}",RemoteAddress="IPV%{NUMBER}/(UDP|TCP|TLS)/%{IPORHOST:source_ip}/%{NUMBER:source_port}"'apply_on: messagestatics:- meta: log_typevalue: asterisk_failed_auth- target: evt.StrTime
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
Parser for asterisk logs (parse only failed authentication logs for the moment).