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

Make custom_tables for nftables smarter #710

Open
pitkley opened this issue Jan 7, 2024 · 0 comments
Open

Make custom_tables for nftables smarter #710

pitkley opened this issue Jan 7, 2024 · 0 comments

Comments

@pitkley
Copy link
Owner

pitkley commented Jan 7, 2024

DFW has to be able to act on traffic when it traverses any one of the input or forward hooks. This can be achieved in one of three ways:

  1. Have no other tables that hook input or forward, leaving only DFW's table.

    This is not really feasible, because that would leave you with an entirely open firewall, at least until DFW has run.

  2. Ensure that any existing tables that hook input or forward don't drop the traffic before it reaches DFW's tables.

    This is not great if you want your input hook to have a drop policy, which I personally would always want, just to make sure I don't accidentally expose any port I didn't intend to expose.

  3. Let DFW know about any existing tables and chains that hook input or forward.

    This is what the custom_tables setting does and it give us the best of both worlds: we can ensure that DFW can correctly accept traffic it is responsible for while still being able to default drop traffic in the input hook.

It is fair to assume that most default nftables installations will have the inet table with chains that hook input and forward, so it would be nice if the user didn't have to specify the custom_tables configuration.

One way to not require the user to do this would be to run nft --json list ruleset within DFW, parse the JSON output and identify the chain that acts on the traffic first (i.e. the one with the highest priority value). DFW can then hook into these chains as it does when custom_tables is defined.

(Relates to #705.)

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

No branches or pull requests

1 participant