Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root @ 7b9d6ffc

Nom Taille Révision Âge Auteur Commentaire
  .github c3f6e1ff plus de 4 ans Nacho Barrientos Use a separate job file
  .vscode ece9be27 plus de 4 ans tr Do PDK convert
  data ece9be27 plus de 4 ans tr Do PDK convert
  files 1a4f336e plus de 4 ans Gabriel Filion start declaring the 'global' chain with module ...
  lib 032387dc environ 4 ans Steve Traylen Add nftables.version to structured fact. ``` F...
  manifests 7b9d6ffc presque 4 ans Nacho Barrientos Allow creating a totally empty firewall By set...
  spec 7b9d6ffc presque 4 ans Nacho Barrientos Allow creating a totally empty firewall By set...
  templates 7b9d6ffc presque 4 ans Nacho Barrientos Allow creating a totally empty firewall By set...
  types 8c00b818 plus de 4 ans Nacho Barrientos Pull up rule regexp to type aliases
.editorconfig 206 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.fixtures.yml 287 octets 30462da1 plus de 4 ans Steve Traylen Reload rules atomically Background: The unit f...
.gitattributes 62 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.gitignore 227 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.gitlab-ci.yml 1,21 ko 8726ba4c plus de 4 ans tr Switch back to Ruby 2.5 ``` can't modify froze...
.msync.yml 39 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.overcommit.yml 1,3 ko 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.pdkignore 475 octets ece9be27 plus de 4 ans tr Do PDK convert
.pmtignore 351 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.puppet-lint.rc 11 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.rspec 31 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.rspec_parallel 18 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.rubocop.yml 174 octets 492ca838 plus de 4 ans Steve Traylen Disable Disable TrailingCommaInArguments early ...
.sync.yml 171 octets 09cba182 plus de 4 ans Steve Traylen Enable parameter_documentation lint The linter...
.yardopts 37 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
CHANGELOG.md 11,1 ko 804b96e4 environ 4 ans Nacho Barrientos Prepare release 1.3.0
Dockerfile 480 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
Gemfile 1,18 ko 09cba182 plus de 4 ans Steve Traylen Enable parameter_documentation lint The linter...
LICENSE 11,1 ko 44ac0a4e plus de 4 ans mh add license file
README.md 5,09 ko 7b9d6ffc presque 4 ans Nacho Barrientos Allow creating a totally empty firewall By set...
REFERENCE.md 39,4 ko 7b9d6ffc presque 4 ans Nacho Barrientos Allow creating a totally empty firewall By set...
Rakefile 2,18 ko 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
appveyor.yml 1,31 ko ece9be27 plus de 4 ans tr Do PDK convert
hiera.yaml 685 octets ece9be27 plus de 4 ans tr Do PDK convert
metadata.json 1,17 ko 42c426c1 environ 4 ans Tim Meusel puppetlabs/concat: Allow 7.x

Dernières révisions

# Date Auteur Commentaire
7b9d6ffc 2021-05-31 04:42 Nacho Barrientos

Allow creating a totally empty firewall

By setting `nftables::inet_filter` and `nftables::nat` to `false`
users can now start off from a totally empty firewall and add the
tables, chains and rules they'd like.

The default skeleton for inet-filter, ip-nat and ip6-nat is kept...

4937bed5 2021-04-27 02:15 Steve Traylen

Merge pull request #93 from cernops/ibarrien_saddr

Fix IPv4 source address type detection

bd8baa0f 2021-04-26 12:27 Nacho Barrientos

Fix IPv4 source address type detection

Before this patch, a rule like this:

```
nftables::simplerule { 'foo':
action => 'accept',
dport => 443,
proto => 'tcp4',
saddr => '192.168.1.10',
}
```

would incorrectly generate this rule:...

a8008e42 2021-04-21 10:56 Steve Traylen

Merge pull request #92 from traylenator/everything

Drop Puppet 5, puppetlabs/concat 7.x, puppetlabs/stdlib 7.x, camptocamp/systemd: 3.x

1eda6efa 2021-04-21 09:46 Steve Traylen

Rely on puppet 6 calling daemon-reload

Since Puppet 6 now there no need to explicitly
call `systemctl daemon-reload`.

ad042d5f 2021-04-21 09:39 Steve Traylen

Merge remote-tracking branch 'kenyon/bump-concat' into everything

