mirror of
https://github.com/dev-sec/ansible-collection-hardening
synced 2024-11-10 09:14:18 +00:00
add feature to disable coredump to limit task (#511)
Signed-off-by: Ludwig Bayerlein <bayerlein@bayerlein-networks.com> Co-authored-by: Ludwig Bayerlein <bayerlein@bayerlein-networks.com>
This commit is contained in:
parent
db78f612f5
commit
bb8e3e375e
2 changed files with 37 additions and 0 deletions
|
@ -34,3 +34,38 @@
|
|||
path: /etc/security/limits.d/10.hardcore.conf
|
||||
state: absent
|
||||
when: os_security_kernel_enable_core_dump | bool
|
||||
|
||||
- block:
|
||||
- name: create coredump.conf.d-directory if it does not exist
|
||||
file:
|
||||
path: '/etc/systemd/coredump.conf.d'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
|
||||
- name: create custom.conf for disabling coredumps
|
||||
template:
|
||||
src: 'etc/systemd/coredump.conf.d/coredumps.conf.j2'
|
||||
dest: '/etc/systemd/coredump.conf.d/custom.conf'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Reload daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
when: not os_security_kernel_enable_core_dump | bool
|
||||
|
||||
- block:
|
||||
- name: Remove coredump.conf.d directory with files
|
||||
file:
|
||||
path: /etc/systemd/coredump.conf.d
|
||||
state: absent
|
||||
|
||||
- name: Reload daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
when: os_security_kernel_enable_core_dump | bool
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[Coredump]
|
||||
Storage=none
|
Loading…
Reference in a new issue