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

failing to setup a basic firewall #158

Closed
anarcat opened this issue Jan 26, 2023 · 3 comments · Fixed by #162
Closed

failing to setup a basic firewall #158

anarcat opened this issue Jan 26, 2023 · 3 comments · Fixed by #162

Comments

@anarcat
Copy link
Contributor

anarcat commented Jan 26, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.21.0-2
  • Ruby: 3.1
  • Distribution: Debian bookworm/testing
  • Module version: 2.6.0

How to reproduce (e.g Puppet code you use)

node default {
  include nftables::rules::out::all
  include nftables::rules::ssh
}

What are you seeing

no table or ruleset created.

What behaviour did you expect instead

some magic rules allowing outgoing connexions and incoming on port 22.

Output log

anarcat@curie:nftables$ sudo pat
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
[...]
Info: Caching catalog for curie.anarc.at
Info: Applying configuration version '1674770130'
Warning: /Stage[main]/Nftables::Rules::Out::All/Nftables::Rule[default_out-all]/Concat::Fragment[nftables-inet-filter-chain-default_out-rule-all_header]/Concat_fragment[nftables-inet-filter-chain-default_out-rule-all_header]: Target Concat_file with path or title 'nftables-inet-filter-chain-default_out' or tag 'nftables-inet-filter-chain-default_out not found in the catalog
Warning: /Stage[main]/Nftables::Rules::Out::All/Nftables::Rule[default_out-all]/Concat::Fragment[nftables-inet-filter-chain-default_out-rule-all]/Concat_fragment[nftables-inet-filter-chain-default_out-rule-all]: Target Concat_file with path or title 'nftables-inet-filter-chain-default_out' or tag 'nftables-inet-filter-chain-default_out not found in the catalog
Warning: /Stage[main]/Nftables::Rules::Ssh/Nftables::Rule[default_in-ssh]/Concat::Fragment[nftables-inet-filter-chain-default_in-rule-ssh_header]/Concat_fragment[nftables-inet-filter-chain-default_in-rule-ssh_header]: Target Concat_file with path or title 'nftables-inet-filter-chain-default_in' or tag 'nftables-inet-filter-chain-default_in not found in the catalog
Warning: /Stage[main]/Nftables::Rules::Ssh/Nftables::Rule[default_in-ssh]/Concat::Fragment[nftables-inet-filter-chain-default_in-rule-ssh]/Concat_fragment[nftables-inet-filter-chain-default_in-rule-ssh]: Target Concat_file with path or title 'nftables-inet-filter-chain-default_in' or tag 'nftables-inet-filter-chain-default_in not found in the catalog
Notice: Applied catalog in 13.73 seconds

Any additional information you'd like to impart

I guess this is probably me just not understanding how this module (or nftable) works, but maybe a simple EXAMPLES section in the readme could help alleviate this kind of problems.

Alternatively, wth is going on here? :)

@anarcat
Copy link
Contributor Author

anarcat commented Jan 26, 2023

turns out you just need to include nftables, surprised that those classes don't all do that on their own. i wonder if this is a documentation issue or if the rules classes should include nftables as well...

@nbarrientos
Copy link
Collaborator

nbarrientos commented Jan 27, 2023

Hi,

I know it's not exactly user-oriented but the acceptance tests could hint on how to use the module.

We can add a note to the README to make it more explicit but I'd say that the fact that users are expected to include nftables will continue to be the case.

@anarcat
Copy link
Contributor Author

anarcat commented Jan 27, 2023 via email

anarcat added a commit to anarcat/puppet-nftables that referenced this issue Jan 30, 2023
I couldn't figure out how to use this module when I looked at the
README. It was quickly going into pretty arcane stuff like "inet
filter" and "ip nat table" which might make sense for the module
authors or people used to nftables/iptables, but are pretty
implementation specific when coming from another networking
background.

Instead, we just explain more clearly what the module does, and
how. We also provide *more* examples, including some that might seem
obvious ("you need to include nftables first") but were not obvious to
me at all.

I also add a warning about firewalld being stopped which seems
important as well.

Closes: voxpupuli#158
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 a pull request may close this issue.

2 participants