42c426c1 2021-04-16 07:58 Tim Meusel

puppetlabs/concat: Allow 7.x

9b6d7f08 2021-04-16 07:57 Tim Meusel

puppetlabs/stdlib: Allow 7.x

af33f653 2021-04-16 07:56 Tim Meusel

camptocamp/systemd: allow 3.x

f82aaa5a 2021-03-26 09:32 Steve Traylen

Merge pull request #88 from cernops/dotfiles_yas_link

Amend link to Yasnippets

Voir toutes les révisions | Voir les révisions

README


nftables puppet module

Puppet Forge Puppet Forge - downloads puppetmodule.info docs Apache-2.0 License

This module manages an opinionated nftables configuration.

By default it sets up a firewall that drops every incoming and outgoing connection.

It only allows outgoing dns, ntp and web and ingoing ssh traffic, although this can be overridden using parameters.

The config file has a inet filter and a ip nat table setup.

Additionally, the module comes with a basic infrastructure to hook into different places.

Configuration

The main configuration file loaded by the nftables service will be files/config/puppet.nft, all other files created by that module go into files/config/puppet and will also be purged if not managed anymore.

The main configuration file includes dedicated files for the filter and nat tables, as well as processes any custom-*.nft files before hand.

The filter and NAT tables both have all the master chains (INPUT, OUTPUT, FORWARD in case of filter and PREROUTING and POSTROUTING in case of NAT) configured, to which you can hook in your own chains that can contain specific rules.

All filter masterchains drop by default. By default we have a set of default_MASTERCHAIN chains configured to which you can easily add your custom rules.

For specific needs you can add your own chain.

There is a global chain, that defines the default behavior for all masterchains. This chain is empty by default.

INPUT and OUTPUT to the loopback device is allowed by default, though you could restrict it later.

On the other hand, if you don't want any of the default tables, chains and rules created by the module, you can set nftables::inet_filter and/or nftables::nat to false and build your whole nftables configuration from scratch by using the building blocks provided by this module. Looking at nftables::inet_filter for inspiration might be a good idea.

Rules Validation

Initially puppet deploys all configuration to /etc/nftables/puppet-preflight/ and /etc/nftables/puppet-preflight.nft. This is validated with nfc -c -L /etc/nftables/puppet-preflight/ -f /etc/nftables/puppet-preflight.nft. If and only if successful the configuration will be copied to the real locations before the service is reloaded.

Basic types

nftables::config

Manages a raw file in /etc/nftables/puppet/${name}.nft

Use this for any custom table files.

nftables::chain

Prepares a chain file as a concat file to which you will be able to add dedicated rules through nftables::rule.

The name must be unique for all chains. The inject parameter can be used to directly add a jump to a masterchain. inject must follow the pattern ORDER-MASTERCHAIN, where order references a 2-digit number which defines the rule order (by default use e.g. 20) and masterchain references the chain to hook in the new chain. It's possible to specify the in-interface name and out-interface name for the inject rule.

nftables::rule

A simple way to add rules to any chain. The name must be: CHAIN_NAME-rulename, where CHAINNAME refers to your chain and an arbitrary name for your rule. The rule will be a concat::fragment to the chain `CHAINNAME`.

You can define the order by using the order param.

Before defining your own rule, take a look to the list of ready-to-use rules available in the REFERENCE, somebody might have encapsulated a rule definition for you already.

nftables::set

Adds a named set to a given table. It allows composing the set using individual parameters but also takes raw input via the content and source parameters.

nftables::simplerule

Allows expressing firewall rules without having to use nftables's language by adding an abstraction layer a-la-Firewall. It's rather limited how far you can go so if you need rather complex rules or you can speak nftables it's recommended to use nftables::rule directly.

Facts

One structured fact nftables is available

{ tables => [ "bridge-filter", "bridge-nat", "inet-firewalld", "ip-firewalld", "ip6-firewalld" ], version => "0.9.3" }

  • nftables.version is the version of the nft command from nft --version.
  • nftables.tables is the list of tables installed on the machine from nft list tables.

Editor goodies

If you're using Emacs there are some snippets for Yasnippet available here that could make your life easier when using the module. This is third party configuration that's only included here for reference so changes in the interfaces exposed by this module are not guaranteed to be automatically applied there.

Formats disponibles : Atom