Projet

Général

Profil

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

root @ 5bd849ba

Nom Taille Révision Âge Auteur Commentaire
  files 38a67c59 plus de 4 ans tr Rewrite ip-nat to concat
  manifests 38a67c59 plus de 4 ans tr Rewrite ip-nat to concat
  spec 5bd849ba plus de 4 ans tr Rename to snake cases
.fixtures.yml 253 octets ecb63cef plus de 4 ans tr Add dependencies
.gitattributes 62 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.gitignore 266 octets 050f1005 plus de 4 ans tr Git ignore Puppet module stuff
.gitlab-ci.yml 706 octets 73ef24d3 plus de 4 ans tr Drop Puppet 5 support
.pdkignore 423 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.puppet-lint.rc 11 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.rspec 31 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.rubocop.yml 3,56 ko e89da898 plus de 4 ans tr Linting
.yardopts 18 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
Gemfile 3,21 ko 186a64ca plus de 4 ans tr Add gemfile and rakefile for Puppet lint and spec
README.md 2,2 ko 7940fb07 plus de 4 ans tr Adapt readme to the refactoring
Rakefile 3,17 ko 186a64ca plus de 4 ans tr Add gemfile and rakefile for Puppet lint and spec
metadata.json 1,19 ko ecb63cef plus de 4 ans tr Add dependencies

Dernières révisions

# Date Auteur Commentaire
5bd849ba 2020-08-30 06:09 tr

Rename to snake cases

7940fb07 2020-08-30 06:04 tr

Adapt readme to the refactoring

38a67c59 2020-08-30 05:45 tr

Rewrite ip-nat to concat

422b6851 2020-08-30 05:44 tr

Add spec tests for ip-nat

6f38efff 2020-08-30 05:43 tr

Rename spec filter to inet-filter

5df9303f 2020-08-30 05:24 tr

Replace filter with inet-filter

8efbdf9a 2020-08-29 19:05 tr

Refactoring

e89da898 2020-08-29 14:31 tr

Linting

f34dae00 2020-08-29 14:14 tr

Spec tests for default rules

3ccc62ae 2020-08-29 13:52 tr

Add spec tests for default chains

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

README


nftables puppet module

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.

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

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

nftables config

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.

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

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.

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.

Formats disponibles : Atom