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

update debian12 anssi bp28 minimal profile #11592

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1823d96
update package_ypbind_removed rule for debian12
a-skr Feb 15, 2024
8c2e2d7
update accounts_password_pam_unix_remember for Debian 12
a-skr Feb 15, 2024
2753745
update accounts_passwords_pam_faillock_deny for debian 12
a-skr Feb 15, 2024
a572117
update accounts_passwords_pam_faillock_interval rule for Debian 12
a-skr Feb 15, 2024
58406cb
update accounts_passwords_pam_faillock_unlock_time rule for debian 12
a-skr Feb 15, 2024
028416a
update accounts_password_pam_retry rule for debian 12
a-skr Feb 15, 2024
e5c4677
update accounts_password_set_max_life_root for debian 12
a-skr Feb 15, 2024
60345e9
update accounts_password_pam_unix_rounds_password_auth for debian 12
a-skr Feb 15, 2024
04ff946
add oval_feed_url in debian 12 product and update security_patches_up…
a-skr Feb 15, 2024
1a69ed2
update bash_enable_pam_faillock_directly_in_pam_files macro for debi…
a-skr Feb 15, 2024
e6f0f0d
update accounts_password templates for debian 12
a-skr Feb 15, 2024
d2633ea
update set_password_hashing_algorithm_logindefs for debian 12
a-skr Feb 15, 2024
44d2ddf
update package_pam_pwquality_installed for debian 12
a-skr Feb 15, 2024
f0ea6d4
update anssi bp28 minimal profile for debian 12
a-skr Feb 15, 2024
e5e761f
add audit_rules_privileged_commands_sudo for debian 12
a-skr Feb 16, 2024
cb2330a
update debian12 anssi intermediary profile
a-skr Feb 16, 2024
ee62130
activate bash remediation for debian12 in audit_rules_privileged_comm…
a-skr Feb 19, 2024
69720ab
activate bash remediation for debian12 in audit_rules_privileged_comm…
a-skr Feb 19, 2024
b3017a5
activate bash remediation for debian12 in audit_rules_privileged_comm…
a-skr Feb 19, 2024
43e27b7
enable bash remediation for debian12 in audit_rules_usergroup_modific…
a-skr Feb 19, 2024
99a91f3
update debian12 anssi enhanced profile
a-skr Feb 19, 2024
07aa881
update debian12 anssi high profile
a-skr Feb 19, 2024
1a12864
Update linux_os/guide/system/accounts/accounts-pam/locking_out_passwo…
a-skr Feb 28, 2024
92c4206
Update linux_os/guide/system/accounts/accounts-pam/locking_out_passwo…
a-skr Feb 28, 2024
a438906
Update linux_os/guide/system/accounts/accounts-pam/locking_out_passwo…
a-skr Feb 28, 2024
7ba41dd
Update linux_os/guide/system/accounts/accounts-pam/set_password_hashi…
a-skr Feb 28, 2024
44a24f3
Update shared/templates/accounts_password/ansible.template
a-skr Feb 28, 2024
d1dfc70
Update shared/templates/accounts_password/bash.template
a-skr Feb 28, 2024
64fdbaa
Update shared/templates/audit_rules_privileged_commands/bash.template
a-skr Feb 28, 2024
4bb30c3
Update shared/templates/audit_rules_usergroup_modification/bash.template
a-skr Feb 28, 2024
e43969d
add an account_password_pam_faillock template
a-skr Apr 4, 2024
e243f8b
rewrite accounts_passwords_pam_faillock_deny rule to use
a-skr Apr 3, 2024
f44e383
factorise code in pam_account_password_unix_remember
a-skr Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu
# platform = multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu,multi_platform_debian

# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
{{{ bash_fix_audit_watch_rule("auditctl", "/sbin/insmod", "x", "modules") }}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle,multi_platform_rhel,multi_platform_ubuntu
# platform = multi_platform_sle,multi_platform_rhel,multi_platform_ubuntu,multi_platform_debian

# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
{{{ bash_fix_audit_watch_rule("auditctl", "/sbin/modprobe", "x", "modules") }}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu
# platform = multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu,multi_platform_debian

# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
{{{ bash_fix_audit_watch_rule("auditctl", "/sbin/rmmod", "x", "modules") }}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{%- if product in ["fedora", "ol7", "ol8", "ol9", "rhcos4", "rhel7", "rhel8", "rhel9", "sle12", "sle15", "ubuntu2004", "ubuntu2204"] %}}
{{%- if product in ["fedora", "ol7", "ol8", "ol9", "rhcos4", "rhel7", "rhel8", "rhel9", "sle12", "sle15", "ubuntu2004", "ubuntu2204", "debian12"] %}}
{{%- set perm_x="-F perm=x " %}}
{{%- endif %}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ template:
name: package_removed
vars:
pkgname: ypbind
pkgname@debian12: ypbind-mt

{{% if product in ["rhel9"] %}}
warnings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,69 @@
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle
# platform = multi_platform_all
# reboot = false
# strategy = configure
# complexity = low
# disruption = medium

{{% if product in [ "sle12", "sle15" ] %}}
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/common-password' -%}}
{{{ ansible_instantiate_variables("var_password_pam_unix_remember") }}}

{{% if "ubuntu" in product or "debian" in product %}}
{{% set pam_file='/etc/pam.d/common-password' %}}
{{% set group='password' %}}
{{% set control='\[success=[A-Za-z0-9].*\]' %}}
{{% set module='pam_unix.so' %}}
{{% set option='remember' %}}
{{% set value='{{ var_password_pam_unix_remember }}' %}}
{{% elif product in [ "sle12", "sle15" ] %}}
{{% set pam_file='/etc/pam.d/common-password' %}}
{{% else %}}
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/system-auth' -%}}
{{% set pam_file='/etc/pam.d/system-auth' %}}
{{% endif %}}

{{{ ansible_instantiate_variables("var_password_pam_unix_remember") }}}
{{% if "ubuntu" in product or "debian" in product %}}

# Modified version of macro ansible_ensure_pam_module_option(pam_file, group, control, module, option, value='', after_match='').
# The original macro is designed to search/replace also the control field thus treating the field as a constant and escaping the regex.
# Here we adapt the code to allow using regex on the control field.

- name: '{{{ rule_title }}} - Check if the required PAM module option is present in {{{ pam_file }}}'
ansible.builtin.lineinfile:
path: "{{{ pam_file }}}"
regexp: ^\s*{{{ group }}}\s+{{{ control }}}\s+{{{ module }}}\s*.*\s{{{ option }}}\b
state: absent
check_mode: true
changed_when: false
register: result_pam_module_{{{ option }}}_option_present

- name: '{{{ rule_title }}} - Ensure the "{{{ option }}}" PAM option for "{{{ module }}}" is included in {{{ pam_file }}}'
ansible.builtin.lineinfile:
path: "{{{ pam_file }}}"
backrefs: true
regexp: ^(\s*{{{ group }}}\s+{{{ control }}}\s+{{{ module }}}.*)
line: \1 {{{ option }}}={{{ value }}}
state: present
register: result_pam_{{{ option }}}_add
when:
- result_pam_module_{{{ option }}}_option_present.found == 0

{{{ ansible_pam_pwhistory_enable(accounts_password_pam_unix_remember_file,
- name: '{{{ rule_title }}} - Ensure the required value for "{{{ option }}}" PAM option from "{{{ module }}}" in {{{ pam_file }}}'
ansible.builtin.lineinfile:
path: "{{{ pam_file }}}"
backrefs: true
regexp: ^(\s*{{{ group }}}\s+{{{ control }}}\s+{{{ module }}}\s+.*)({{{ option }}})=[0-9a-zA-Z]+\s*(.*)
line: \1\2={{{ value }}} \3
register: result_pam_{{{ option }}}_edit
when:
- result_pam_module_{{{ option }}}_option_present.found > 0


{{% else %}}

{{{ ansible_pam_pwhistory_enable(pam_file,
'requisite',
'^password.*requisite.*pam_pwquality\.so') }}}

{{{ ansible_pam_pwhistory_parameter_value(accounts_password_pam_unix_remember_file,
{{{ ansible_pam_pwhistory_parameter_value(pam_file,
'remember',
'{{ var_password_pam_unix_remember }}') }}}

{{% endif %}}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle
# platform = multi_platform_all

{{% if product in [ "sle12", "sle15" ] %}}
{{{ bash_instantiate_variables("var_password_pam_unix_remember") }}}

{{% if "debian" in product or "ubuntu" in product or product in ["sle12", "sle15" ] %}}
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/common-password' -%}}
{{% else %}}
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/system-auth' -%}}
{{% endif %}}

{{{ bash_instantiate_variables("var_password_pam_unix_remember") }}}
{{% if "debian" in product or "ubuntu" in product %}}

{{{ bash_ensure_pam_module_options(accounts_password_pam_unix_remember_file, 'password', '\[success=[[:alnum:]].*\]', 'pam_unix.so', 'remember', "$var_password_pam_unix_remember", "$var_password_pam_unix_remember") }}}

{{% else %}}

{{{ bash_pam_pwhistory_enable(accounts_password_pam_unix_remember_file,
'requisite',
Expand All @@ -15,3 +21,6 @@
{{{ bash_pam_pwhistory_parameter_value(accounts_password_pam_unix_remember_file,
'remember',
"$var_password_pam_unix_remember") }}}

{{% endif %}}

This file was deleted.

Loading
Loading