Skip to content

Install ufw Package

An XCCDF Rule

Description

The ufw package can be installed with the following command:

$ apt-get install ufw

Rationale

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

ID
xccdf_org.ssgproject.content_rule_package_ufw_installed
Severity
Medium
References
Updated



Remediation - OS Build Blueprint


[[packages]]
name = "ufw"
version = "*"

Remediation - Ansible

- name: Ensure ufw is installed
  package:
    name: ufw
    state: present
  when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
  tags:

Remediation - Puppet

include install_ufw

class install_ufw {
  package { 'ufw':
    ensure => 'installed',
  }

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then

DEBIAN_FRONTEND=noninteractive apt-get install -y "ufw"

else