Page MenuHomePhabricator

Add support for nftables in profile::firewall
Closed, ResolvedPublic

Description

Currently the vast majority of our servers operate per-host packet filter rules which are managed via Ferm which uses the iptables support in the Linux kernel.

This task covers adding support for nftables by

  • providing the equivalent rules of what is currently shipped by the base::firewall base classes (default policies, access to monitoring/bastions etc)
  • if a role uses nftables ferm::service equivalent nft definitions (only roles using ferm::rules would need to provide equivalent rules)

This allows for a pilot setup with a few rules (and eventually migrate roles piece by piece as applicable).

Details

Related Changes in Gerrit:
SubjectRepoBranchLines +/-
operations/puppetproduction+26 -28
operations/puppetproduction+2 -1
operations/puppetproduction+5 -6
operations/puppetproduction+5 -29
operations/puppetproduction+3 -2
operations/puppetproduction+12 -2
operations/puppetproduction+4 -2
operations/puppetproduction+10 -8
operations/puppetproduction+3 -0
operations/puppetproduction+1 -1
operations/puppetproduction+16 -0
operations/puppetproduction+42 -36
operations/puppetproduction+6 -1
operations/puppetproduction+1 -8
operations/puppetproduction+14 -4
operations/puppetproduction+2 -2
operations/puppetproduction+1 -1
operations/puppetproduction+2 -0
operations/puppetproduction+6 -6
operations/puppetproduction+46 -44
operations/puppetproduction+2 -2
operations/puppetproduction+7 -9
operations/puppetproduction+8 -2
operations/puppetproduction+2 -16
operations/puppetproduction+26 -14
operations/puppetproduction+26 -16
operations/puppetproduction+40 -1
operations/puppetproduction+6 -4
operations/puppetproduction+40 -32
operations/puppetproduction+19 -13
operations/puppetproduction+4 -1
operations/puppetproduction+27 -13
operations/puppetproduction+20 -0
operations/puppetproduction+12 -3
operations/puppetproduction+8 -9
operations/puppetproduction+4 -4
operations/puppetproduction+17 -1
operations/puppetproduction+6 -6
operations/puppetproduction+18 -0
operations/puppetproduction+2 -2
operations/puppetproduction+11 -11
operations/puppetproduction+36 -9
operations/puppetproduction+33 -1
operations/puppetproduction+32 -0
operations/puppetproduction+28 -27
operations/puppetproduction+138 -5
operations/puppetproduction+1 -1
operations/puppetproduction+3 -2
operations/puppetproduction+21 -16
operations/puppetproduction+5 -5
operations/puppetproduction+18 -18
operations/puppetproduction+585 -51
operations/puppetproduction+13 -4
operations/puppetproduction+0 -0
operations/puppetproduction+117 -0
operations/puppetproduction+24 -28
operations/puppetproduction+46 -8
operations/puppetproduction+3 -3
operations/puppetproduction+8 -8
operations/puppetproduction+1 -1
operations/puppetproduction+1 -1
operations/puppetproduction+46 -7
operations/puppetproduction+148 -0
operations/puppetproduction+15 -1
Show related patches Customize query in gerrit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 951123 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add a nftables::file::service define to install a custom nftables input rule

https://gerrit.wikimedia.org/r/951123

Change 951135 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service: Use correct type for port range

https://gerrit.wikimedia.org/r/951135

Change 951135 merged by Muehlenhoff:

[operations/puppet@production] firewall::service: Use correct type for port range

https://gerrit.wikimedia.org/r/951135

Change 951432 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service/firewall::client: Fix function name for dump_params()

https://gerrit.wikimedia.org/r/951432

Change 951432 merged by Muehlenhoff:

[operations/puppet@production] firewall::service/firewall::client: Fix function name for dump_params()

https://gerrit.wikimedia.org/r/951432

Change 951123 merged by Muehlenhoff:

[operations/puppet@production] Add a nftables::file::service define to install a custom nftables input rule

https://gerrit.wikimedia.org/r/951123

