Rules Related To 'iptables'

Component overview

Relevant packages:

Relevant groups:

None

Changelog:

No changes recorded.

Relevant rules:

Rule details

Verify Group Who Owns /etc/iptables Directory

directory_groupowner_etc_iptables

Description

To properly set the group owner of /etc/iptables, run the command:

$ sudo chgrp root /etc/iptables

Rationale

The ownership of the /etc/iptables directory by the root group is important because this directory hosts iptables configuration. Protection of this file is critical for system security. Assigning the ownership to root ensures exclusive control of the iptables configuration.

Verify User Who Owns /etc/iptables Directory

directory_owner_etc_iptables

Description

To properly set the owner of /etc/iptables, run the command:

$ sudo chown root /etc/iptables 

Rationale

The ownership of the /etc/iptables directory by the root user is important because this directory hosts iptables configuration. Protection of this file is critical for system security. Assigning the ownership to root ensures exclusive control of the iptables configuration.

Verify Permissions On /etc/iptables Directory

directory_permissions_etc_iptables

Description

To properly set the permissions of /etc/iptables, run the command:

$ sudo chmod 0700 /etc/iptables

Rationale

Setting correct permissions on the /etc/iptables directory is important because this directory hosts iptables configuration. Protection of this directory is critical for system security. Restricting the permissions ensures exclusive control of the iptables configuration.

Install iptables-nft Package

package_iptables-nft_installed

Description

The iptables-nft package can be installed with the following command:

$ apt-get install iptables-nft

Rationale

iptables-nft controls the Linux kernel network packet filtering code. iptables-nft allows system operators to set up firewalls and IP masquerading, etc.

Install iptables-nft Package

package_iptables-nft_installed

Description

The iptables-nft package can be installed with the following command:

$ apt-get install iptables-nft

Rationale

iptables-nft controls the Linux kernel network packet filtering code. iptables-nft allows system operators to set up firewalls and IP masquerading, etc.

Install iptables-persistent Package

package_iptables-persistent_installed

Description

The iptables-persistent package can be installed with the following command:

$ apt-get install iptables-persistent

Rationale

A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall.

Remove iptables-persistent Package

package_iptables-persistent_removed

Description

The iptables-persistent package can be removed with the following command:

$ apt-get remove iptables-persistent

Rationale

Running both ufw and the services included in the iptables-persistent package may lead to conflict.

Install iptables-services Package

package_iptables-services_installed

Description

The iptables-services package can be installed with the following command:

$ apt-get install iptables-services

Rationale

iptables-services provides the services iptables and ip6tables that have been split out of the base package since they are not active by default anymore. These services load the iptables rules during the system startup and also allow one to reload the iptables rules during runtime.

Remove iptables-services Package

package_iptables-services_removed

Description

The iptables-services package can be removed with the following command:

$ apt-get remove iptables-services

Rationale

iptables-services provides the services iptables and ip6tables that have been split out of the base package since they are not active by default anymore. These services load the iptables rules during the system startup and also allow one to reload the iptables rules during runtime. Those iptables services conflicts with firewalld so they should be removed if firewalld is used.

Install iptables Package

package_iptables_installed

Description

The iptables package can be installed with the following command:

$ apt-get install iptables

Rationale

iptables controls the Linux kernel network packet filtering code. iptables allows system operators to set up firewalls and IP masquerading, etc.

Verify ip6tables Enabled if Using IPv6

service_ip6tables_enabled

Description

The ip6tables service can be enabled with the following command:

$ sudo systemctl enable ip6tables.service

Rationale

The ip6tables service provides the system's host-based firewalling capability for IPv6 and ICMPv6.

Verify iptables Enabled

service_iptables_enabled

Description

The iptables service can be enabled with the following command:

$ sudo systemctl enable iptables.service

Rationale

The iptables service provides the system's host-based firewalling capability for IPv4 and ICMP.

Ensure iptables are flushed

ensure_iptables_are_flushed

Description

nftables is a replacement for iptables, ip6tables, ebtables and arptables

Rationale

It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded.