Information
A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file.
A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers trying to debug problems, increasing the risk to the system.
Solution
Create or edit the file /etc/systemd/coredump.conf or a file in the /etc/systemd/coredump.conf.d directory ending inconf
Edit or add the following line in the [Coredump] section:
ProcessSizeMax=0
Example:
#!/usr/bin/env bash
{
[ ! -d /etc/systemd/coredump.conf.d/ ] && mkdir /etc/systemd/coredump.conf.d/
if grep -Psq -- '^h*[Coredump]' /etc/systemd/coredump.conf.d/60-coredump.conf; then
printf '%s
' "ProcessSizeMax=0" >> /etc/systemd/coredump.conf.d/60-coredump.conf
else
printf '%s
' "[Coredump]" "ProcessSizeMax=0" >> /etc/systemd/coredump.conf.d/60-coredump.conf
fi
}