-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nftables set for ip6 in ip table #335
Comments
@derbasti381: Thanks for opening an issue, it is currently awaiting triage. In the meantime, you can:
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
Moving over to firewall repository as issue is not from CrowdSec Security Engine |
Debugging cs-firewall-bouncer/pkg/nftables/nftables_context.go Lines 128 to 164 in af6e7e2
Issue happens in setonly function, we only interact with the conn (ipv4) chain rather than conn6 (ipv6) Need to debug further as, technically we shouldn't even bother adding addr type v6 to ip chain as it has no value edit edit: will spin up a vm to test shortly |
Hello guys, it's been a while since I posted this bug, but no activity yet. It doesn't seem too complicated to me. Is someone willing to check this? Thanks a lot |
Hey 👋🏻 I checked and only get access to these IP types based on nftables lib we use from Google https://github.com/google/nftables/blob/ef45dd3322d6742ea14356317afa1c19b4e0a505/set.go#L80-L81 Same for family types https://github.com/google/nftables/blob/ef45dd3322d6742ea14356317afa1c19b4e0a505/table.go#L36-L37 and this is what we set the v6 conn too cs-firewall-bouncer/pkg/nftables/nftables_context.go Lines 93 to 94 in 06416b4
So either it not exposed via the lib or missing 🤷🏻 |
Thanks for having another look. Am patiently waiting for someone digging. ;-) |
Same thing here.
Probably gonna have to research myself... |
It seems that using https://pkg.go.dev/github.com/google/nftables?utm_source=godoc#Conn.ListTablesOfFamily here's a oneliner fix PR #354 Test in our environment - works as intended now. |
What happened?
I wanted to try crowdsec for my local firewall which is based on nftables. I installed crowdsec-firewall-bouncer-nftables 0.0.28 on Debian and adjusted the configuration to only create the ip sets.
When I restart the service, this is what happens:
What did you expect to happen?
I expected the rule to be inserted in ip6, because as it goes to ip, it can never even be used by any ip6 flow.
add set ip6 mangle crowdsec6-blacklists { type ipv6_addr; flags timeout; }
would be the correct one. Even if i create the Set in ip6 before, it still get's added to ip only.How can we reproduce it (as minimally and precisely as possible)?
Apply nftables, restart firewall-bouncer
Anything else we need to know?
It would also be suitable to add both sets to inet. Like this both protocols could access the sets.
Crowdsec version
OS version
Enabled collections and parsers
Acquisition config
On Windows:
C:> Get-Content C:\ProgramData\CrowdSec\config\acquis.yaml
paste output here
Config show
Prometheus metrics
Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.
The text was updated successfully, but these errors were encountered: