Projet

Général

Profil

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

root @ f29ea029

Nom Taille Révision Âge Auteur Commentaire
  .github c3f6e1ff plus de 4 ans Nacho Barrientos Use a separate job file
  .vscode ece9be27 plus de 4 ans tr Do PDK convert
  data de7a904c plus de 4 ans Kienan Stewart Move configuration_path default to module data
  files a86c6409 plus de 4 ans Kienan Stewart Convert puppet_nft systemd drop-in unit file to...
  lib 03d9e7da plus de 4 ans Steve Traylen New parameter noflush_tables to selectivly skip...
  manifests f29ea029 plus de 4 ans Kienan Stewart Fix nftables::rules::out::nfs3 for nftables 0.9.0
  spec f29ea029 plus de 4 ans Kienan Stewart Fix nftables::rules::out::nfs3 for nftables 0.9.0
  templates 7fe7a4aa plus de 4 ans Kienan Stewart Rename nftables_configuration_path to configura...
  types 8c00b818 plus de 4 ans Nacho Barrientos Pull up rule regexp to type aliases
.editorconfig 206 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.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 227 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.gitlab-ci.yml 1,21 ko 8726ba4c plus de 4 ans tr Switch back to Ruby 2.5 ``` can't modify froze...
.msync.yml 39 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.overcommit.yml 1,3 ko 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.pdkignore 475 octets ece9be27 plus de 4 ans tr Do PDK convert
.pmtignore 351 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.puppet-lint.rc 11 octets 321ae8ab plus de 4 ans tr Add Puppet module basic files
.rspec 31 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.rspec_parallel 18 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
.rubocop.yml 174 octets 492ca838 plus de 4 ans Steve Traylen Disable Disable TrailingCommaInArguments early ...
.sync.yml 171 octets 09cba182 plus de 4 ans Steve Traylen Enable parameter_documentation lint The linter...
.yardopts 37 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
CHANGELOG.md 7,3 ko bc1b0f1a plus de 4 ans Steve Traylen Release 1.0.0 (#49) * Release 1.0.0 Co-author...
Dockerfile 480 octets 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
Gemfile 1,18 ko 09cba182 plus de 4 ans Steve Traylen Enable parameter_documentation lint The linter...
LICENSE 11,1 ko 44ac0a4e plus de 4 ans mh add license file
README.md 3,66 ko 82b6fd57 plus de 4 ans Steve Traylen Add badges to README
REFERENCE.md 33,2 ko 09cba182 plus de 4 ans Steve Traylen Enable parameter_documentation lint The linter...
Rakefile 2,18 ko 78f22811 plus de 4 ans Steve Traylen modulesync 4.0.0
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,27 ko 19a87d6f plus de 4 ans Kienan Stewart Add Debian as a supported OS

Dernières révisions

# Date Auteur Commentaire
f29ea029 2021-01-25 17:38 Kienan Stewart

Fix nftables::rules::out::nfs3 for nftables 0.9.0

df9a09bb 2021-01-25 16:33 Kienan Stewart

Fix nftables::rules::nfs3 syntax to work with nftables 0.9.0

7c92861a 2021-01-21 11:47 Kienan Stewart

Fix rubocop style error

de7a904c 2021-01-19 17:34 Kienan Stewart

Move configuration_path default to module data

7fe7a4aa 2021-01-19 11:38 Kienan Stewart

Rename nftables_configuration_path to configuration_path

db7f6aef 2021-01-19 11:27 Kienan Stewart

Remove commented code from spec_helper

It's not necessary, and will be removed the next time modulesync is run.

546de19c 2021-01-19 11:26 Kienan Stewart

Change configuration path form AbsolutePath to Unixpath

f8c4097f 2021-01-18 16:31 Kienan Stewart

Fix Debian data defaults

The module name prefix was missing in the hieradata. I removed the modifications
to spec_helper.rb that made the tests work with the erroneous data.

c8683bd8 2021-01-18 16:21 Kienan Stewart

Revert "Use symbols for both lookups in os_facts"

This reverts commit 0877a8fd3646130f06b29e581a1ed2f990394094.

My initial tests were too hasty. `os_facts[:os][:family]` returns
an empty string. The original formulation was correct.

430c87b7 2021-01-18 15:37 Kienan Stewart

Load module data during spec tests

This allows tests that depend on the module data being loaded to pass.

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.

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. This chain is empty by default.

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.

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.

Formats disponibles : Atom