Skip to content

Add noexec Option to /boot

An XCCDF Rule

Description

The noexec mount option can be used to prevent binaries from being executed out of /boot. Add the noexec option to the fourth column of /etc/fstab for the line which controls mounting of /boot.

Rationale

The /boot partition contains the kernel and the bootloader. No binaries should be executed from this partition after the booting process finishes.

ID
xccdf_org.ssgproject.content_rule_mount_option_boot_noexec
Severity
Medium
References
Updated



Remediation - Anaconda Pre-Install Instructions


part /boot --mountoptions="noexec"

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if ( ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ) && ! ( [ -f /.dockerenv ] || [ -f /run/.containerenv ] ) ); then

function perform_remediation {
    
        # the mount point /boot has to be defined in /etc/fstab

Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-83316-0
  - configure_strategy