sudo cscli collections install crowdsecurity/nextcloudInstalls 2 parsers and 1 scenario.
View Nextcloud - Bruteforce Protection →sudo cscli parsers install crowdsecurity/nextcloud-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.
---onsuccess: next_stagefilter: "Upper(evt.Parsed.program) == 'NEXTCLOUD'"name: crowdsecurity/nextcloud-logsdescription: "Parse nextcloud logs"pattern_syntax:NEXTCLOUD_USER: '[a-zA-Z0-9\.\@\-\+_%]+'nodes:- grok:pattern: 'Login failed: ''?%{NEXTCLOUD_USER:target_user}''? \(Remote IP: ''?%{IP:source_ip}''?\)'expression: JsonExtract(evt.Parsed.message, "message")statics:- meta: target_userexpression: "evt.Parsed.target_user"- meta: log_typevalue: nextcloud_failed_auth- grok:pattern: 'Bruteforce attempt from \\?"%{IP:source_ip}\\?" detected for action \\?"%{DATA:action}\\?"'expression: JsonExtract(evt.Parsed.message, "message")statics:- meta: actionexpression: "evt.Parsed.action"- meta: log_typevalue: nextcloud_bruteforce_attempt#{"reqId":"dCA39mNG3NHLwbibVCFp","level":1,"time":"2023-02-14T17:28:33+00:00","remoteAddr":"172.18.0.200","user":"--","app":"core","method":"GET","url":"/","message":"Trusted domain error. \"172.18.0.200\" tried to access using \"kloot.ronsmans.eu\" as host.","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0","version":"25.0.3.2","data":{"app":"core"}}- grok:pattern: 'Trusted domain error. \\"%{IP:source_ip}\\".*'expression: JsonExtract(evt.Parsed.message, "message")statics:- meta: log_typevalue: nextcloud_domain_errorstatics:- meta: servicevalue: nextcloud- meta: source_ipexpression: "evt.Parsed.source_ip"- 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 Nextcloud logs
If you have the default setting of logging to file, you need to add in acquisition (change filename to your log file location):
1---2filenames:3 - /var/www/nextcloud/data/nextcloud.log4labels:5 type: Nextcloud
If you are sending logs to syslog or systemd and read from journald, add:
1---2source: journalctl3journalctl_filter:4 - "SYSLOG_IDENTIFIER=Nextcloud"5labels:6 type: syslog