Closed bughunter2 closed 5 months ago
@bughunter2: Thanks for opening an issue, it is currently awaiting triage.
In the meantime, you can:
Hello,
Looking at the version number of crowdsec, it seems that you are using the packages available in your distro repository. I cannot reproduce the issue with either the latest crowdsec + firewall bouncer version installed from our own repositories OR with a manual build on a debian 12 of crowdsec 1.4.6 and firewall bouncer 0.0.25 (which are the version shipped in debian), which would indicate the issue is coming specifically from the debian build.
The easiest fix for you would be to switch to our repositories (https://docs.crowdsec.net/docs/next/getting_started/install_crowdsec), that way you will be able to install much more recent and "known to work" versions.
Now, for the issue itself, it seems like it's coming from the firewall bouncer: when I manually add a decision in crowdsec and query LAPI directly, I see the proper IP in the stream, so the only place for the IP to get reversed is inside the bouncer itself. I'll try to contact the debian package maintainer to see if he has any idea where this could come from.
(I'm also moving the issue to the firewall bouncer repository, and I'll leave it open for now just for tracking purposes)
@bughunter2: Thanks for opening an issue, it is currently awaiting triage.
In the meantime, you can:
@bughunter2: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.
/kind feature
/kind enhancement
/kind bug
/kind packaging
Thanks for filing/forwarding the report, I'm able to reproduce this on my bookworm/amd64 system and I'm equally surprised and ashamed to have missed it until today…
That's likely an issue in the google/nftables module, and there's an issue + associated commit that looks promising:
I'll check what happens when I cherry-pick that in the Debian package, and rebuild the bouncer against it. If that helps, I'll upload the package to unstable and request a rebuild of the bouncer (or perform an upload if there are other changes to include along the way). Then I'll file a request to get that updated in stable as well (plus a rebuild).
Sorry about that…
I've just opened https://bugs.debian.org/1071247 for tracking purposes.
TL;DR: Applying the aforementioned patch and rebuilding the bouncer against it fixes the issue on LE systems, and doesn't regress on BE systems. I'll coordinate remediation with the security team (if that warrants a DSA) or with the release team (if it doesn't).
I haven't heard back from the security team yet, but I've just uploaded both packages (golang-github-google-nftables
and crowdsec-firewall-bouncer
) to unstable
, which urgency=high
. Hopefully they'll reach testing
soon.
As for bookworm
, I've published rebuilds of both packages with version numbers that match what would be used for bookworm-security
or bookworm-proposed-updates
in a custom repository, which can be configured with:
deb [trusted=yes] https://crowdsec.apt.debamax.com/debian bookworm main
(The signing key is available at that URL if you wish to configure it.)
The Debian security team decided this didn't warrant a security announcement, and that we should get this fixed via the upcoming point release instead: following a green light from the release team, I've just uploaded both packages. They should be available shortly in the bookworm-proposed-updates
repository, and be merged into the bookworm
one during the 12.6 point release, scheduled at the end of the month.
Packages have been accepted, built, and published in bookworm-proposed-updates
:
kibi@tokyo:~$ apt-cache policy crowdsec-firewall-bouncer
crowdsec-firewall-bouncer:
Installed: (none)
Candidate: 0.0.25-4~deb12u1
Version table:
→ 0.0.25-4~deb12u1 500
→ 500 http://deb.debian.org/debian bookworm-proposed-updates/main amd64 Packages
0.0.25-3 500
500 http://deb.debian.org/debian bookworm/main amd64 Packages
(The fixed version is highlighted with arrows.)
Thank you @CyrilBrulebois for all the updates on the matter, as this seems to be backported and fixed can we class the issue as resolved. Feel free @bughunter2 to unresolved the issue if this doesn't satisfy as a resolution.
What happened?
What did you expect to happen?
That there's no mismatch between the IPv4 and IPv6 addresses returned by the CrowdSec servers, what the crowdsec-firewall-bouncer.log file shows, and what nftables shows (nft list ruleset). They should all be in agreement.
How can we reproduce it (as minimally and precisely as possible)?
See above.
Anything else we need to know?
No response
Crowdsec version
OS version
Enabled collections and parsers
Acquisition config
Config show
Prometheus metrics
Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.