Projet

Général

Profil

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

root @ 7f6cacc5

Nom Taille Révision Âge Auteur Commentaire
  .vscode ece9be27 plus de 4 ans tr Do PDK convert
  data ece9be27 plus de 4 ans tr Do PDK convert
  files 82d10659 plus de 4 ans Nacho Barrientos Allow disabling default NAT tables and chains
  manifests 82d10659 plus de 4 ans Nacho Barrientos Allow disabling default NAT tables and chains
  spec 82d10659 plus de 4 ans Nacho Barrientos Allow disabling default NAT tables and chains
  templates 82d10659 plus de 4 ans Nacho Barrientos Allow disabling default NAT tables and chains
.fixtures.yml 287 octets 30462da1 plus de 4 ans Steve Traylen Reload rules atomically Background: The unit f...
.gitattributes 62 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.gitignore 312 octets 0f63a915 plus de 4 ans tr Git ignore .ruby-version
.gitlab-ci.yml 1,21 ko 8726ba4c plus de 4 ans tr Switch back to Ruby 2.5 ``` can't modify froze...
.pdkignore 475 octets ece9be27 plus de 4 ans tr Do PDK convert
.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,86 ko ece9be27 plus de 4 ans tr Do PDK convert
.sync.yml 606 octets 0f63a915 plus de 4 ans tr Git ignore .ruby-version
.travis.yml 1,22 ko 705bb26f plus de 4 ans tr Add travis ci configuration
.yardopts 18 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
CHANGELOG.md 146 octets ece9be27 plus de 4 ans tr Do PDK convert
Gemfile 3,42 ko ece9be27 plus de 4 ans tr Do PDK convert
LICENSE 11,1 ko 44ac0a4e plus de 4 ans mh add license file
README.md 2,82 ko 30462da1 plus de 4 ans Steve Traylen Reload rules atomically Background: The unit f...
REFERENCE.md 17,5 ko 7f6cacc5 plus de 4 ans Steve Traylen Refresh REFERENCE
Rakefile 3,45 ko ece9be27 plus de 4 ans tr Do PDK convert
appveyor.yml 1,31 ko ece9be27 plus de 4 ans tr Do PDK convert
hiera.yaml 685 octets ece9be27 plus de 4 ans tr Do PDK convert
metadata.json 1,29 ko 30462da1 plus de 4 ans Steve Traylen Reload rules atomically Background: The unit f...

Dernières révisions

# Date Auteur Commentaire
7f6cacc5 2020-11-27 04:01 Steve Traylen

Refresh REFERENCE

7395300c 2020-11-26 16:09 duritong

Merge pull request #25 from cernops/no_nat

Allow disabling default NAT tables and chains

82d10659 2020-11-26 15:39 Nacho Barrientos

Allow disabling default NAT tables and chains

bd549474 2020-11-26 15:07 duritong

Merge pull request #10 from traylenator/reload

Reload rules atomically and verify rules before deploy

30462da1 2020-11-26 05:19 Steve Traylen

Reload rules atomically

Background: The unit file for nftables on CentOS 8 contains:

```
ExecStart=/sbin/nft -f /etc/sysconfig/nftables.conf
ExecReload=/sbin/nft 'flush ruleset; include "/etc/sysconfig/nftables.conf";'
ExecStop=/sbin/nft flush ruleset
```...

92461926 2020-11-24 07:53 duritong

Merge pull request #16 from cernops/icmp

Move ICMP stuff to separate classes allowing better customisation

587e522e 2020-11-24 07:51 duritong

Merge pull request #20 from cernops/firewalld_mask

Make masking Service['firewalld'] optional

ae9872e2 2020-11-24 04:17 Nacho Barrientos

Make masking Service['firewalld'] configurable

79e9a23f 2020-11-21 03:10 Nacho Barrientos

Move ICMP stuff to separate classes

def3893c 2020-11-20 10:52 keachi

Merge pull request #15 from traylenator/fixtests

Correct bad merge

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.

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.

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.

nftsables::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.

Formats disponibles : Atom