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 - Ansible

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

Remediation - Puppet

include remove_iptables-persistent

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

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

# CAUTION: This remediation script will remove iptables-persistent
#	   from the system, and may remove any packages
#	   that depend on iptables-persistent. Execute this