Projet

Général

Profil

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

root @ 435a5db2

Nom Taille Révision Âge Auteur Commentaire
  .github 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
  .vscode ece9be27 plus de 4 ans tr Do PDK convert
  data 0c9bc308 environ 3 ans hashworks Add support for Arch Linux Arch Linux stores t...
  files 0c9bc308 environ 3 ans hashworks Add support for Arch Linux Arch Linux stores t...
  lib c82b960a plus de 3 ans Steve Traylen rubocop:auto_correct results
  manifests 0c9bc308 environ 3 ans hashworks Add support for Arch Linux Arch Linux stores t...
  spec 435a5db2 environ 3 ans Steve Traylen rspec mock systemd process on docker On docker...
  templates 0c9bc308 environ 3 ans hashworks Add support for Arch Linux Arch Linux stores t...
  types cd4cf212 environ 3 ans Nacho Barrientos Remove trailing whitespace
.editorconfig 289 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.fixtures.yml 377 octets 1a986e22 presque 4 ans Tim Meusel pull fixtures from git and not forge
.gitattributes 62 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.gitignore 335 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.msync.yml 147 octets 20eaf3c2 plus de 3 ans Tim Stallmann modulesync 5.1.0
.overcommit.yml 1,35 ko 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.pmtignore 459 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.puppet-lint.rc 81 octets 20eaf3c2 plus de 3 ans Tim Stallmann modulesync 5.1.0
.rspec 139 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.rspec_parallel 126 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.rubocop.yml 155 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
.sync.yml 96 octets 435a5db2 environ 3 ans Steve Traylen rspec mock systemd process on docker On docker...
CHANGELOG.md 15,2 ko d0a1ffef environ 3 ans hashworks Prepare release 2.2.0
Dockerfile 572 octets 5fea281f plus de 3 ans Tim Stallmann modulesync 4.2.0
Gemfile 1,14 ko 20eaf3c2 plus de 3 ans Tim Stallmann modulesync 5.1.0
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,9 ko d0a1ffef environ 3 ans hashworks Prepare release 2.2.0
Rakefile 2,37 ko 20eaf3c2 plus de 3 ans Tim Stallmann modulesync 5.1.0
hiera.yaml 685 octets ece9be27 plus de 4 ans tr Do PDK convert
metadata.json 1,25 ko a50b9a6f environ 3 ans hashworks [blacksmith] Bump version to 2.2.1-rc0

Dernières révisions

# Date Auteur Commentaire
435a5db2 2022-03-08 02:59 Steve Traylen

rspec mock systemd process on docker

On docker rspec the service provider is autodetected as redhat
rather than systemd.

https://tickets.puppetlabs.com/browse/PUP-11167

That causes

```
error during compilation: Parameter enable failed on Service[firewalld]: Provider redhat must have features 'maskable' to set 'enable' to 'mask' (file: /builds/ai/it-puppet-module-nftables/code/spec/fixtures/modules/nftables/manifests/init.pp, line: 186)...

232c1364 2022-03-08 02:08 Steve Traylen

Migrate from deprecated mocha

5679c81e 2022-02-28 03:09 Romain Tartière

Merge pull request #127 from nbarrientos/ibarrien_tw

cd4cf212 2022-02-28 01:43 Nacho Barrientos

Remove trailing whitespace

a50b9a6f 2022-02-27 12:24 hashworks

[blacksmith] Bump version to 2.2.1-rc0

b3a590e0 2022-02-27 12:19 Justin Kromlinger

Merge pull request #126 from voxpupuli/release/2_2_0

Prepare release 2.2.0

d0a1ffef 2022-02-27 12:03 hashworks

Prepare release 2.2.0

c3145917 2022-02-27 11:32 Justin Kromlinger

Merge pull request #124 from hashworks/feature/ArchLinuxSupport

Add support for Arch Linux

0c9bc308 2022-02-27 11:05 hashworks

Add support for Arch Linux

Arch Linux stores the configuration in a different path and does not
provide firewalld without explicit installation.

This basically the same as #66 – I've reused their code since it hasn't
been merged in a while.

d8b8b3f4 2022-02-27 11:04 Justin Kromlinger

Merge pull request #125 from hashworks/fix/serviceRemainAfterExit

Ensure that nftables.service remains active after it exits

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