@test "Verify ProcessSizeMax in /etc/systemd/coredump.conf" {
run bash -c "grep '^ProcessSizeMax=0$' /etc/systemd/coredump.conf"
[ "$status" -eq 0 ]
}
Verify ProcessSizeMax in /etc/systemd/coredump.conf
Description
The ProcessSizeMax
setting sets the maximum size in bytes of a core which will
be processed. Core dumps exceeding this size may be stored, but the backtrace
will not be generated.
Setting Storage=none
and ProcessSizeMax=0
disables all coredump handling
except for a log entry.
Rationale
Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps may consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition.
Audit
Remediation
shell
sed -i 's/^#ProcessSizeMax=.*/ProcessSizeMax=0/' "/etc/systemd/coredump.conf"