forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new rule file_cron_allow_exists and add it to CIS profiles because the CIS RHEL Benchmark requires the file /etc/cron.allow to exist. The other rules within the control that check the ownership and permissions on /etc/cron.allow are passing if this file doesn't exist. The file doesn't exist by default. To ensure the file exists, we add a new rule that creates it. Resolves: https://issues.redhat.com/browse/RHEL-1314
- Loading branch information
Showing
8 changed files
with
51 additions
and
3 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
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
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
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
43 changes: 43 additions & 0 deletions
43
linux_os/guide/services/cron_and_at/restrict_at_cron_users/file_cron_allow_exists/rule.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,43 @@ | ||
documentation_complete: true | ||
|
||
prodtype: rhel7,rhel8,rhel9 | ||
|
||
title: Ensure that /etc/cron.allow exists | ||
|
||
description: |- | ||
The file <tt>/etc/cron.allow</tt> should exist and should be used instead | ||
of <tt>/etc/cron.deny</tt>. | ||
rationale: |- | ||
Access to <tt>crontab</tt> should be restricted. | ||
It is easier to manage an allow list than a deny list. | ||
Therefore, <tt>/etc/cron.allow</tt> needs to be created and used instead of <tt>/etc/cron.deny</tt>. | ||
Regardless of the existence of any of these files, the root administrative user is always allowed to setup a crontab. | ||
severity: medium | ||
|
||
identifiers: | ||
cce@rhel7: CCE-86183-1 | ||
cce@rhel8: CCE-86184-9 | ||
cce@rhel9: CCE-86185-6 | ||
|
||
references: | ||
cis@rhel7: 5.1.8 | ||
cis@rhel8: 5.1.8 | ||
cis@rhel9: 5.1.8 | ||
|
||
ocil_clause: 'the file /etc/cron.allow does not exist' | ||
|
||
ocil: |- | ||
The file <tt>/etc/cron.allow</tt> should exist. | ||
This can be checked by running the following command: | ||
<pre> | ||
stat /etc/cron.allow | ||
</pre> | ||
and the output should list the file. | ||
template: | ||
name: file_existence | ||
vars: | ||
filepath: /etc/cron.allow | ||
exists: true |
2 changes: 2 additions & 0 deletions
2
...uide/services/cron_and_at/restrict_at_cron_users/file_cron_allow_exists/tests/dne.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,2 @@ | ||
#!/bin/bash | ||
rm -rf /etc/cron.allow |
2 changes: 2 additions & 0 deletions
2
...e/services/cron_and_at/restrict_at_cron_users/file_cron_allow_exists/tests/exists.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,2 @@ | ||
#!/bin/bash | ||
touch /etc/cron.allow |
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