Skip to content

Remove iptables-persistent Package

An XCCDF Rule

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.

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

Remediation Templates

A Puppet Snippet

include remove_iptables-persistent
class remove_iptables-persistent {
  package { 'iptables-persistent':
    ensure => 'purged',
  }
}

An Ansible Snippet

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

A Shell Script

# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}\n' 'ufw' 2>/dev/null | grep -q installed; then
# CAUTION: This remediation script will remove iptables-persistent
#	   from the system, and may remove any packages
#	   that depend on iptables-persistent. Execute this
#	   remediation AFTER testing on a non-production