Skip to content

Uninstall httpd Package

An XCCDF Rule

Description

The apache2 package can be removed with the following command:

$ apt-get remove apache2

Rationale

If there is no need to make the web server software available, removing it provides a safeguard against its activation.

ID
xccdf_org.ssgproject.content_rule_package_httpd_removed
Severity
Unknown
References
Updated



Remediation - Ansible

- name: Ensure apache2 is removed
  package:
    name: apache2
    state: absent
  tags:
  - NIST-800-53-CM-6(a)

Remediation - Puppet

include remove_apache2

class remove_apache2 {
  package { 'apache2':
    ensure => 'purged',
  }

Remediation - Shell Script


# CAUTION: This remediation script will remove apache2
#	   from the system, and may remove any packages
#	   that depend on apache2. Execute this
#	   remediation AFTER testing on a non-production
#	   system!