Skip to content

Remove ufw Package

An XCCDF Rule

Description

The ufw package can be removed with the following command:

$ apt-get remove ufw

Rationale

Running iptables.persistent with ufw enabled may lead to conflict and unexpected results.

ID
xccdf_org.ssgproject.content_rule_package_ufw_removed
Severity
Medium
References
Updated



Remediation - Puppet

include remove_ufw

class remove_ufw {
  package { 'ufw':
    ensure => 'purged',
  }

Remediation - Ansible

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

Remediation - Shell Script

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

# CAUTION: This remediation script will remove ufw
#	   from the system, and may remove any packages