sudo cscli collections install crowdsecurity/apiscpInstalls 9 parsers and 56 scenarios, via Apache2 - Generic Protection.
View ApisCP →sudo cscli parsers install crowdsecurity/apache2-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.
#Apache access/errors logs#debug: truefilter: "evt.Parsed.program startsWith 'apache2'"onsuccess: next_stagename: crowdsecurity/apache2-logsdescription: "Parse Apache2 access and error logs"#log line can be prefixed by a target_fqdnnodes:- grok:pattern: '(%{IPORHOST:target_fqdn}(:%{INT:port})? )?%{COMMONAPACHELOG}( "%{NOTDQUOTE:referrer}" "%{NOTDQUOTE:http_user_agent}")?'apply_on: message# these ones apply for both grok patternsstatics:- meta: log_typevalue: http_access-log- target: evt.StrTimeexpression: evt.Parsed.timestamp- meta: servicevalue: http- meta: source_ipexpression: evt.Parsed.clientip- meta: http_statusexpression: evt.Parsed.response- meta: http_pathexpression: "evt.Parsed.request != '' ? evt.Parsed.request : evt.Parsed.rawrequest"- meta: http_verbexpression: "evt.Parsed.verb"- meta: http_user_agentexpression: "evt.Parsed.http_user_agent"- meta: target_fqdnexpression: "evt.Parsed.target_fqdn"onsuccess: next_stage- grok:pattern: '%{HTTPD_ERRORLOG}'apply_on: messageonsuccess: next_stagepattern_syntax:NOT_DOUBLE_POINT: '[^:]+'NOT_DOUBLE_QUOTE: '[^"]+'nodes:
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
This apache2 parser support access and error logs in the HTTPD COMBINED LOG standard format, with the following possible modifications :
target_fqdn. This is meant for multi-tenant / aggregated logs.referrer and user_agent have been made optional for more epurated logging formatsnote : If you are aggregating logs from several domains, prefix your logline with the target FQDN. HTTP based scenarios should take this into account so that buckets are per source IP per target FQDN, limiting false positives due to logs multiplexing.