sudo cscli collections install crowdsecurity/pfsenseInstalls 10 parsers and 56 scenarios, via Nginx - Generic Protection.
View pfSense →sudo cscli parsers install crowdsecurity/nginx-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.
filter: "evt.Parsed.program startsWith 'nginx'"onsuccess: next_stagename: crowdsecurity/nginx-logsdescription: "Parse nginx access and error logs"pattern_syntax:NGCUSTOMUSER: '[a-zA-Z0-9\.\@\-\+_%]+'NGCUSTOMURIPATH: "(?:/[A-Za-z0-9$.+!*'\\(\\)\\{\\},~:;=@\\#%&_\\-]*)+"NGCUSTOMURIPATHPARAM: '%{NGCUSTOMURIPATH}(?:%{URIPARAM})?'NPMPLUSFQDN: '%{IPORHOST}||%{DATA}'NGCACHESTATUS: 'HIT|MISS|BYPASS|EXPIRED|STALE|UPDATING|REVALIDATED|-'NUM_OR_DASH: '-|\d*'nodes:- grok:pattern: '(%{IPORHOST:target_fqdn}(:%{INT:port})? )?%{IPORHOST:remote_addr} - (%{NGCUSTOMUSER:remote_user} )?\[%{HTTPDATE:time_local}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:http_version}" %{NUMBER:status} %{NUMBER:body_bytes_sent} "%{NOTDQUOTE:http_referer}" "%{NOTDQUOTE:http_user_agent}"( %{NUMBER:request_length} %{NUMBER:request_time} \[%{DATA:proxy_upstream_name}\] \[%{DATA:proxy_alternative_upstream_name}\])?'apply_on: messagestatics:- meta: log_typevalue: http_access-log- target: evt.StrTimeexpression: evt.Parsed.time_local- grok:# and this one the error logpattern: '(%{IPORHOST:target_fqdn} )?%{NGINXERRTIME:time} \[%{LOGLEVEL:loglevel}\] %{NONNEGINT:pid}#%{NONNEGINT:tid}: (\*%{NONNEGINT:cid} )?%{GREEDYDATA:message}, client: %{IPORHOST:remote_addr}, server: %{DATA:target_fqdn}, request: "%{WORD:verb} ([^/]+)?%{NGCUSTOMURIPATHPARAM:request}( HTTP/%{NUMBER:http_version})?", host: "%{IPORHOST}(:%{NONNEGINT})?"'apply_on: messagestatics:- meta: log_typevalue: http_error-log- target: evt.StrTimeexpression: evt.Parsed.timepattern_syntax:NO_DOUBLE_QUOTE: '[^"]+'onsuccess: next_stagenodes:- filter: "evt.Parsed.message contains 'was not found in'"pattern_syntax:USER_NOT_FOUND: 'user "%{NO_DOUBLE_QUOTE:username}" was not found in "%{NO_DOUBLE_QUOTE}"'grok:pattern: '%{USER_NOT_FOUND}'apply_on: messagestatics:
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
A generic parser for nginx, support both access and error logs. This parser support also ingress nginx controller default log_format
*note : * 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.