Compare commits

...
35 Commits
Author SHA1 Message Date
schurzi dc22dc33a2 Merge pull request #530 from dev-sec/delete_drafts
delete obsolete release drafts
2022-02-28 10:20:01 +01:00
Martin Schurz 9d00c8ba29 delete old release drafts
Signed-off-by: Martin Schurz <[email protected]>
2022-02-25 20:10:36 +01:00
dev-sec CI bf276ba14d update changelog 2022-02-21 13:03:04 +00:00
abejotaRandAbraham Rebori 8edd650135 change permissions of the tmout.sh file (#520)
Co-authored-by: Abraham Rebori <[email protected]>
2022-02-21 14:01:19 +01:00
dev-sec CI fce131a75d update changelog 2022-02-21 13:00:41 +00:00
Sebastian Gumprich af14af5954 add waivers to skip controls (#529)
Signed-off-by: rndmh3ro <[email protected]>
2022-02-21 13:58:39 +01:00
dev-sec CI b6677fccd9 update changelog 2022-02-21 11:14:34 +00:00
schurzi 9be3a0520b Merge pull request #526 from dev-sec/nginx_debian_9_tls
debian 9's nginx doesn't support tls1.3
2022-02-21 11:49:34 +01:00
dev-sec CI 1f8c8d1c43 update changelog 2022-02-21 10:46:52 +00:00
schurzi 49b93dc89c Merge pull request #525 from dev-sec/remove_centos_8
remove centos8 tests
2022-02-21 11:39:09 +01:00
rndmh3ro 468e4674b8 debian 9's nginx doesnt support tls1.3
while this could be better solved by checking what nginx version is used, debian9 is eol'd in 4 months. if there will be again a need to check for nginx versions, we'll add it then

Signed-off-by: rndmh3ro <[email protected]>
2022-02-21 10:02:54 +01:00
dev-sec CI 2a4d409339 update galaxy.yml with new version 2022-02-21 08:28:20 +00:00
rndmh3ro b74e88723d remove centos8 tests
Signed-off-by: rndmh3ro <[email protected]>
2022-02-21 08:05:40 +01:00
dev-sec CI e0e76fa675 update changelog 2022-02-18 14:46:02 +00:00
Sebastian Gumprich 2ba40b0891 move sysctls to debian specific vars (#524)
* fix ansible-lint issue

https://github.com/ansible-community/ansible-lint/issues/1795
Signed-off-by: rndmh3ro <[email protected]>

* move 2 sysctls to debian specific

Signed-off-by: rndmh3ro <[email protected]>

* fix ansible-lint issue

https://github.com/ansible-community/ansible-lint/issues/1795
Signed-off-by: rndmh3ro <[email protected]>

* add arch linux sysctls

* simplify sysctl settings

Signed-off-by: rndmh3ro <[email protected]>

* ove overwrite to the bottom to let it acutally overwrite something

Signed-off-by: rndmh3ro <[email protected]>

* fix typo

Signed-off-by: rndmh3ro <[email protected]>
2022-02-18 15:30:32 +01:00
dev-sec CI 798f4b9a99 update galaxy.yml with new version 2021-12-16 11:03:39 +00:00
dev-sec CI 507873f388 update changelog 2021-12-16 10:56:21 +00:00
dev-sec CI 8bdf9bbb21 update changelog 2021-12-16 10:41:14 +00:00
lbayerleinandLudwig Bayerlein 1a97c6cf87 new feautre tmout in a new pr (#516)
Signed-off-by: Ludwig Bayerlein <[email protected]>

Co-authored-by: Ludwig Bayerlein <[email protected]>
2021-12-16 11:39:24 +01:00
dev-sec CI 73d319cc79 update changelog 2021-12-10 21:12:13 +00:00
Sebastian Gumprich 8f22ce788c Feature coredump (#513)
* restructure limits-tasks

* disable coredumps in tests

* use notify-task for systemd-reload

Signed-off-by: rndmh3ro <[email protected]>

* add notify to another task

Signed-off-by: rndmh3ro <[email protected]>

* rm obsolete task and rename handler

Signed-off-by: rndmh3ro <[email protected]>
2021-12-10 22:10:14 +01:00
dev-sec CI 945d00fd91 update changelog 2021-12-08 13:27:41 +00:00
lbayerleinandLudwig Bayerlein bb8e3e375e add feature to disable coredump to limit task (#511)
Signed-off-by: Ludwig Bayerlein <[email protected]>

Co-authored-by: Ludwig Bayerlein <[email protected]>
2021-12-08 14:25:49 +01:00
dev-sec CI db78f612f5 update changelog 2021-11-30 09:24:20 +00:00
schurzi 82be5db515 Merge pull request #510 from alegrey91/master
change hidepid mount task state to mounted
2021-11-30 10:22:24 +01:00
alegrey91 8805d9c14a fix: change hidepid mount task state to mounted 2021-11-29 22:37:21 +01:00
dev-sec CI ed17a6370a update changelog 2021-11-29 09:27:29 +00:00
schurzi ad43f908df prettify nginx options (#509)
Signed-off-by: Martin Schurz <[email protected]>
2021-11-29 10:25:43 +01:00
dev-sec CI 530069ae88 update changelog 2021-11-28 10:40:22 +00:00
schurzi cb3574ed56 Merge pull request #501 from ksaadDE/patch-3
Updated dh_params to 4096
2021-11-28 11:38:39 +01:00
dev-sec CI e95729b431 update changelog 2021-11-26 10:34:51 +00:00
duffn 1d25d4185c Update nginx_add_header README to match default (#506)
Signed-off-by: Nicholas Duffy <[email protected]>
2021-11-26 11:31:47 +01:00
tekicat 88893a5d4a Fix duplicate sysctl config (#505)
Signed-off-by: tekicat <[email protected]>
Signed-off-by: gk <[email protected]>
Signed-off-by: Tekicat <[email protected]>
2021-11-26 11:30:50 +01:00
dev-sec CI b67a28bd09 update galaxy.yml with new version 2021-11-23 10:49:03 +00:00
Karim f84ff572ac Updated dh_params to 4096
Updated dh_params to 4096
2021-11-15 19:02:59 +00:00
35 changed files with 205 additions and 61 deletions

No files matched your search

+2
View File
@@ -30,6 +30,8 @@ jobs:
# override-deps: |
# ansible==2.9
# ansible-lint==4.2.0
override-deps: |
rich>=9.5.1,<11.0.0
# [optional]
# Arguments to be passed to the ansible-lint
-1
View File
@@ -23,7 +23,6 @@ jobs:
matrix:
molecule_distro:
- centos7
- centos8
- rocky8
- ubuntu1804
- ubuntu2004
-1
View File
@@ -23,7 +23,6 @@ jobs:
matrix:
molecule_distro:
- centos7
- centos8
- rocky8
- ubuntu1804
- ubuntu2004
-1
View File
@@ -23,7 +23,6 @@ jobs:
matrix:
molecule_distro:
- centos7
- centos8
- rocky8
- ubuntu1804
- ubuntu2004
+5
View File
@@ -66,6 +66,11 @@ jobs:
with:
path: ./CHANGELOGRELEASE.md
- name: Delete old drafts
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release draft
id: create_release
uses: actions/create-release@v1
-1
View File
@@ -23,7 +23,6 @@ jobs:
matrix:
molecule_distro:
- centos7
- centos8
- rocky8
- fedora
- ubuntu1804
@@ -23,7 +23,6 @@ jobs:
matrix:
molecule_distro:
- centos7
- centos8
- rocky8
- fedora
- ubuntu1804
+56
View File
@@ -1,5 +1,61 @@
# Changelog
## [7.14.2](https://github.com/dev-sec/ansible-collection-hardening/tree/7.14.2) (2022-02-21)
[Full Changelog](https://github.com/dev-sec/ansible-collection-hardening/compare/7.14.1...7.14.2)
**Fixed bugs:**
- debian 9's nginx doesn't support tls1.3 [\#526](https://github.com/dev-sec/ansible-collection-hardening/pull/526) [[nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/nginx_hardening)] ([rndmh3ro](https://github.com/rndmh3ro))
- Change permissions of the tmout.sh file [\#520](https://github.com/dev-sec/ansible-collection-hardening/pull/520) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([abejotaR](https://github.com/abejotaR))
**Closed issues:**
- No such file directory error triggered by the kernel.unpriviliged\_userns\_clone configuration. [\#514](https://github.com/dev-sec/ansible-collection-hardening/issues/514)
**Merged pull requests:**
- add waivers to skip controls [\#529](https://github.com/dev-sec/ansible-collection-hardening/pull/529) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([rndmh3ro](https://github.com/rndmh3ro))
- remove centos8 tests [\#525](https://github.com/dev-sec/ansible-collection-hardening/pull/525) [[mysql_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/mysql_hardening)] [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] [[ssh_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/ssh_hardening)] [[nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/nginx_hardening)] ([rndmh3ro](https://github.com/rndmh3ro))
## [7.14.1](https://github.com/dev-sec/ansible-collection-hardening/tree/7.14.1) (2022-02-18)
[Full Changelog](https://github.com/dev-sec/ansible-collection-hardening/compare/7.14.0...7.14.1)
**Fixed bugs:**
- move sysctls to debian specific vars [\#524](https://github.com/dev-sec/ansible-collection-hardening/pull/524) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([rndmh3ro](https://github.com/rndmh3ro))
**Closed issues:**
- Error when using the ssh\_hardening role [\#519](https://github.com/dev-sec/ansible-collection-hardening/issues/519)
## [7.14.0](https://github.com/dev-sec/ansible-collection-hardening/tree/7.14.0) (2021-12-16)
[Full Changelog](https://github.com/dev-sec/ansible-collection-hardening/compare/7.13.2...7.14.0)
**Implemented enhancements:**
- Add option to set timeout in seconds to logout users [\#516](https://github.com/dev-sec/ansible-collection-hardening/pull/516) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([lbayerlein](https://github.com/lbayerlein))
- add feature to disable coredump to limit task [\#511](https://github.com/dev-sec/ansible-collection-hardening/pull/511) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([lbayerlein](https://github.com/lbayerlein))
- change hidepid mount task state to mounted [\#510](https://github.com/dev-sec/ansible-collection-hardening/pull/510) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([alegrey91](https://github.com/alegrey91))
- prettify nginx options [\#509](https://github.com/dev-sec/ansible-collection-hardening/pull/509) [[nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/nginx_hardening)] ([schurzi](https://github.com/schurzi))
- Update nginx\_add\_header README to match default [\#506](https://github.com/dev-sec/ansible-collection-hardening/pull/506) [[nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/nginx_hardening)] ([duffn](https://github.com/duffn))
- Updated dh\_params to 4096 [\#501](https://github.com/dev-sec/ansible-collection-hardening/pull/501) [[nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/nginx_hardening)] ([ksaadDE](https://github.com/ksaadDE))
**Fixed bugs:**
- Duplication of sysctl default parameter fs.protected\_hardlinks and fs.protected\_symlinks [\#502](https://github.com/dev-sec/ansible-collection-hardening/issues/502)
- Fix duplicate sysctl config in fs [\#505](https://github.com/dev-sec/ansible-collection-hardening/pull/505) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([tekicat](https://github.com/tekicat))
**Merged pull requests:**
- Feature coredump [\#513](https://github.com/dev-sec/ansible-collection-hardening/pull/513) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([rndmh3ro](https://github.com/rndmh3ro))
## [7.13.2](https://github.com/dev-sec/ansible-collection-hardening/tree/7.13.2) (2021-11-23)
[Full Changelog](https://github.com/dev-sec/ansible-collection-hardening/compare/7.13.1...7.13.2)
## [7.13.1](https://github.com/dev-sec/ansible-collection-hardening/tree/7.13.1) (2021-11-23)
[Full Changelog](https://github.com/dev-sec/ansible-collection-hardening/compare/7.13.0...7.13.1)
+1 -1
View File
@@ -1,6 +1,6 @@
namespace: devsec
name: hardening
version: 7.12.0
version: 7.14.1
readme: README.md
authors:
- dev-sec <[email protected]>
+1 -1
View File
@@ -16,7 +16,7 @@
name: os_hardening
vars:
os_security_users_allow: change_user
os_security_kernel_enable_core_dump: true
os_security_kernel_enable_core_dump: false
os_security_suid_sgid_remove_from_unknown: true
os_auth_pam_passwdqc_enable: false
os_auth_lockout_time: 15
+1 -1
View File
@@ -55,7 +55,7 @@
shell: "bash /tmp/install.sh -s -- -P cinc-auditor -v 4"
- name: Execute cinc-auditor tests
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit https://github.com/dev-sec/linux-baseline/archive/refs/heads/master.zip"
command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit --waiver-file waivers.yaml https://github.com/dev-sec/linux-baseline/archive/refs/heads/master.zip"
register: test_results
changed_when: false
ignore_errors: true
+3
View File
@@ -0,0 +1,3 @@
os-14:
run: false
justification: "not yet implemented"
+2 -2
View File
@@ -61,8 +61,8 @@ It works with the following nginx-roles, including, but not limited to:
- Default: `default 5`
- Description: Sets the shared memory zone and the maximum allowed number of connections for a given key value.
- [nginx_add_header][]
- Default: `[ "X-Frame-Options SAMEORIGIN", "X-Content-Type-Options nosniff", "X-XSS-Protection \"1; mode=block\"" ]`
- Description:Adds the specified field to a response header provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307.
- Default: `[ "X-Frame-Options SAMEORIGIN", "X-Content-Type-Options nosniff", "X-XSS-Protection \"1; mode=block\"", Content-Security-Policy \"script-src 'self'; object-src 'self'\" ]`
- Description: Adds the specified field to a response header provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307.
- [nginx_ssl_protocols][]
- Default: `TLSv1.2`
- Description: Specifies the SSL protocol which should be used.
+10 -11
View File
@@ -11,19 +11,18 @@ nginx_client_header_timeout: "10"
nginx_send_timeout: "10"
nginx_limit_conn_zone: "$binary_remote_addr zone=default:10m"
nginx_limit_conn: "default 5"
nginx_add_header: [
# vvoid clickjacking
"X-Frame-Options SAMEORIGIN",
# disable content-type sniffing
"X-Content-Type-Options nosniff",
# XSS filter
"X-XSS-Protection \"1; mode=block\"",
"Strict-Transport-Security max-age=15768000",
"Content-Security-Policy \"script-src 'self'; object-src 'self'\"" ]
nginx_add_header:
# avoid clickjacking
- X-Frame-Options SAMEORIGIN
# disable content-type sniffing
- X-Content-Type-Options nosniff
# XSS filter
- X-XSS-Protection "1; mode=block"
- Strict-Transport-Security max-age=15768000
- Content-Security-Policy "script-src 'self'; object-src 'self'"
nginx_set_cookie_flag: "* HttpOnly secure"
nginx_ssl_prefer_server_ciphers: "on"
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
nginx_ssl_ciphers: "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"
nginx_ssl_session_tickets: "off"
nginx_dh_size: "2048"
nginx_dh_size: "4096"
+23
View File
@@ -1,4 +1,27 @@
---
- name: Fetch OS dependent variables
include_vars:
file: '{{ item }}'
name: 'os_vars'
with_first_found:
- files:
- '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml'
- '{{ ansible_facts.distribution }}.yml'
- '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version }}.yml'
- '{{ ansible_facts.os_family }}.yml'
skip: true
tags: always
# we only override variables with our default, if they have not been specified already
# by default the lookup functions finds all varnames containing the string, therefore
# we add ^ and $ to denote start and end of string, so this returns only exact matches
- name: Set OS dependent variables, if not already defined by user # noqa var-naming
set_fact:
'{{ item.key }}': '{{ item.value }}'
when: "not lookup('varnames', '^' + item.key + '$')"
with_dict: '{{ os_vars }}'
tags: always
- name: Create additional configuration
template:
src: "hardening.conf.j2"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
+2
View File
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
-1
View File
@@ -1 +0,0 @@
---
+3
View File
@@ -250,6 +250,9 @@ We know that this is the case on Raspberry Pi.
- `os_profile_enabled`
- Default: `true`
- Description: Set to false to disable installing and configuring profile.
- `os_security_auto_logout`
- Default: `0`
- Description: Set timeout in seconds for logout users automatically after time. Setting this to `0` disables the timeout.
- `os_securetty_enabled`
- Default: `true`
- Description: Set to false to disable installing and configuring securetty.
+9 -18
View File
@@ -70,6 +70,12 @@ sysctl_config:
fs.protected_hardlinks: 1
fs.protected_symlinks: 1
# For more info on the following settings see: https://www.kernel.org/doc/html/latest/admin-guide/sysctl/fs.html
# Restrict FIFO special device creation behavior
fs.protected_fifos: 1
# Restrict regular files creation behavior
fs.protected_regular: 2
# Prevent core dumps with SUID. These are usually only
# needed by developers and may contain sensitive information. | sysctl-31
fs.suid_dumpable: 0
@@ -282,24 +288,6 @@ sysctl_config:
vm.mmap_rnd_bits: 32
vm.mmap_rnd_compat_bits: 16
# Disable unprivileged users from loading eBPF programs into the kernel.
# One of mitigations against CVE-2021-33909. | Tail-2
kernel.unprivileged_bpf_disabled: 1
# Reduce attack surface by disabling unprivileged user namespaces.
# Mitigates CVE-2021-33909 and other exploits.
kernel.unprivileged_userns_clone: 0
# For more info on the following settings see: https://www.kernel.org/doc/html/latest/admin-guide/sysctl/fs.html
# Restrict FIFO special device creation behavior
fs.protected_fifos: 1
# Restrict hardlink creation behavior
fs.protected_hardlinks: 1
# Restrict regular files creation behavior
fs.protected_regular: 2
# Restrict symlink following behavior
fs.protected_symlinks: 1
# Do not delete the following line or otherwise the playbook will fail
# at task 'create a combined sysctl-dict if overwrites are defined'
sysctl_overwrite:
@@ -368,6 +356,9 @@ os_profile_enabled: true
# Set to false to disable installing and configuring securetty.
os_securetty_enabled: true
# Set timeout in seconds for logout users automatically after time. Setting this to `0` disables the timeout.
os_security_auto_logout: 0
# Set to false to disable installing and configuring sysctl.
os_sysctl_enabled: true
+4
View File
@@ -7,3 +7,7 @@
cmd: 'service auditd restart' # rhel: see: https://access.redhat.com/solutions/2664811
warn: false # sadly 'service' module fails in that case also by using 'use: service'
when: molecule_yml is not defined # restarting auditd in a container does not work
- name: Reload systemd
systemd:
daemon_reload: yes
+34 -5
View File
@@ -1,5 +1,6 @@
---
- block:
- name: disable coredumps
block:
- name: Create limits.d-directory if it does not exist | sysctl-31a, sysctl-31b
file:
path: '/etc/security/limits.d'
@@ -27,10 +28,38 @@
modification_time: preserve
access_time: preserve
- 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
when: ansible_service_mgr == "systemd"
- 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
when: ansible_service_mgr == "systemd"
notify: Reload systemd
when: not os_security_kernel_enable_core_dump | bool
- name: Remove 10.hardcore.conf config file
file:
path: /etc/security/limits.d/10.hardcore.conf
state: absent
- name: enable coredumps
block:
- name: Remove coredump.conf.d directory with files
file:
path: /etc/systemd/coredump.conf.d
state: absent
when: ansible_service_mgr == "systemd"
notify: Reload systemd
- name: Remove 10.hardcore.conf config file
file:
path: /etc/security/limits.d/10.hardcore.conf
state: absent
when: os_security_kernel_enable_core_dump | bool
+1 -1
View File
@@ -79,4 +79,4 @@
src: proc
fstype: proc
opts: '{{ proc_mnt_options }}'
state: present
state: mounted
+8
View File
@@ -13,3 +13,11 @@
path: /etc/profile.d/pinerolo_profile.sh
state: absent
when: os_security_kernel_enable_core_dump | bool
- name: Add autologout to profile env
template:
src: 'etc/profile.d/tmout.sh.j2'
dest: '/etc/profile.d/tmout.sh'
owner: 'root'
group: 'root'
mode: '0644'
+11 -11
View File
@@ -43,6 +43,17 @@
- name: Change sysctls
block:
- name: Create a combined sysctl-dict if os-dependent sysctls are defined
set_fact:
sysctl_config: '{{ sysctl_config | combine(sysctl_custom_config) }}'
when: sysctl_custom_config | default()
# sysctl_rhel_config is kept for backwards-compatibility. use sysctl_custom_config instead
- name: Create a combined sysctl-dict if os-dependent sysctls are defined
set_fact:
sysctl_config: '{{ sysctl_config | combine(sysctl_rhel_config) }}'
when: sysctl_rhel_config | default()
- name: Create a combined sysctl-dict if overwrites are defined
set_fact:
sysctl_config: '{{ sysctl_config | combine(sysctl_overwrite) }}'
@@ -57,17 +68,6 @@
reload: true
ignoreerrors: true
with_dict: '{{ sysctl_config }}'
- name: Change various sysctl-settings on Amazon Linux, look at the sysctl-vars file for documentation
sysctl:
name: '{{ item.key }}'
value: '{{ item.value }}'
state: present
reload: true
ignoreerrors: true
with_dict: '{{ sysctl_rhel_config }}'
when: ansible_facts.distribution == 'Amazon'
when: ansible_virtualization_type not in ['docker', 'lxc', 'openvz']
- name: Apply ufw defaults
@@ -0,0 +1,3 @@
# Logout Timeout
export TMOUT={{ os_security_auto_logout }}
readonly TMOUT
@@ -0,0 +1,2 @@
[Coredump]
Storage=none
-4
View File
@@ -45,8 +45,4 @@ auditd_package: 'audit'
# system accounts that do not get their login disabled and pasword changed
os_always_ignore_users: ['root', 'sync', 'shutdown', 'halt', 'ec2-user']
sysctl_rhel_config:
# ExecShield protection against buffer overflows
kernel.exec-shield: 1
hidepid_option: '2' # allowed values: 0, 1, 2
+6
View File
@@ -33,3 +33,9 @@ modprobe_package: 'kmod'
auditd_package: 'audit'
hidepid_option: '2' # allowed values: 0, 1, 2
sysctl_custom_config:
# Mitigation of vulnerability CVE-2021-33909
kernel.unprivileged_userns_clone: 0
# Mitigation of vulnerability CVE-2021-33910
kernel.unprivileged_bpf_disabled: 1
+6
View File
@@ -43,3 +43,9 @@ tally2_path: '/usr/share/pam-configs/tally2'
passwdqc_path: '/usr/share/pam-configs/passwdqc'
hidepid_option: '2' # allowed values: 0, 1, 2
sysctl_custom_config:
# Mitigation of vulnerability CVE-2021-33909
kernel.unprivileged_userns_clone: 0
# Mitigation of vulnerability CVE-2021-33910
kernel.unprivileged_bpf_disabled: 1