Change 951459 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add additional sets for monitoring/prometheus hosts

https://gerrit.wikimedia.org/r/951459

Change 951118 merged by Muehlenhoff:

[operations/puppet@production] firewall: Add SSH rules in firewall-agnostic form

https://gerrit.wikimedia.org/r/951118

Change 951459 merged by Muehlenhoff:

[operations/puppet@production] Add additional sets for monitoring/prometheus hosts

https://gerrit.wikimedia.org/r/951459

Change 951512 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Adapt monitoring/metrics rules for nft and ferm providers

https://gerrit.wikimedia.org/r/951512

Change 951828 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Make firewall logging conditional on ferm and rename the profile

https://gerrit.wikimedia.org/r/951828

Change 951830 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Convert the monitoring/prometheus ferm rules to a firewall::service

https://gerrit.wikimedia.org/r/951830

Change 951889 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Make nftables::service types more compatible

https://gerrit.wikimedia.org/r/951889

Change 951828 merged by Muehlenhoff:

[operations/puppet@production] Make firewall logging conditional on ferm and rename the profile

https://gerrit.wikimedia.org/r/951828

Change 951922 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service: Replace whitespace in resource title with underscores

https://gerrit.wikimedia.org/r/951922

Change 952051 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service: Create an nftables::service when using the nft provider

https://gerrit.wikimedia.org/r/952051

Change 951830 merged by Muehlenhoff:

[operations/puppet@production] Convert the monitoring/prometheus ferm rules to a firewall::service

https://gerrit.wikimedia.org/r/951830

Change 951889 merged by Muehlenhoff:

[operations/puppet@production] Make nftables::service types more compatible

https://gerrit.wikimedia.org/r/951889

Change 952051 merged by Muehlenhoff:

[operations/puppet@production] firewall::service: Create an nftables::service when using the nft provider

https://gerrit.wikimedia.org/r/952051

Change 951512 abandoned by Muehlenhoff:

[operations/puppet@production] Adapt monitoring/metrics rules for nft and ferm providers

Reason:

Different patch was merged

https://gerrit.wikimedia.org/r/951512

Change 951922 merged by Muehlenhoff:

[operations/puppet@production] firewall::service: Replace whitespace in resource title with underscores

https://gerrit.wikimedia.org/r/951922

Change 952862 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add some ferm->nft migration steps to the firewall class

https://gerrit.wikimedia.org/r/952862

Change 952889 had a related patch set uploaded (by Jbond; author: jbond):

[operations/puppet@production] ferm: add ensure support to the ferm class

https://gerrit.wikimedia.org/r/952889

Change 953276 had a related patch set uploaded (by Jbond; author: jbond):

[operations/puppet@production] firewall: move contrac logic to firewall module

https://gerrit.wikimedia.org/r/953276

Change 953610 had a related patch set uploaded (by Jbond; author: jbond):

[operations/puppet@production] firewall: add conntrack require on the active firewall

https://gerrit.wikimedia.org/r/953610

Change 953276 abandoned by Jbond:

[operations/puppet@production] firewall: move conntrack logic to firewall module

Reason:

https://gerrit.wikimedia.org/r/953276

Change 953610 abandoned by Jbond:

[operations/puppet@production] firewall: add conntrack require on the active firewall

Reason:

https://gerrit.wikimedia.org/r/953610

Change 952889 merged by Jbond:

[operations/puppet@production] ferm: add ensure support to the ferm class

https://gerrit.wikimedia.org/r/952889

Change 953654 had a related patch set uploaded (by Jbond; author: Jbond):

[operations/puppet@production] ferm: add ensure support to the ferm class

https://gerrit.wikimedia.org/r/953654

Change 954612 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Fix use of more than one src/dst sets

https://gerrit.wikimedia.org/r/954612

Change 954612 merged by Muehlenhoff:

[operations/puppet@production] Fix use of more than one src/dst sets

https://gerrit.wikimedia.org/r/954612

Change 952862 abandoned by Muehlenhoff:

