-
Notifications
You must be signed in to change notification settings - Fork 795
ANSSI BP 028 profile for debian12 #11368
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
43043cb
Add ANSSI-BP-028 minimal profile for Debian 12
a-skr bb329dc
change defaut root mail alias in postfix client rule
a-skr 49254b7
enable remediation for Debian in postfix client rule
a-skr ed0ab89
enable bash remediation for Debian in package_installed template
a-skr e7b2582
enable debian 12 in aide_build_database rule
a-skr 2c2a906
fix package name for debian 12 in service_auditd_enabled rule
a-skr 1eff62e
add debian remediation support in grub2_bootloader_argument template and
a-skr c5ad145
enable Debian bash remediation for sysctl template
a-skr 5b936c2
enable Debian remediation for sshd_set_keepalive rule
a-skr 3284660
enable debian 12 ansible remediation for accounts_maximum_age_login_d…
a-skr 803982a
Add ANSSI-BP-028 intermediary profile for Debian 12
a-skr 0aec8ca
enable osrelease strings ending with -amd64 to pass prefer_64bit_os c…
a-skr d270703
enable debian remediation in audit_rules_dac_modification template
a-skr c2c9eab
enable debian remediation in audit_rules_file_deletion_events template
a-skr c762b19
enable debian remediation in audit_rules_uncuccessful_file_modification
a-skr 74c08bd
enable debian remediation in audit_rules_login_events
a-skr be6d8c8
enable debian remediation in audit_rules_time_adjtimex
a-skr f19e686
enable debian remediation in audit_rules_time_clock_settime
a-skr 587d724
enable debian remediation in audit_rules_sysadmin_actions
a-skr afbef02
enable debian remediation in audit_rules_immutable
a-skr 130fc3b
enable debian remediation in audit_rules_networkconfig_modification
a-skr 675c656
enable debian remediation in audit_rules_session_events
a-skr 09b5464
enable debian remediation in audit_time_rules
a-skr e64a47e
escape pipefail for debian in rsyslog_logfiles_attributes_modify
a-skr e3aba7c
enable debian ansible remediation in audit_rules_kernel_module_loadin…
a-skr 6dd8c65
enable debian ansible remediation in audit_rules_kernel_module_loadin…
a-skr 1c98ac1
enable debian ansible remediation in audit_rules_kernel_module_loadin…
a-skr afbbc62
enable debian ansible remediation audit_rules_privileged_commands
a-skr e488314
enable debian ansible remediation in audit_rules_session_events
a-skr a0e7cb2
enable all_apparmor_profiles_enforced for Debian12
a-skr d0702fc
enable apparmor_configured for Debian
a-skr 8f596f9
enable package_apparmor_installed for Debian
a-skr 3806bd4
enable grub2_enable_apparmor for Debian
a-skr 551d518
enable package_pam_apparmor_installed for Debian
a-skr 056beeb
add enhanced ANSSI-BP-028 profile for Debian
a-skr 2d92005
add high ANSSI-BP-028 profile for Debian
a-skr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...guide/services/mail/postfix_client/postfix_client_configure_mail_alias/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
..._os/guide/services/mail/postfix_client/postfix_client_configure_mail_alias/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/services/ssh/ssh_server/sshd_set_keepalive/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/services/ssh/ssh_server/sshd_set_keepalive/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ounts-restrictions/password_expiration/accounts_maximum_age_login_defs/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
linux_os/guide/system/apparmor/all_apparmor_profiles_enforced/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/apparmor/all_apparmor_profiles_enforced/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/apparmor/all_apparmor_profiles_enforced/sce/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/apparmor/apparmor_configured/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/apparmor/apparmor_configured/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # platform = multi_platform_sle,multi_platform_ubuntu | ||
| # platform = multi_platform_sle,multi_platform_ubuntu,multi_platform_ubuntu | ||
|
|
||
| # Enable apparmor | ||
| {{{ bash_service_command("enable", "apparmor") }}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
linux_os/guide/system/apparmor/grub2_enable_apparmor/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/apparmor/package_apparmor_installed/rule.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...s/audit_kernel_module_loading/audit_rules_kernel_module_loading_delete/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...es/audit_kernel_module_loading/audit_rules_kernel_module_loading_finit/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...les/audit_kernel_module_loading/audit_rules_kernel_module_loading_init/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...figure_rules/audit_privileged_commands/audit_rules_privileged_commands/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/auditing/auditd_configure_rules/audit_rules_immutable/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...auditing/auditd_configure_rules/audit_rules_networkconfig_modification/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tem/auditing/auditd_configure_rules/audit_rules_networkconfig_modification/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...uide/system/auditing/auditd_configure_rules/audit_rules_session_events/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...os/guide/system/auditing/auditd_configure_rules/audit_rules_session_events/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../guide/system/auditing/auditd_configure_rules/audit_rules_sysadmin_actions/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...auditing/auditd_configure_rules/audit_time_rules/audit_rules_time_adjtimex/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu | ||
| # platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu,multi_platform_debian | ||
|
|
||
| {{{ bash_perform_audit_adjtimex_settimeofday_stime_remediation() }}} |
2 changes: 1 addition & 1 deletion
2
...ing/auditd_configure_rules/audit_time_rules/audit_rules_time_clock_settime/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...g/auditd_configure_rules/audit_time_rules/audit_rules_time_watch_localtime/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
.../system/software/integrity/software-integrity/aide/aide_build_database/ansible/debian.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # platform = multi_platform_debian | ||
| # reboot = false | ||
| # strategy = restrict | ||
| # complexity = low | ||
| # disruption = low | ||
|
|
||
| - name: "{{{ rule_title }}} - Ensure AIDE Is Installed" | ||
| ansible.builtin.apt: | ||
| name: aide | ||
| state: present | ||
|
|
||
| - name: "{{{ rule_title }}} - Check if DB Path in /etc/aide/aide.conf Is Already Set" | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/aide/aide.conf | ||
| regexp: ^#?(\s*)(database=)(.*)$ | ||
| state: absent | ||
| check_mode: true | ||
| changed_when: false | ||
| register: database_replace | ||
|
|
||
| - name: "{{{ rule_title }}} - Check if DB Out Path in /etc/aide/aide.conf Is Already Set" | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/aide/aide.conf | ||
| regexp: ^#?(\s*)(database_out=)(.*)$ | ||
| state: absent | ||
| check_mode: true | ||
| changed_when: false | ||
| register: database_out_replace | ||
|
|
||
| - name: "{{{ rule_title }}} - Fix DB Path in Config File if Necessary" | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/aide/aide.conf | ||
| regexp: ^#?(\s*)(database)(\s*)=(\s*)(.*)$ | ||
| line: \2\3=\4file:/var/lib/aide/aide.db | ||
| backrefs: true | ||
| when: database_replace.found > 0 | ||
|
|
||
| - name: "{{{ rule_title }}} - Fix DB Out Path in Config File if Necessary" | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/aide/aide.conf | ||
| regexp: ^#?(\s*)(database_out)(\s*)=(\s*)(.*)$ | ||
| line: \2\3=\4file:/var/lib/aide/aide.db.new | ||
| backrefs: true | ||
| when: database_out_replace.found > 0 | ||
|
|
||
| - name: "{{{ rule_title }}} - Ensure the Default DB Path is Added" | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/aide/aide.conf | ||
| line: database=file:/var/lib/aide/aide.db | ||
| create: true | ||
| when: database_replace.found == 0 | ||
|
|
||
| - name: "{{{ rule_title }}} - Ensure the Default Out Path is Added" | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/aide/aide.conf | ||
| line: database_out=file:/var/lib/aide/aide.db.new | ||
| create: true | ||
| when: database_out_replace.found == 0 | ||
|
|
||
| - name: "{{{ rule_title }}} - Build and Test AIDE Database" | ||
| ansible.builtin.command: /usr/sbin/aideinit -y -f |
20 changes: 20 additions & 0 deletions
20
...uide/system/software/integrity/software-integrity/aide/aide_build_database/bash/debian.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # platform = multi_platform_debian | ||
|
|
||
| {{{ bash_package_install("aide") }}} | ||
|
|
||
| AIDE_CONFIG=/etc/aide/aide.conf | ||
| DEFAULT_DB_PATH=/var/lib/aide/aide.db | ||
|
|
||
| # Fix db path in the config file, if necessary | ||
| if ! grep -q '^database=file:' ${AIDE_CONFIG}; then | ||
| # replace_or_append gets confused by 'database=file' as a key, so should not be used. | ||
| #replace_or_append "${AIDE_CONFIG}" '^database=file' "${DEFAULT_DB_PATH}" '@CCENUM@' '%s:%s' | ||
| echo "database=file:${DEFAULT_DB_PATH}" >> ${AIDE_CONFIG} | ||
| fi | ||
|
|
||
| # Fix db out path in the config file, if necessary | ||
| if ! grep -q '^database_out=file:' ${AIDE_CONFIG}; then | ||
| echo "database_out=file:${DEFAULT_DB_PATH}.new" >> ${AIDE_CONFIG} | ||
| fi | ||
|
|
||
| /usr/sbin/aideinit -y -f | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OVAL checks and Ansible and Bash remediations for Debian 12 that you introduce are quite different from the existing ones that are there for other products. Consequently, the description and other texts in the
rule.ymlfile of this rule aren't properly aligned with the actual check and remediation. Please update thelinux_os/guide/system/software/integrity/software-integrity/aide/aide_build_database/rule.ymlin a way so that it better describes the actual situation on Debian 12.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debian description explains an interactive aide database update (through the aideinit wrapper) which, I think, is fitting.
The remedation (non interactive) uses options -y -f to automatically create then deploy the new database.
As per aideinit manpage, the user should ideally check the database content before deploying it, so I prefer a description that doesn't automatically force the deployment of the new DB.