Projet

Général

Profil

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

root @ ecb63cef

Nom Taille Révision Âge Auteur Commentaire
  files 5933ab8e plus de 4 ans tr Set NAT only for IPv4
  manifests e140adff plus de 4 ans tr Linting
.fixtures.yml 253 octets ecb63cef plus de 4 ans tr Add dependencies
.gitignore 266 octets 050f1005 plus de 4 ans tr Git ignore Puppet module stuff
README.md 2,6 ko 0ba57c66 plus de 4 ans mh initial release
metadata.json 1,19 ko ecb63cef plus de 4 ans tr Add dependencies

Dernières révisions

# Date Auteur Commentaire
ecb63cef 2020-08-29 11:15 tr

Add dependencies

e140adff 2020-08-29 10:46 tr

Linting

050f1005 2020-08-29 10:40 tr

Git ignore Puppet module stuff

5933ab8e 2020-08-29 10:14 tr

Set NAT only for IPv4

a6064b9f 2020-08-29 10:05 tr

Remove whitespaces

15aaf3c5 2020-08-29 10:00 tr

Allow only specific icmp types

  • Rate limit the echo-requests
  • Allow icmp types (w/o rate limit) which are protocol relevant
d4de1bfe 2020-08-29 09:39 tr

Allow to set a list of dns servers

a98c98d4 2020-08-29 09:26 tr

Add in/out rules for Tor

40b19655 2020-08-29 09:25 tr

Add a in rule for icinga2

df2679aa 2020-08-29 09:24 tr

Add in rule for puppet

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 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) 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_file

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

The name must follow the pattern TABLE@chain_name, e.g. filter@my_chain. This will a) prepare a snippet defining the chain, that will be included in the filter table.

This define is more intended as a helper to setup chains that will be used for the different tables, through their own defines. See nftables::filter::chain as an example.

nftables::filter::chain

This setups a chain for the filter table. You will be able to add rules to that chain by using nftables::filter::chain::rule.

The name must follow the pattern: MASTERCHAIN-new_chain_name, which defines to which masterchain that custom chain should be hooked into.

newchainname must be unique for all chains.

There is automatically a jump instruction added to the masterchain, with the order preference.

nftables::filter::chain::rule

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

You can define the order by using the order param.

Formats disponibles : Atom