Skip to content

Install iptables-persistent Package

An XCCDF Rule

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.

ID
xccdf_org.ssgproject.content_rule_package_iptables-persistent_installed
Severity
Medium
References
Updated



Remediation - OS Build Blueprint


[[packages]]
name = "iptables-persistent"
version = "*"

Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - enable_strategy
  - low_complexity

Remediation - Puppet

include install_iptables-persistent

class install_iptables-persistent {
  package { 'iptables-persistent':
    ensure => 'installed',
  }

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}\n' 'iptables' 2>/dev/null | grep -q installed; then

DEBIAN_FRONTEND=noninteractive apt-get install -y "iptables-persistent"

else