-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12733 from mpurg/ubuntu2404_cis_6.3.2
Add ubuntu specific check and remediation for aide_periodic_checking_systemd_timer
- Loading branch information
Showing
9 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
20 changes: 20 additions & 0 deletions
20
...integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/ansible/ubuntu.yml
This file contains 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_ubuntu | ||
# reboot = false | ||
# strategy = configure | ||
# complexity = low | ||
# disruption = low | ||
|
||
- name: "{{{ rule_title }}} - Ensure AIDE Service is Enabled" | ||
ansible.builtin.systemd: | ||
name: dailyaidecheck.service | ||
enabled: true | ||
daemon_reload: true | ||
masked: false | ||
|
||
- name: "{{{ rule_title }}} - Ensure AIDE Service Timer is Enabled" | ||
ansible.builtin.systemd: | ||
name: dailyaidecheck.timer | ||
state: started | ||
enabled: true | ||
daemon_reload: true | ||
masked: false |
8 changes: 8 additions & 0 deletions
8
...are/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/bash/ubuntu.sh
This file contains 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,8 @@ | ||
# platform = multi_platform_ubuntu | ||
#!/bin/bash | ||
|
||
{{{ bash_package_install("aide") }}} | ||
|
||
systemctl unmask dailyaidecheck.service | ||
systemctl unmask dailyaidecheck.timer | ||
systemctl --now enable dailyaidecheck.timer |
56 changes: 56 additions & 0 deletions
56
...re/integrity/software-integrity/aide/aide_periodic_checking_systemd_timer/oval/ubuntu.xml
This file contains 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,56 @@ | ||
{{% set aide_service = 'dailyaidecheck.service' %}} | ||
{{% set aide_timer = 'dailyaidecheck.timer' %}} | ||
<def-group> | ||
<definition class="compliance" id="{{{ rule_id }}}" version="3"> | ||
{{{ oval_metadata("Make sure systemd timer is defined to run perodic AIDE check.") }}} | ||
<criteria operator="AND"> | ||
<extend_definition comment="Aide is installed" definition_ref="package_aide_installed"/> | ||
<criteria operator="AND"> | ||
<criterion test_ref="tst_{{{ rule_id }}}_aidecheck-service_static" | ||
comment="systemd aidecheck.service static"/> | ||
<criterion test_ref="tst_{{{ rule_id }}}_aidecheck-timer_enabled" | ||
comment="systemd aidecheck.timer enabled"/> | ||
<criterion test_ref="tst_{{{ rule_id }}}_aidecheck-timer_active" | ||
comment="systemd aidecheck.timer active"/> | ||
</criteria> | ||
</criteria> | ||
</definition> | ||
|
||
<linux:systemdunitproperty_object id="obj_{{{ rule_id }}}_aidecheck-service_unitfilestate" version="1"> | ||
<linux:unit>{{{ aide_service }}}</linux:unit> | ||
<linux:property>UnitFileState</linux:property> | ||
</linux:systemdunitproperty_object> | ||
<linux:systemdunitproperty_object id="obj_{{{ rule_id }}}_aidecheck-timer_unitfilestate" version="1"> | ||
<linux:unit>{{{ aide_timer }}}</linux:unit> | ||
<linux:property>UnitFileState</linux:property> | ||
</linux:systemdunitproperty_object> | ||
<linux:systemdunitproperty_object id="obj_{{{ rule_id }}}_aidecheck-timer_activestate" version="1"> | ||
<linux:unit>{{{ aide_timer }}}</linux:unit> | ||
<linux:property>ActiveState</linux:property> | ||
</linux:systemdunitproperty_object> | ||
<linux:systemdunitproperty_state id="ste_{{{ rule_id }}}_aide_is_static" version="1"> | ||
<linux:value>static</linux:value> | ||
</linux:systemdunitproperty_state> | ||
<linux:systemdunitproperty_state id="ste_{{{ rule_id }}}_aide_is_enabled" version="1"> | ||
<linux:value>enabled</linux:value> | ||
</linux:systemdunitproperty_state> | ||
<linux:systemdunitproperty_state id="ste_{{{ rule_id }}}_aide_is_active" version="1"> | ||
<linux:value>active</linux:value> | ||
</linux:systemdunitproperty_state> | ||
|
||
<linux:systemdunitproperty_test check="all" id="tst_{{{ rule_id }}}_aidecheck-service_static" version="1" | ||
comment="systemd aidecheck.service static"> | ||
<linux:object object_ref="obj_{{{ rule_id }}}_aidecheck-service_unitfilestate" /> | ||
<linux:state state_ref="ste_{{{ rule_id }}}_aide_is_static" /> | ||
</linux:systemdunitproperty_test> | ||
<linux:systemdunitproperty_test check="all" id="tst_{{{ rule_id }}}_aidecheck-timer_enabled" version="1" | ||
comment="systemd aidecheck.timer enabled"> | ||
<linux:object object_ref="obj_{{{ rule_id }}}_aidecheck-timer_unitfilestate" /> | ||
<linux:state state_ref="ste_{{{ rule_id }}}_aide_is_enabled" /> | ||
</linux:systemdunitproperty_test> | ||
<linux:systemdunitproperty_test check="all" id="tst_{{{ rule_id }}}_aidecheck-timer_active" version="1" | ||
comment="systemd aidecheck.timer active"> | ||
<linux:object object_ref="obj_{{{ rule_id }}}_aidecheck-timer_activestate" /> | ||
<linux:state state_ref="ste_{{{ rule_id }}}_aide_is_active" /> | ||
</linux:systemdunitproperty_test> | ||
</def-group> |
This file contains 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
1 change: 1 addition & 0 deletions
1
...tware-integrity/aide/aide_periodic_checking_systemd_timer/tests/aide_timer_weekly.pass.sh
This file contains 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
5 changes: 5 additions & 0 deletions
5
...egrity/aide/aide_periodic_checking_systemd_timer/tests/ubuntu_aide_service_masked.fail.sh
This file contains 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,5 @@ | ||
# platform = multi_platform_ubuntu | ||
# packages = aide | ||
|
||
systemctl mask dailyaidecheck.service | ||
systemctl --now enable dailyaidecheck.timer |
5 changes: 5 additions & 0 deletions
5
...integrity/aide/aide_periodic_checking_systemd_timer/tests/ubuntu_aide_timer_daily.pass.sh
This file contains 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,5 @@ | ||
# platform = multi_platform_ubuntu | ||
# packages = aide | ||
|
||
systemctl enable dailyaidecheck.service | ||
systemctl --now enable dailyaidecheck.timer |
5 changes: 5 additions & 0 deletions
5
...egrity/aide/aide_periodic_checking_systemd_timer/tests/ubuntu_aide_timer_disabled.fail.sh
This file contains 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,5 @@ | ||
# platform = multi_platform_ubuntu | ||
# packages = aide | ||
|
||
systemctl enable dailyaidecheck.service | ||
systemctl --now disable dailyaidecheck.timer |