Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of core dump hardening configuration if core dumps are allowed #146

Merged
merged 2 commits into from
Dec 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 30 additions & 14 deletions tasks/limits.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
---

- name: create limits.d-directory if it does not exist | sysctl-31a, sysctl-31b
- block:
- name: create limits.d-directory if it does not exist | sysctl-31a, sysctl-31b
file:
path: '/etc/security/limits.d'
owner: 'root'
group: 'root'
mode: '0755'
state: 'directory'

- name: create aditional limits config file -> 10.hardcore.conf | sysctl-31a, sysctl-31b
pam_limits:
dest: '/etc/security/limits.d/10.hardcore.conf'
domain: '*'
limit_type: hard
limit_item: core
value: 0
comment: Prevent core dumps for all users. These are usually only needed by developers and may contain sensitive information

- name: set 10.hardcore.conf perms to 0400 and root ownership
file:
path: /etc/security/limits.d/10.hardcore.conf
owner: 'root'
group: 'root'
mode: '0440'

when: 'not os_security_kernel_enable_core_dump'

- name: remove 10.hardcore.conf config file
file:
path: '/etc/security/limits.d'
owner: 'root'
group: 'root'
mode: '0755'
state: 'directory'
when: 'os_security_kernel_enable_core_dump'
path: /etc/security/limits.d/10.hardcore.conf
state: absent

- name: create sane limits.conf | sysctl-31a, sysctl-31b
template:
src: 'limits.conf.j2'
dest: '/etc/security/limits.d/10.hardcore.conf'
owner: 'root'
group: 'root'
mode: '0440'
when: 'os_security_kernel_enable_core_dump'
8 changes: 7 additions & 1 deletion tasks/profile.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
- name: create profile.conf
- name: add pinerolo_profile.sh to profile.d
template:
src: 'profile.conf.j2'
dest: '/etc/profile.d/pinerolo_profile.sh'
owner: 'root'
group: 'root'
mode: '0750'
when: not os_security_kernel_enable_core_dump

- name: remove pinerolo_profile.sh from profile.d
file:
path: /etc/profile.d/pinerolo_profile.sh
state: absent
when: os_security_kernel_enable_core_dump
3 changes: 0 additions & 3 deletions templates/limits.conf.j2

This file was deleted.