sudo cscli collections install LazarisIRL/rommInstalls 1 parser and 1 scenario.
View romm →sudo cscli parsers install LazarisIRL/romm-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: "evt.Parsed.program == 'romm'"name: LazarisIRL/romm-logsdescription: "Parse RomM Logs"pattern_syntax:DATE_YMD: "%{YEAR:year}-%{MONTHNUM:month}-%{MONTHDAY:day}"nodes:- grok:pattern: '^%{WORD:log_level}:\s+\[%{WORD:app}\]\[%{WORD:service}\]\[%{DATE_YMD:date} %{TIME:time}\]\s+%{IP:peer_ip} \| %{DATA:forwarded_for} \| %{WORD:http_method} /api/(login|token)/?(\?\S*)? (401|403|429) \|.*$'apply_on: messagestatics:- meta: log_typevalue: romm_failed_authentication- target: evt.Parsed.timestampexpression: "evt.Parsed.date + ' ' + evt.Parsed.time"onsuccess: next_stagestatics:- meta: servicevalue: romm- meta: source_ipexpression: |let trusted = ["127.0.0.0/8", "::1/128", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10", "fc00::/7"];let peer = evt.Parsed.peer_ip;let hops = evt.Parsed.forwarded_for in ["", "-"] ? [] : map(Split(evt.Parsed.forwarded_for, ","), TrimSpace(#));let untrusted = filter(hops, {let ip = #; none(trusted, IpInRange(ip, #))});any(trusted, IpInRange(peer, #)) && len(untrusted) > 0 ? untrusted[-1] : peer- target: evt.StrTimeexpression: "evt.Parsed.timestamp"
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
Parser for RomM logs.
To use the docker socket directly, ensure CrowdSec has access to the Docker socket (/var/run/docker.sock)
1source: docker2container_name:3 - romm4labels:5 type: romm
If you are using file-based acquisition, you will need to add the following to your RomM docker-compose.yaml in order to write the logs to a file:
1command: sh -c "/init 2>&1 | tee /path/to/romm.log"
Then add:
1filenames:2 - /path/to/romm.log3labels:4 type: romm
RomM logs both the peer address and the raw X-Forwarded-For header. If the peer is a private address, the parser assumes it is a reverse proxy and uses the rightmost public IP from X-Forwarded-For. Otherwise it uses the peer address.
This only works if the proxy in front of RomM appends the real client IP to X-Forwarded-For (nginx $proxy_add_x_forwarded_for, Traefik and Caddy do this by default). The header can be spoofed, or the wrong IP banned, when:
docker-proxy, LAN/VPN/Tailscale clients)This should ideally be fixed on the RomM side: its bundled nginx should resolve the client IP itself (real_ip module with a configurable list of trusted proxies) and log only that address.