[operations/puppet@production] Add some ferm->nft migration steps to the firewall class

Reason:

Obsoleted by 953654

https://gerrit.wikimedia.org/r/952862

Change 953654 merged by Muehlenhoff:

[operations/puppet@production] ferm: add ensure support to the ferm class

https://gerrit.wikimedia.org/r/953654

Change 955297 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] nft base sets: Read additional host groups from Hiera

https://gerrit.wikimedia.org/r/955297

Change 955308 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service Check for presence of srange/drange in the nftables path

https://gerrit.wikimedia.org/r/955308

Change 955297 merged by Muehlenhoff:

[operations/puppet@production] nft base sets: Read additional host groups from Hiera

https://gerrit.wikimedia.org/r/955297

Change 955308 merged by Jbond:

[operations/puppet@production] firewall::service Check for presence of srange/drange in the nftables path

https://gerrit.wikimedia.org/r/955308

Change 955774 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Adapt transition code for ferm -> nftables

https://gerrit.wikimedia.org/r/955774

Change 955779 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Use a single ensure for managing the nftables state

https://gerrit.wikimedia.org/r/955779

Change 955774 merged by Muehlenhoff:

[operations/puppet@production] Adapt transition code for ferm -> nftables

https://gerrit.wikimedia.org/r/955774

Change 955865 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Pass down the ensure to the requestctl settings

https://gerrit.wikimedia.org/r/955865

Change 955779 merged by Muehlenhoff:

[operations/puppet@production] Use a single ensure for managing the nftables state

https://gerrit.wikimedia.org/r/955779

Change 955865 merged by Muehlenhoff:

[operations/puppet@production] Pass down the ensure to the requestctl settings

https://gerrit.wikimedia.org/r/955865

Change 956410 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] ferm: Move more files under the service check conditional

https://gerrit.wikimedia.org/r/956410

Change 956410 merged by Muehlenhoff:

[operations/puppet@production] ferm: Move more files under the service check conditional

https://gerrit.wikimedia.org/r/956410

Change 956797 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] nftables::set: Align names with the resource title and nftables::input

https://gerrit.wikimedia.org/r/956797

Change 956797 merged by Muehlenhoff:

[operations/puppet@production] nftables::set: Align names with the resource title and nftables::input

https://gerrit.wikimedia.org/r/956797

Change 956869 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] nftables::sets: Don't add elements if no addresses are passed

https://gerrit.wikimedia.org/r/956869

Change 956869 merged by Muehlenhoff:

[operations/puppet@production] nftables::sets: Don't add elements if no addresses are passed

https://gerrit.wikimedia.org/r/956869

Change 957297 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] nftables sets: Fix the template to properly wrap the element block

https://gerrit.wikimedia.org/r/957297

Change 957297 merged by Muehlenhoff:

[operations/puppet@production] nftables sets: Fix the template to properly wrap the element block

https://gerrit.wikimedia.org/r/957297

Change 957313 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service: Fix logic error in passing srange/drange to nftables

https://gerrit.wikimedia.org/r/957313

Change 957313 merged by Muehlenhoff:

[operations/puppet@production] firewall::service: Fix logic error in passing srange/drange to nftables

https://gerrit.wikimedia.org/r/957313

Change 958480 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add initial support to move cloudgw to profile::firewall using the nft provider

https://gerrit.wikimedia.org/r/958480

Change 958480 merged by Muehlenhoff:

[operations/puppet@production] Add initial support to move cloudgw to profile::firewall using the nft provider

https://gerrit.wikimedia.org/r/958480

Change 958905 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Switch cloudgw/codfw1dev to profile::firewall

https://gerrit.wikimedia.org/r/958905

Change 958913 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] conntrackd: Switch to ensure_packages()

https://gerrit.wikimedia.org/r/958913

Change 958913 merged by Muehlenhoff:

[operations/puppet@production] conntrackd: Switch to ensure_packages()

https://gerrit.wikimedia.org/r/958913

Change 958918 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] conntrackd: Add explicit check

