From 14256eb9fb7e8fa3fb2ace1477d497b94925d4da Mon Sep 17 00:00:00 2001 From: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:08:25 +0300 Subject: [PATCH 1/5] xattrs is removed for sle16/opensuse16 since AIDE does not support it, aide_verify_ext_attributes rule is disabled also --- .../aide/aide_check_audit_tools/oval/shared.xml | 4 ++++ .../aide/aide_check_audit_tools/tests/correct.pass.sh | 6 +++++- .../aide/aide_check_audit_tools/tests/extra_suffix.fail.sh | 6 +++++- shared/macros/01-general.jinja | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml index 13e9e377e316..411874fe751b 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml @@ -11,7 +11,11 @@ {{% if 'rhel' not in product and 'ubuntu' not in product and 'ol' not in families and 'fedora' not in product %}} + {{% if product in ['sle16'] %}} + p+i+n+u+g+s+b+acl+selinux+sha512 + {{% else %}} p+i+n+u+g+s+b+acl+selinux+xattrs+sha512 + {{% endif %}} {{% else %}} ^p\+i\+n\+u\+g\+s\+b\+acl(|\+selinux)\+xattrs\+sha512$ {{% endif %}} diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh index 7795e143b54a..db6c7ee6567c 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu,multi_platform_almalinux +# platform = multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu # packages = aide aide --init @@ -14,5 +14,9 @@ bins=( echo >> {{{ aide_conf_path }}} for theFile in "${bins[@]}" do + {{% if product in ['sle16'] %}} + echo "$theFile p+i+n+u+g+s+b+acl+sha512" >> {{{ aide_conf_path }}} + {{% else %}} echo "$theFile p+i+n+u+g+s+b+acl+xattrs+sha512" >> {{{ aide_conf_path }}} + {{% endif %}} done diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/extra_suffix.fail.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/extra_suffix.fail.sh index dc664133e207..b2f4b95a65b2 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/extra_suffix.fail.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/extra_suffix.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu,multi_platform_almalinux +# platform = multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu # packages = aide declare -a bins @@ -11,5 +11,9 @@ bins=( for theFile in "${bins[@]}" do + {{% if product in ['sle16'] %}} + echo "$theFile p+i+n+u+g+s+b+acl+selinux+sha5122" >> {{{ aide_conf_path }}} + {{% else %}} echo "$theFile p+i+n+u+g+s+b+acl+selinux+xattrs+sha5122" >> {{{ aide_conf_path }}} + {{% endif %}} done diff --git a/shared/macros/01-general.jinja b/shared/macros/01-general.jinja index 8166bc149381..46066b6d7618 100644 --- a/shared/macros/01-general.jinja +++ b/shared/macros/01-general.jinja @@ -1250,7 +1250,11 @@ For more details on configuring kernel arguments in bootable container images, p #}} {{%- macro aide_string() -%}} {{%- if 'rhel' not in product and 'ubuntu' not in product and 'ol' not in families and product not in ['fedora'] -%}} +{{%- if product in ['sle16'] -%}} +p+i+n+u+g+s+b+acl+selinux+sha512 +{{%- else -%}} p+i+n+u+g+s+b+acl+selinux+xattrs+sha512 +{{%- endif -%}} {{%- else -%}} p+i+n+u+g+s+b+acl+xattrs+sha512 {{%- endif -%}} From b7f9789a71d724eeb2f087a66b489103111ac221 Mon Sep 17 00:00:00 2001 From: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:13:07 +0300 Subject: [PATCH 2/5] AIDE patch: all SUSE platforms use aide.service for checking aide DB aide.timer for triggering aide.service aidecheck-notify.service sending /var/log/aide-report.log to configured mail --- .../tests/correct_with_selinux.pass.sh | 6 +- .../tests/expect_sbin_path.pass.sh | 6 +- .../tests/not_config.fail.sh | 2 +- .../ansible/shared.yml | 54 +++++++---- .../bash/shared.sh | 35 ++++--- .../oval/shared.xml | 16 ++-- .../tests/aide_timer_weekly.pass.sh | 21 ++-- .../aide_scan_notification/ansible/shared.yml | 96 +++++++++++++++---- .../aide_scan_notification/bash/shared.sh | 59 ++++++++---- .../aide_scan_notification/oval/shared.xml | 31 ++++-- .../aide/aide_scan_notification/rule.yml | 10 +- .../aide/aide_use_fips_hashes/bash/shared.sh | 2 +- .../tests/correct_value.pass.sh | 3 +- .../tests/correct_value_inline.pass.sh | 3 +- .../tests/wrong_value.fail.sh | 2 +- .../tests/wrong_value_inline.fail.sh | 2 +- .../file_audit_tools_group_ownership/rule.yml | 7 +- .../aide/file_audit_tools_ownership/rule.yml | 6 +- .../file_audit_tools_permissions/rule.yml | 6 +- 19 files changed, 266 insertions(+), 101 deletions(-) diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh index 5a9f67915568..522cf2e3dc77 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct_with_selinux.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu,multi_platform_almalinux +# platform = multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu # packages = aide declare -a bins @@ -12,5 +12,9 @@ bins=( echo >> {{{ aide_conf_path }}} for theFile in "${bins[@]}" do + {{% if product in ['sle16'] %}} + echo "$theFile p+i+n+u+g+s+b+acl+selinux+sha512" >> {{{ aide_conf_path }}} + {{% else %}} echo "$theFile p+i+n+u+g+s+b+acl+selinux+xattrs+sha512" >> {{{ aide_conf_path }}} + {{% endif %}} done diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/expect_sbin_path.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/expect_sbin_path.pass.sh index f3a768e16b61..5730366c3b85 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/expect_sbin_path.pass.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/expect_sbin_path.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu,multi_platform_almalinux +# platform = multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu # packages = aide declare -a bins @@ -12,5 +12,9 @@ bins=( echo >> {{{ aide_conf_path }}} for theFile in "${bins[@]}" do + {{% if product in ['sle16'] %}} + echo "$theFile p+i+n+u+g+s+b+acl+sha512" >> {{{ aide_conf_path }}} + {{% else %}} echo "$theFile p+i+n+u+g+s+b+acl+xattrs+sha512" >> {{{ aide_conf_path }}} + {{% endif %}} done diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh index 026e5b3ed037..f340db561154 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/not_config.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu,multi_platform_almalinux +# platform = multi_platform_almalinux,multi_platform_fedora,multi_platform_sle,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu # packages = aide aide --init diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml index 36a76ba9f388..5c7d035a78bb 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml @@ -4,14 +4,32 @@ # complexity = low # disruption = low -- name: "{{{ rule_title }}} - Define AIDE Periodic Check Service" - ansible.builtin.blockinfile: - create: yes - dest: /etc/systemd/system/aidecheck.service +{{% set aide_service = 'aide.service' %}} +{{% set aide_timer = 'aide.timer' %}} + +{{% if product in ["sle16"] %}} +- name: "{{{ rule_title }}} - Make sure AIDE Check Service is including /etc/aide.conf" + ansible.builtin.copy: + dest: /etc/aide_service.conf + owner: root + group: root + mode: 0600 + content: |- + "@@include /etc/aide.conf" + +- name: "{{{ rule_title }}} - Make sure AIDE Check Service is in enabled state" + ansible.builtin.file: + src: /usr/lib/systemd/system/{{{ aide_service }}} + path: /etc/systemd/system/multi-user.target.wants/{{{ aide_service }}} + state: link +{{% else %}} +- name: "{{{ rule_title }}} - Define AIDE Periodic Check Service {{{ aide_service }}}" + ansible.builtin.copy: + dest: /etc/systemd/system/{{{ aide_service }}} owner: root group: root - mode: '0644' - block: | + mode: 0644 + content: |- [Unit] Description=Aide Check [Service] @@ -20,35 +38,35 @@ [Install] WantedBy=multi-user.target -- name: "{{{ rule_title }}} - Define AIDE Periodic Check Service Timer" - ansible.builtin.blockinfile: - create: yes - dest: /etc/systemd/system/aidecheck.timer +- name: "{{{ rule_title }}} - Define AIDE Periodic Check Service Timer {{{ aide_timer }}}" + ansible.builtin.copy: + dest: /etc/systemd/system/{{{ aide_timer }}} owner: root group: root - mode: '0644' - block: | + mode: 0644 + content: |- [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 - Unit=aidecheck.service + Unit={{{ aide_service }}} [Install] WantedBy=multi-user.target -- name: "{{{ rule_title }}} - Ensure AIDE Service is Enabled" +{{% endif %}} +- name: "{{{ rule_title }}} - Ensure AIDE Service {{{ aide_service }}} is enabled" ansible.builtin.systemd: - name: aidecheck.service + name: {{{ aide_service }}} enabled: true daemon_reload: true masked: false when: not ansible_check_mode -- name: "{{{ rule_title }}} - Ensure AIDE Service Timer is Enabled" +- name: "{{{ rule_title }}} - Ensure AIDE Service Timer {{{ aide_timer }}} is enabled" ansible.builtin.systemd: - name: aidecheck.timer - state: started + name: {{{ aide_timer }}} enabled: true daemon_reload: true + state: started masked: false when: not ansible_check_mode diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh index 595783f93ce6..0dc43a84549f 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh @@ -2,8 +2,17 @@ {{{ bash_package_install("aide") }}} +{{% set aide_service = 'aide.service' %}} +{{% set aide_timer = 'aide.timer' %}} + +{{% if product in ["sle16"] %}} +cat > /etc/aide_service.conf < /etc/systemd/system/aidecheck.service < /etc/systemd/system/{{{ aide_service }}} < /etc/systemd/system/aidecheck.timer < /etc/systemd/system/{{{ aide_timer }}} < {{{ oval_metadata("Make sure systemd timer is defined to run perodic AIDE check.", rule_title=rule_title) }}} @@ -5,25 +7,25 @@ + comment="systemd {{{ aide_service }}} enabled"/> + comment="systemd {{{ aide_timer }}} active"/> - aidecheck.service + {{{ aide_service }}} UnitFileState - aidecheck.timer + {{{ aide_timer }}} UnitFileState - aidecheck.timer + {{{ aide_timer }}} ActiveState @@ -34,7 +36,7 @@ + comment="systemd {{{ aide_service }}} enabled"> @@ -44,7 +46,7 @@ + comment="systemd {{{ aide_timer }}} active"> diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh index 3d0859291e15..626720af8423 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh @@ -2,8 +2,14 @@ # platform = multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro,multi_platform_almalinux # packages = aide +{{% set aide_service = 'aide.service' %}} +{{% set aide_timer = 'aide.timer' %}} + +{{% if product in ["sle16"] %}} +ln -s /usr/lib/systemd/system/{{{ aide_service }}} /etc/systemd/system/multi-user.target.wants/{{{ aide_service }}} +{{% else %}} # create unit file for periodic aide database check -cat > /etc/systemd/system/aidecheck.service < /etc/systemd/system/{{{ aide_service }}} < /etc/systemd/system/aidecheck.timer < /etc/systemd/system/{{{ aide_timer }}} < /etc/systemd/system/aidecheck.service < {{{ aide_service_unit }}} < /etc/systemd/system/aidecheck-notify.service < {{{ aide_notify_unit }}} < {{{ oval_metadata("AIDE should notify appropriate personnel of the details @@ -11,7 +14,7 @@ test_ref="test_aide_var_cron_notification" /> -{{% if product in ["sle15", "slmicro5", "slmicro6"] %}} +{{% if product in ["sle15", "sle16", "slmicro5", "slmicro6"] %}} @@ -52,7 +55,7 @@ ^.*{{{ aide_bin_path }}}[\s]*\-\-check.*\|.*/bin/mail[\s]*-s[\s]*".*"[\s]*.+@.+$ 1 -{{% if product in ["sle15", "slmicro5", "slmicro6"] %}} +{{% if product in ["sle15", "sle16", "slmicro5", "slmicro6"] %}} @@ -60,8 +63,12 @@ - /etc/systemd/system/aidecheck.service - ^.*ExecStart\=.*/usr/bin/aide[\s]*\-\-check.*\-r\s*file:\/w*.*$ + {{% if product in ["sle16"] %}} + /usr/lib/systemd/system/{{{ aide_service }}} + {{% else %}} + /etc/systemd/system/{{{ aide_service }}} + {{% endif %}} + ^.*ExecStart\=.*/usr/bin/aide[\s]*\-\-check.*$ 1 - /etc/systemd/system/aidecheck.service - ^.*Before\=.*aidecheck-notify.service.*$ + {{% if product in ["sle16"] %}} + /usr/lib/systemd/system/{{{ aide_service }}} + {{% else %}} + /etc/systemd/system/{{{ aide_service }}} + {{% endif %}} + ^.*Before\=.*{{{ aide_notify_service }}}.*$ 1 - /etc/systemd/system/aidecheck.service - ^.*Wants\=.*aidecheck-notify.service.*$ + {{% if product in ["sle16"] %}} + /usr/lib/systemd/system/{{{ aide_service }}} + {{% else %}} + /etc/systemd/system/{{{ aide_service }}} + {{% endif %}} + ^.*Wants\=.*{{{ aide_notify_service }}}.*$ 1 {{% endif %}} diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml index 5788f259eac1..ceca9f3551ab 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml @@ -50,11 +50,17 @@ references: stigid@ol8: OL08-00-010360 stigid@sle12: SLES-12-010510 +{{% if product in ["sle15", "sle16", "slmicro5", "slmicro6"] %}} +platform: package[aide] and package[systemd] +{{% else %}} +platform: package[aide] +{{% endif %}} + ocil_clause: 'AIDE has not been configured or has not been configured to notify personnel of scan details' ocil: |- To determine that periodic AIDE execution has been scheduled, run the following command: -{{% if product in ["sle15", "slmicro5", "slmicro6"] %}} +{{% if product in ["sle15", "sle16", "slmicro5", "slmicro6"] %}}
$ sudo systemctl status  aidecheck-notify|grep loaded
The output should return that the service is loaded. Also we should make sure that notification service is started by the check: @@ -73,7 +79,7 @@ fixtext: |- The AIDE tool can be configured to email designated personnel with the use of the cron system. The following example output is generic. It will set cron to run AIDE daily and to send email at the completion of the analysis. -{{% if product in ["sle15", "slmicro5", "slmicro6"] %}} +{{% if product in ["sle15", "sle16", "slmicro5", "slmicro6"] %}} $ cat > /etc/systemd/system/aidecheck-notify.service </etc/aide.conf </etc/aide.conf </etc/aide.conf </etc/aide.conf < Date: Sun, 20 Sep 2026 12:53:02 +0300 Subject: [PATCH 3/5] Fix tests according to copilot suggestion --- .../aide/aide_check_audit_tools/tests/correct.pass.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh index db6c7ee6567c..9b3c6fc05734 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/tests/correct.pass.sh @@ -15,7 +15,7 @@ echo >> {{{ aide_conf_path }}} for theFile in "${bins[@]}" do {{% if product in ['sle16'] %}} - echo "$theFile p+i+n+u+g+s+b+acl+sha512" >> {{{ aide_conf_path }}} + echo "$theFile p+i+n+u+g+s+b+acl+selinux+sha512" >> {{{ aide_conf_path }}} {{% else %}} echo "$theFile p+i+n+u+g+s+b+acl+xattrs+sha512" >> {{{ aide_conf_path }}} {{% endif %}} From 9d2360d67875f83e640d6bc2d028dcada493fbbb Mon Sep 17 00:00:00 2001 From: Yavor Georgiev Date: Sun, 20 Sep 2026 12:54:03 +0300 Subject: [PATCH 4/5] Fix aide_scan_notification check and remediations according to copilot review - added check for setting report_url=file:/var/log/aide-report.log in /etc/aide.conf - make sure we do not end up with duplicating report_url=file:/var/log/aide-report.log entries - in the oval for sle15 use previous file regex --- .../aide_scan_notification/ansible/shared.yml | 7 ------- .../aide_scan_notification/bash/shared.sh | 3 ++- .../aide_scan_notification/oval/shared.xml | 20 ++++++++++++++++++- .../aide/aide_scan_notification/rule.yml | 8 ++++++-- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/ansible/shared.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/ansible/shared.yml index b7a6da943ca9..94b953c23f3a 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/ansible/shared.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/ansible/shared.yml @@ -8,13 +8,6 @@ {{% set aide_service = 'aide.service' %}} {{% set aide_notify_service = 'aidecheck-notify.service' %}} -- name: "{{{ rule_title }}} - Ensure AIDE is installed" - ansible.builtin.package: - name: "{{ item }}" - state: present - with_items: - - aide - {{% if product in ["sle16"] %}} - name: "{{{ rule_title }}} - Ensure report_url is set to file:/var/log/aide-report.log in /etc/aide.conf" ansible.builtin.lineinfile: diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/bash/shared.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/bash/shared.sh index 0927f701aa49..7aa95c753455 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/bash/shared.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/bash/shared.sh @@ -9,7 +9,8 @@ {{% if product in ["sle16"] %}} {{% set aide_service_unit = "/usr/lib/systemd/system/" ~ aide_service %}} {{% set aide_notify_unit = "/usr/lib/systemd/system/" ~ aide_notify_service %}} -{{{ lineinfile_present('/etc/aide.conf','report_url=file:/var/log/aide-report.log') }}} +{{{ lineinfile_absent('/etc/aide.conf', 'report_url=file:/var/log/aide-report.log', sed_path_separator="#") }}} +{{{ lineinfile_present('/etc/aide.conf', 'report_url=file:/var/log/aide-report.log') }}} {{% else %}} {{% set aide_service_unit = "/etc/systemd/system/" ~ aide_service %}} {{% set aide_notify_unit = "/etc/systemd/system/" ~ aide_notify_service %}} diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/oval/shared.xml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/oval/shared.xml index e2377258b8cc..6fd712841865 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/oval/shared.xml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/oval/shared.xml @@ -22,6 +22,10 @@ test_ref="test_aidecheck_systemd_scan_wants_notification"/> + {{% if product in [ "sle16" ] %}} + + {{% endif %}}
{{% endif %}} @@ -65,10 +69,11 @@ comment="run aide check with output to a report file"> {{% if product in ["sle16"] %}} /usr/lib/systemd/system/{{{ aide_service }}} + ^.*ExecStart\=.*/usr/bin/aide[\s]*\-\-check.*$ {{% else %}} /etc/systemd/system/{{{ aide_service }}} + ^.*ExecStart\=.*/usr/bin/aide[\s]*\-\-check.*\-r\s*file:\/w*.*$ {{% endif %}} - ^.*ExecStart\=.*/usr/bin/aide[\s]*\-\-check.*$ 1 ^.*Wants\=.*{{{ aide_notify_service }}}.*$ 1 + + + + + + + /etc/aide.conf + ^[ \t]*report_url[\s]*=[\s]*file:/var/log/aide-report.log + 1 + + {{% endif %}} diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml index ceca9f3551ab..c5730dc46c9c 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_scan_notification/rule.yml @@ -80,13 +80,17 @@ fixtext: |- The following example output is generic. It will set cron to run AIDE daily and to send email at the completion of the analysis. {{% if product in ["sle15", "sle16", "slmicro5", "slmicro6"] %}} +{{% if product in ["sle16"] %}} + $ cat > /usr/lib/systemd/system/aidecheck-notify.service < /etc/systemd/system/aidecheck-notify.service < Date: Sun, 20 Sep 2026 13:00:06 +0300 Subject: [PATCH 5/5] Use suse family condition for new behaviour - also drop unneeded quotes and fix ocil descriptions --- .../ansible/shared.yml | 7 ++++++- .../bash/shared.sh | 5 +++++ .../oval/shared.xml | 5 +++++ .../tests/aide_timer_weekly.pass.sh | 5 +++++ .../aide/file_audit_tools_group_ownership/rule.yml | 9 ++++++++- .../aide/file_audit_tools_ownership/rule.yml | 11 +++++++++-- .../aide/file_audit_tools_permissions/rule.yml | 7 +++++++ 7 files changed, 45 insertions(+), 4 deletions(-) diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml index 5c7d035a78bb..774dbc80c97e 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/shared.yml @@ -4,8 +4,13 @@ # complexity = low # disruption = low +{{% if 'suse' in families %}} {{% set aide_service = 'aide.service' %}} {{% set aide_timer = 'aide.timer' %}} +{{% else %}} +{{% set aide_service = 'aidecheck.service' %}} +{{% set aide_timer = 'aidecheck.timer' %}} +{{% endif %}} {{% if product in ["sle16"] %}} - name: "{{{ rule_title }}} - Make sure AIDE Check Service is including /etc/aide.conf" @@ -15,7 +20,7 @@ group: root mode: 0600 content: |- - "@@include /etc/aide.conf" + @@include /etc/aide.conf - name: "{{{ rule_title }}} - Make sure AIDE Check Service is in enabled state" ansible.builtin.file: diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh index 0dc43a84549f..4f9fb65c2b3f 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/shared.sh @@ -2,8 +2,13 @@ {{{ bash_package_install("aide") }}} +{{% if 'suse' in families %}} {{% set aide_service = 'aide.service' %}} {{% set aide_timer = 'aide.timer' %}} +{{% else %}} +{{% set aide_service = 'aidecheck.service' %}} +{{% set aide_timer = 'aidecheck.timer' %}} +{{% endif %}} {{% if product in ["sle16"] %}} cat > /etc/aide_service.conf < {{{ oval_metadata("Make sure systemd timer is defined to run perodic AIDE check.", rule_title=rule_title) }}} diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh index 626720af8423..a60033db72b1 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh @@ -2,8 +2,13 @@ # platform = multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro,multi_platform_almalinux # packages = aide +{{% if 'suse' in families %}} {{% set aide_service = 'aide.service' %}} {{% set aide_timer = 'aide.timer' %}} +{{% else %}} +{{% set aide_service = 'aidecheck.service' %}} +{{% set aide_timer = 'aidecheck.timer' %}} +{{% endif %}} {{% if product in ["sle16"] %}} ln -s /usr/lib/systemd/system/{{{ aide_service }}} /etc/systemd/system/multi-user.target.wants/{{{ aide_service }}} diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_group_ownership/rule.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_group_ownership/rule.yml index 602cef8b5d9d..dfbbde3dd363 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_group_ownership/rule.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_group_ownership/rule.yml @@ -33,7 +33,13 @@ ocil: |- Check the group-owner of each audit tool by running the following command: - {{% if product in ['rhel10', 'ol10', 'sle16', 'fedora'] %}} + {{% if 'suse' in families %}} + $ sudo stat -c "%G %n" {{{ audit_binaries | join(' ') }}} + {{% for audit_binary in audit_binaries %}} + root {{{ audit_binary }}} + {{% endfor %}} + {{% else %}} + {{% if product in ['rhel10', 'ol10', 'fedora'] %}} $ sudo stat -c "%G %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/auditd /sbin/rsyslogd /sbin/augenrules {{% else %}} $ sudo stat -c "%G %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules @@ -48,6 +54,7 @@ ocil: |- root /sbin/auditd root /sbin/rsyslogd root /sbin/augenrules + {{% endif %}} fixtext: |- Configure the audit tools to be group-owned by "root", by running the following command: diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_ownership/rule.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_ownership/rule.yml index de292081a897..f76c324b5d55 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_ownership/rule.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_ownership/rule.yml @@ -33,7 +33,13 @@ ocil: |- Check the owner of each audit tool by running the following command: - {{% if product in ['rhel10', 'ol10', 'sle16', 'fedora'] %}} + {{% if 'suse' in families %}} + $ sudo stat -c "%U %n" {{{ audit_binaries | join(' ') }}} + {{% for audit_binary in audit_binaries %}} + root {{{ audit_binary }}} + {{% endfor %}} + {{% else %}} + {{% if product in ['rhel10', 'ol10', 'fedora'] %}} $ sudo stat -c "%U %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/auditd /sbin/rsyslogd /sbin/augenrules {{% else %}} $ sudo stat -c "%U %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules @@ -42,12 +48,13 @@ ocil: |- root /sbin/auditctl root /sbin/aureport root /sbin/ausearch - {{% if product not in ['rhel10', 'ol10', 'sle16', 'fedora'] %}} + {{% if product not in ['rhel10', 'ol10', 'fedora'] %}} root /sbin/autrace {{% endif %}} root /sbin/auditd root /sbin/rsyslogd root /sbin/augenrules + {{% endif %}} fixtext: |- Configure the audit tools to be owned by "root", by running the following command: diff --git a/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_permissions/rule.yml b/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_permissions/rule.yml index 04df8c0fbc82..f66bacb5cf3a 100644 --- a/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_permissions/rule.yml +++ b/linux_os/guide/system/software/integrity/software-integrity/aide/file_audit_tools_permissions/rule.yml @@ -33,11 +33,18 @@ ocil: |- Check the octal permission of each audit tool by running the following command: + {{% if 'suse' in families %}} + $ sudo stat -c "%a %n" {{{ audit_binaries | join(' ') }}} + {{% for audit_binary in audit_binaries %}} + 750 {{{ audit_binary }}} + {{% endfor %}} + {{% else %}} {{% if product in ['rhel10', 'ol10', 'sle16', 'fedora'] %}} $ sudo stat -c "%U %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/auditd /sbin/rsyslogd /sbin/augenrules {{% else %}} $ sudo stat -c "%U %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules {{% endif %}} + {{% endif %}} fixtext: |- Configure the audit tools to be owned by "root", by running the following command: