Skip to content

Uninstall nginx Package

An XCCDF Rule

Description

The nginx package can be removed with the following command:

$ sudo yum erase nginx

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_nginx_removed
Severity
Unknown
References
Updated



Remediation - Anaconda Pre-Install Instructions


package --remove=nginx

Remediation - Ansible

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

Remediation - Puppet

include remove_nginx

class remove_nginx {
  package { 'nginx':
    ensure => 'purged',
  }

Remediation - Shell Script


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