Skip to content
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

Support new nftables configuration design #325

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

g00g1
Copy link

@g00g1 g00g1 commented Sep 10, 2023

As proposed at issue 153, I have implemented the following configuration design:

nftables:
    enabled: true
    targets:
    - blacklist: crowdsec-blacklist4
      set-only: false
      table: crowdsec-inet
      chain: crowdsec-input
      family: inet
      protocol: ip
      hook: input
    - blacklist: crowdsec-blacklist6
      set-only: false
      table: crowdsec-inet
      chain: crowdsec-input
      family: inet
      protocol: ip6
      hook: input

I have already tested it on my crowdsec station, however if there still any issues please let me know!

@mmetc mmetc self-assigned this Sep 20, 2023
@mmetc
Copy link
Contributor

mmetc commented Oct 3, 2023

Hi!

Thanks for the contribution, we released a long overdue stable version yesterday, so will review this for the next one, which shouldn't take as much

@ne20002
Copy link

ne20002 commented Feb 14, 2024

How do I define that I want input and forward hook?

@g00g1
Copy link
Author

g00g1 commented Feb 14, 2024

@ne20002, something like this

nftables:
    enabled: true
    targets:
    - blacklist: crowdsec-blacklist
      set-only: false
      table: crowdsec-inet
      chain: crowdsec-input
      family: inet
      protocol: ip
      hook: input
    - blacklist: crowdsec-blacklist
      set-only: false
      table: crowdsec-inet
      chain: crowdsec-input
      family: inet
      protocol: ip
      hook: forward

@ne20002
Copy link

ne20002 commented Feb 15, 2024

How is that working with set-only true? In that case only one entry is required?

@g00g1
Copy link
Author

g00g1 commented Feb 16, 2024

How is that working with set-only true? In that case only one entry is required?

@ne20002, you may have as much entries as required for your use case. For example, you may have duplicated sets in different tables or both in inet and ip4/ip6 tables for whatever reason. The new configuration design is extremely flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants