Compare commits
9
Commits
7.15.0
...
with_flattened
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddce9eccd9 | ||
|
|
92afe6e336 | ||
|
|
41982c15a8 | ||
|
|
c05fe8b520 | ||
|
|
26e37cabc5 | ||
|
|
862edbbe40 | ||
|
|
9d6903e7ad | ||
|
|
b6f32948ec | ||
|
|
0a25d486a0 |
No files matched your search
+3
-1
@@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## [7.15.0](https://github.com/dev-sec/ansible-collection-hardening/tree/7.15.0) (2022-07-08)
|
||||
## [7.15.0](https://github.com/dev-sec/ansible-collection-hardening/tree/7.15.0) (2022-07-11)
|
||||
|
||||
[Full Changelog](https://github.com/dev-sec/ansible-collection-hardening/compare/7.14.3...7.15.0)
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- os\_hardening gpg-check enabled fails on success [\#549](https://github.com/dev-sec/ansible-collection-hardening/issues/549) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)]
|
||||
- add VM tests for os\_hardening [\#547](https://github.com/dev-sec/ansible-collection-hardening/pull/547) [[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)] ([schurzi](https://github.com/schurzi))
|
||||
- Linting [\#546](https://github.com/dev-sec/ansible-collection-hardening/pull/546) [[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.3](https://github.com/dev-sec/ansible-collection-hardening/tree/7.14.3) (2022-06-29)
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
---
|
||||
namespace: devsec
|
||||
name: hardening
|
||||
version: 7.14.3
|
||||
version: 7.15.0
|
||||
readme: README.md
|
||||
authors:
|
||||
- dev-sec <[email protected]>
|
||||
|
||||
@@ -4,16 +4,17 @@
|
||||
# still getting found and the permissions minimized in the next task.
|
||||
# This is also the reason why there's ignore_errors: true on the task.
|
||||
# also see: https://github.com/dev-sec/ansible-os-hardening/issues/219
|
||||
|
||||
- name: Find files with write-permissions for group
|
||||
shell: "find -L {{ item }} -perm /go+w -type f" # noqa command-instead-of-shell
|
||||
with_flattened:
|
||||
loop:
|
||||
- '/usr/local/sbin'
|
||||
- '/usr/local/bin'
|
||||
- '/usr/sbin'
|
||||
- '/usr/bin'
|
||||
- '/sbin'
|
||||
- '/bin'
|
||||
- "{{ os_env_extra_user_paths }}" # noqa deprecated-bare-vars
|
||||
- "{{ os_env_extra_user_paths | flatten }}" # noqa deprecated-bare-vars
|
||||
register: minimize_access_directories
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
@@ -208,6 +209,11 @@
|
||||
group: 'root'
|
||||
mode: '{{ os_mnt_var_log_dir_mode }}'
|
||||
|
||||
- name: Check if /var/log/audit exists
|
||||
stat:
|
||||
path: /var/log/audit
|
||||
register: var_log_audit_exists
|
||||
|
||||
- name: Mount /var/log/audit with hardened options
|
||||
mount:
|
||||
path: /var/log/audit
|
||||
@@ -216,7 +222,10 @@
|
||||
opts: '{{ os_mnt_var_log_audit_options }}'
|
||||
state: present
|
||||
register: varlogauditmount
|
||||
when: os_mnt_var_log_audit_enabled | bool
|
||||
when:
|
||||
- os_mnt_var_log_audit_enabled | bool
|
||||
- var_log_audit_exists.stat.exists | bool
|
||||
- os_auditd_enabled | bool
|
||||
|
||||
- name: Harden permissions for /var/log/audit directory
|
||||
file:
|
||||
@@ -224,6 +233,10 @@
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '{{ os_mnt_var_log_audit_dir_mode }}'
|
||||
when:
|
||||
- os_mnt_var_log_audit_enabled | bool
|
||||
- var_log_audit_exists.stat.exists | bool
|
||||
- os_auditd_enabled | bool
|
||||
|
||||
- name: Mount /var/tmp with hardened options
|
||||
mount:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
file:
|
||||
dest: '~{{ item }}/.rhosts'
|
||||
state: 'absent'
|
||||
with_flattened: '{{ users_accounts.stdout_lines | default([]) }}'
|
||||
loop: '{{ users_accounts.stdout_lines | default([]) | flatten }}'
|
||||
|
||||
- name: Delete hosts.equiv from system | os-01
|
||||
file:
|
||||
@@ -20,4 +20,4 @@
|
||||
file:
|
||||
dest: '~{{ item }}/.netrc'
|
||||
state: 'absent'
|
||||
with_flattened: '{{ users_accounts.stdout_lines | default([]) }}'
|
||||
loop: '{{ users_accounts.stdout_lines | default([]) | flatten }}'
|
||||
@@ -6,9 +6,9 @@
|
||||
state: 'file'
|
||||
follow: 'yes'
|
||||
failed_when: false
|
||||
with_flattened:
|
||||
- '{{ os_security_suid_sgid_system_blacklist }}'
|
||||
- '{{ os_security_suid_sgid_blacklist }}'
|
||||
loop:
|
||||
- '{{ os_security_suid_sgid_system_blacklist | flatten }}'
|
||||
- '{{ os_security_suid_sgid_blacklist | flatten }}'
|
||||
|
||||
- name: Find binaries with suid/sgid set | os-06
|
||||
shell: find / -xdev \( -perm -4000 -o -perm -2000 \) -type f ! -path '/proc/*' -print 2>/dev/null
|
||||
@@ -27,6 +27,6 @@
|
||||
mode: 'a-s'
|
||||
state: 'file'
|
||||
follow: 'yes'
|
||||
with_flattened:
|
||||
- '{{ suid | default([]) | difference(os_security_suid_sgid_whitelist) }}'
|
||||
loop:
|
||||
- '{{ suid | default([]) | difference(os_security_suid_sgid_whitelist) | flatten }}'
|
||||
when: os_security_suid_sgid_remove_from_unknown | bool
|
||||
@@ -43,8 +43,8 @@
|
||||
shell: '{{ os_nologin_shell_path }}'
|
||||
password: '*'
|
||||
createhome: false
|
||||
with_flattened:
|
||||
- '{{ sys_accs_cond | default([]) | difference(os_ignore_users) | list }}'
|
||||
loop:
|
||||
- '{{ sys_accs_cond | default([]) | difference(os_ignore_users) | list | flatten }}'
|
||||
|
||||
- name: get all home directories in /home, but skip ignored users
|
||||
find:
|
||||
|
||||
Reference in new issue
Block a user