Skip to content

Disable Prelinking

An XCCDF Rule

Description

The prelinking feature changes binaries in an attempt to decrease their startup time. In order to disable it, change or add the following line inside the file /etc/sysconfig/prelink:

PRELINKING=no
Next, run the following command to return binaries to a normal, non-prelinked state:
$ sudo /usr/sbin/prelink -ua

Rationale

Because the prelinking feature changes binaries, it can interfere with the operation of certain software and/or modes such as AIDE, FIPS, etc.

ID
xccdf_org.ssgproject.content_rule_disable_prelink
Severity
Medium
References
Updated



Remediation - Shell Script

# prelink not installed
if test -e /etc/sysconfig/prelink -o -e /usr/sbin/prelink; then
    if grep -q ^PRELINKING /etc/sysconfig/prelink
    then
        sed -i 's/^PRELINKING[:blank:]*=[:blank:]*[:alpha:]*/PRELINKING=no/' /etc/sysconfig/prelink
    else

Remediation - Ansible

- name: Does prelink file exist
  stat:
    path: /etc/sysconfig/prelink
  register: prelink_exists
  tags:
  - CCE-91341-8