Projet

Général

Profil

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

root @ 9ae64df9

Nom Taille Révision Âge Auteur Commentaire
  files 38a67c59 plus de 4 ans tr Rewrite ip-nat to concat
  manifests c02d1b07 plus de 4 ans mh add a few more rules
  spec 9ae64df9 plus de 4 ans tr Add spec tests for a DNAT
.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
9ae64df9 2020-08-30 07:07 tr

Add spec tests for a DNAT

95b1259b 2020-08-30 07:07 tr

Add spec tests for ip nat prerouting

d78c1613 2020-08-30 07:07 tr

Add spec tests for router functionality

605d5fde 2020-08-30 07:07 tr

Add spec tests for ip nat chain policies

c02d1b07 2020-08-30 06:31 mh

add a few more rules

c8092701 2020-08-30 06:17 tr

Split init class

c8894978 2020-08-30 06:09 tr

Use default

c8e93806 2020-08-30 06:09 tr

Fix nat hooks

5bd849ba 2020-08-30 06:09 tr

Rename to snake cases

7940fb07 2020-08-30 06:04 tr

Adapt readme to the refactoring

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