Ansible Role core_dumps¶
This role hardens a system by disabling core dumps. Core dumps can leak sensitive data (passwords, keys) from a crashed process’s memory to disk, so they are usually unwanted on production servers.
Available since LFOps 7.0.0.
How the Role Behaves¶
The role disables core dumps through the three mechanisms a modern Linux system uses, following the CIS Benchmark recommendations:
* hard core 0in/etc/security/limits.d/stops the shell / PAM from writing core dumps.fs.suid_dumpable = 0(sysctl) prevents core dumps of setuid / setgid processes. This value is not written by this role directly; it is handed to thekernel_settingsrole, which owns sysctl management.Storage=noneandProcessSizeMax=0in/etc/systemd/coredump.conf.d/keepsystemd-coredumpfrom storing core dumps.
The hard core limit applies to login sessions started after the change.
Dependent Roles¶
Any LFOps playbook that installs this role runs these for you. Optional ones can be disabled via the playbook’s skip variables.
The
fs.suid_dumpablesysctl is applied through thekernel_settingsrole (role: kernel_settings).
Optional Role Variables¶
core_dumps__limits_hard_core
The
hard corelimit written to/etc/security/limits.d/.0disables core dumps for all users.Type: Number.
Default:
0
core_dumps__systemd_process_size_max
The
ProcessSizeMaxvalue in/etc/systemd/coredump.conf.d/.0disables processing of core dumps bysystemd-coredump.Type: Number.
Default:
0
core_dumps__systemd_storage
The
Storagevalue in/etc/systemd/coredump.conf.d/.nonekeepssystemd-coredumpfrom storing core dumps.Type: String.
Default:
'none'
Example:
# optional
core_dumps__limits_hard_core: 0
core_dumps__systemd_process_size_max: 0
core_dumps__systemd_storage: 'none'