Projet

Général

Profil

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

root @ feff733b

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
  spec 64134e4e plus de 4 ans tr Add spec tests it should compile
.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 888 octets feff733b plus de 4 ans tr Add a Gitlab CI pipeline
.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,44 ko 321ae8ab plus de 4 ans tr Add Puppet module basic files
.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,6 ko 0ba57c66 plus de 4 ans mh initial release
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
feff733b 2020-08-29 11:17 tr

Add a Gitlab CI pipeline

64134e4e 2020-08-29 11:17 tr

Add spec tests it should compile

186a64ca 2020-08-29 11:17 tr

Add gemfile and rakefile for Puppet lint and spec

321ae8ab 2020-08-29 11:16 tr

Add Puppet module basic files

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

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