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

Add ubuntu specific check and remediation for aide_periodic_checking_systemd_timer #12733

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions controls/cis_ubuntu2404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2829,10 +2829,9 @@ controls:
levels:
- l1_server
- l1_workstation
related_rules:
- aide_periodic_cron_checking
status: planned
notes: TODO. Partial/incorrect implementation exists.See related rules. Analogous to ubuntu2204/1.3.2.
rules:
- aide_periodic_checking_systemd_timer
status: automated

- id: 6.3.3
title: Ensure cryptographic mechanisms are used to protect the integrity of audit tools (Automated)
Expand Down
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
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
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>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

documentation_complete: true


title: 'Configure Systemd Timer Execution of AIDE'

description: |-
Expand Down Expand Up @@ -43,7 +41,7 @@ references:
stigid@ol7: OL07-00-020030
stigid@sle15: SLES-15-010570

platform: package[aide]
platform: package[aide] and package[systemd]

ocil_clause: 'AIDE is not configured to scan periodically'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# platform = multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro
#!/bin/bash
# packages = aide

Expand Down
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
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
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
Loading