proxmox-logs parser does not handle ipv4 addresses that are being displayed as ipv6 ideally

Open Beginner friendly
#1,934 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@hrithiksaini99 is already working on this.

Since Nov 7, 2026.

  • #1996 by @hrithiksaini99 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
yaml
Domain
security

Research direction

Read parsers/s01-parse/fulljackz/proxmox-logs.yaml and inspect how it extracts the source IP from PVE daemon log entries. Check how the parser handles the ::ffff: IPv4-mapped form and whether its source IP output becomes an IPv4 address. Done means triggering a decision for the example address blocks the IPv4 connection without breaking parsing of other addresses.

Written by the indexing model from the issue text.

Description

Describe the bug
PVEdaemon reports ipV4 addresses as ipV6 addresses in its output, and thus when the proxmoxlogs.yaml parser (parsers/s01-parse/fulljackz/proxmox-logs.yaml, by @fulljackz ) processes the file, it uses the ipV6 rendering of the address to make a decision. Unfortunately, since the connection is coming in via ipv4, adding the ipv6 rendering of the address to the firewall does not actually block the connection.

However, parsing the log entry so that the ipv6 address is converted back to the ipv4 rendering of the IP does successfully block the connection.

To Reproduce
Install crowdsec on a server running PVE, install and configure crowdsec-firewall-bouncer-iptables, and connect to the machine via an ipv4 connection (my router blocks all ipv6 on my local network).

Attempt to log in via PVE's web interface, and note that the ip is reported in ipv6 format by the daemon (the sshd logs, by contrast, reports the ip from the very same machine in ipv4 format).

# journalctl --unit pvedaemon.service
Oct 12 16:53:23 prox1 pvedaemon[2978885]: authentication failure; rhost=::ffff:192.168.1.32 user=test@pam msg=no such user ('test@pam')

When enough failed login attempts to the PVE web interface occur to trigger a decision, that decision is logged with the ipv6 address


# cscli decisions list
╭────┬──────────┬────────────────────────┬──────────────────────┬────────┬─────────┬────┬────────┬────────────┬──────────╮
│ ID │  Source  │       Scope:Value      │        Reason        │ Action │ Country │ AS │ Events │ expiration │ Alert ID │
├────┼──────────┼────────────────────────┼──────────────────────┼────────┼─────────┼────┼────────┼────────────┼──────────┤
│ 2  │ crowdsec │ Ip:::ffff:192.168.1.32 │ fulljackz/proxmox-bf │ ban    │         │    │ 7      │ 3h11m35s   │ 3        │
╰────┴──────────┴────────────────────────┴──────────────────────┴────────┴─────────┴────┴────────┴────────────┴──────────╯

The decision is then logged to an ipset for blocking

# ipset list crowdsec6-blacklists-0
Name: crowdsec6-blacklists-0
Type: hash:net
Revision: 7
Header: family inet6 hashsize 1024 maxelem 131072 timeout 300 bucketsize 12 initval 0xdb910aff
Size in memory: 1336
References: 1
Number of entries: 1
Members:
::ffff:192.168.1.32 timeout 10533

But unfortunately, since the connection is coming in via ipv4, blocking the ipv6 address does not successfully block the connection. The login screen continues accepting login attempts.

Expected behavior
Either both ipv4 and ipv6 addresses should be blocked, or ipv4 addresses that are displaying as ipv6 should get filtered back to ipv4 addresses.

Additional context

An AI search resulted in suggesting switching

    - meta: source_ip
      expression: "evt.Parsed.client_ip"

to

    - meta: source_ip
      expression: "Split(evt.Parsed.client_ip, '::ffff:')[-1]"

and this indeed appears to fix the issue for me (as soon as the decision is triggered the PVE website becomes completely inaccessible), but I am not sure if it would create problems in other scenarios.

I am running v1.8.1 installed from the Crowdsec package repository on PVE 9.2.21

# cscli version
version: v1.8.1-debian-pragmatic-amd64-909b5157
# pveversion
pve-manager/9.2.21/4f6e0ac86f9e8c7f (running kernel: 7.0.2-6-pve)
Dominant language
Python
Stars
257
Forks
235
Avg merge
2d 10h
Merged PRs (30d)
26

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crowdsecurity/hub

All issues in crowdsecurity/hub

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.