https://gerrit.wikimedia.org/r/958918

Change 958918 merged by Muehlenhoff:

[operations/puppet@production] conntrackd: Add explicit check

https://gerrit.wikimedia.org/r/958918

Change 959730 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall::service: Handle the use of the define on systems w/o P:firewall

https://gerrit.wikimedia.org/r/959730

Change 959759 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add profile::firewall::provider: none for roles where P:firewall is not applied

https://gerrit.wikimedia.org/r/959759

Change 959730 abandoned by Muehlenhoff:

[operations/puppet@production] firewall::service: Handle the use of the define on systems w/o P:firewall

Reason:

Needs different fix

https://gerrit.wikimedia.org/r/959730

Change 959759 merged by Muehlenhoff:

[operations/puppet@production] Add profile::firewall::provider: none for roles where P:firewall is not applied

https://gerrit.wikimedia.org/r/959759

Change 960011 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall: Default provider to none

https://gerrit.wikimedia.org/r/960011

Change 960033 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall: Also support Stdlib::Port::Unprivileged in Ferm::Port

https://gerrit.wikimedia.org/r/960033

Change 960011 merged by Muehlenhoff:

[operations/puppet@production] firewall: Default provider to none

https://gerrit.wikimedia.org/r/960011

Change 960033 abandoned by Muehlenhoff:

[operations/puppet@production] firewall: Also support Stdlib::Port::Unprivileged in Ferm::Port

Reason:

Not needed

https://gerrit.wikimedia.org/r/960033

Change 961081 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall: Add explicit check for provider == 'none'

https://gerrit.wikimedia.org/r/961081

Change 961081 merged by Muehlenhoff:

[operations/puppet@production] firewall: Add explicit check for provider == 'none'

https://gerrit.wikimedia.org/r/961081

Change 958905 merged by Muehlenhoff:

[operations/puppet@production] Switch cloudgw/codfw1dev to profile::firewall

https://gerrit.wikimedia.org/r/958905

Change 961340 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] clouwgw: Update ordering for the variant using profile::firewall

https://gerrit.wikimedia.org/r/961340

Change 961340 merged by Muehlenhoff:

[operations/puppet@production] clouwgw: Update ordering for the variant using profile::firewall

https://gerrit.wikimedia.org/r/961340

Change 961360 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Switch main cloudgw hosts to profile::firewall

https://gerrit.wikimedia.org/r/961360

Change 961365 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] cloudgw: Remove profile::openstack::base::cloudgw::firewall_profile

https://gerrit.wikimedia.org/r/961365

Change 961360 merged by Muehlenhoff:

[operations/puppet@production] Switch main cloudgw hosts to profile::firewall

https://gerrit.wikimedia.org/r/961360

Change 961365 merged by Muehlenhoff:

[operations/puppet@production] cloudgw: Remove profile::openstack::base::cloudgw::firewall_profile

https://gerrit.wikimedia.org/r/961365

Change 961377 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] cloudgw: Don't override conntrack settings from firewall profile

https://gerrit.wikimedia.org/r/961377

Change 961400 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] firewall: Also move the sysctl under the manage_nf_conntrack conditional

https://gerrit.wikimedia.org/r/961400

Change 961400 merged by Muehlenhoff:

[operations/puppet@production] firewall: Also move the sysctl under the manage_nf_conntrack conditional

https://gerrit.wikimedia.org/r/961400

Change 961377 merged by Muehlenhoff:

[operations/puppet@production] cloudgw: Don't override conntrack settings from firewall profile

https://gerrit.wikimedia.org/r/961377

Small regression: iptables logs are written to disk in /var/log/ulogd/syslog.log to not flood the main syslog.log files. But nftables drop logs are back in /var/log/syslog

The ganeti test cluster, cloudgw and the sretest hosts are using nftables. This completes the initial migration work, all further changes are coordinated using T348498 and sub tasks of it.

I've written a summary of the Puppet changes on wikitech: https://wikitech.wikimedia.org/wiki/Firewall