-
Notifications
You must be signed in to change notification settings - Fork 700
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
Ubuntu 24.04 2.4.2.1 Ensure at is restricted to authorized users #12711
Open
ericeberry
wants to merge
4
commits into
ComplianceAsCode:master
Choose a base branch
from
ericeberry:u2404_2421
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3b16f59
Ubuntu 24.04 2.4.2.1 Ensure at is restricted to authorized users
ericeberry e7eb734
Ubuntu 24.04 2.4.2.1 Ensure at is restricted to authorized users
ericeberry 62527ea
Ubuntu 24.04 2.4.2.1 Ensure at is restricted to authorized users
ericeberry e514445
Ubuntu 24.04 2.4.2.1 Ensure at is retricted to authorized users
ericeberry 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
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
34 changes: 34 additions & 0 deletions
34
linux_os/guide/services/cron_and_at/restrict_at_cron_users/file_at_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,34 @@ | ||
documentation_complete: true | ||
|
||
|
||
title: Ensure that /etc/at.allow exists | ||
|
||
description: |- | ||
The file <tt>/etc/at.allow</tt> should exist and should be used instead | ||
of <tt>/etc/at.deny</tt>. | ||
|
||
rationale: |- | ||
On many systems, only the system administrator is authorized to schedule at jobs. | ||
Using the at.allow file to control who can run at jobs enforces this policy. It is easier | ||
to manage an allow list than a deny list. In a deny list, you could potentially add a user | ||
ID to the system and forget to add it to the deny files. | ||
|
||
severity: medium | ||
|
||
ocil_clause: 'the file /etc/at.allow does not exist' | ||
|
||
ocil: |- | ||
The file <tt>/etc/at.allow</tt> should exist. | ||
This can be checked by running the following command: | ||
<pre> | ||
stat /etc/at.allow | ||
</pre> | ||
and the output should list the file. | ||
|
||
template: | ||
name: file_existence | ||
vars: | ||
filepath: /etc/at.allow | ||
exists: true | ||
fileuid: "0" | ||
filemode: "0640" |
2 changes: 2 additions & 0 deletions
2
.../guide/services/cron_and_at/restrict_at_cron_users/file_at_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/at.allow |
2 changes: 2 additions & 0 deletions
2
...ide/services/cron_and_at/restrict_at_cron_users/file_at_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/at.allow |
35 changes: 35 additions & 0 deletions
35
linux_os/guide/services/cron_and_at/restrict_at_cron_users/file_at_deny_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,35 @@ | ||
documentation_complete: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
||
title: Ensure that /etc/at.deny exists | ||
|
||
description: |- | ||
The file <tt>/etc/at.access</tt> should exist and should be used instead | ||
of <tt>/etc/at.deny</tt>. But if at.deny is used, it should exist and have the correct | ||
permisisons and owner. | ||
|
||
rationale: |- | ||
On many systems, only the system administrator is authorized to schedule at jobs. | ||
Using the at.deny file to control who can run at jobs enforces this policy. It is easier | ||
to manage an deny list than a deny list. In a deny list, you could potentially add a user | ||
ID to the system and forget to add it to the deny files. | ||
|
||
severity: medium | ||
|
||
ocil_clause: 'the file /etc/at.deny exists' | ||
|
||
ocil: |- | ||
The file <tt>/etc/at.deny</tt> should exist. | ||
This can be checked by running the following command: | ||
<pre> | ||
stat /etc/at.deny | ||
</pre> | ||
and the output should list the file. | ||
|
||
template: | ||
name: file_existence | ||
vars: | ||
filepath: /etc/at.deny | ||
exists: true | ||
fileuid: "0" | ||
filemode: "0640" |
2 changes: 2 additions & 0 deletions
2
...s/guide/services/cron_and_at/restrict_at_cron_users/file_at_deny_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/at.deny |
2 changes: 2 additions & 0 deletions
2
...uide/services/cron_and_at/restrict_at_cron_users/file_at_deny_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/at.deny |
25 changes: 25 additions & 0 deletions
25
linux_os/guide/services/cron_and_at/restrict_at_cron_users/file_groupowner_at_deny/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,25 @@ | ||
documentation_complete: true | ||
|
||
title: 'Verify Group Who Owns /etc/at.deny file' | ||
|
||
description: |- | ||
If <tt>/etc/at.deny</tt> exists, it must be group-owned by <tt>root</tt>. | ||
{{{ describe_file_group_owner(file="/etc/at.deny", group="root") }}} | ||
|
||
rationale: |- | ||
If the owner of the at.deny file is not set to root, the possibility exists for an | ||
unauthorized user to view or edit sensitive information. | ||
|
||
severity: medium | ||
|
||
ocil_clause: '{{{ ocil_clause_file_group_owner(file="/etc/at.deny", group="root") }}}' | ||
|
||
ocil: |- | ||
{{{ ocil_file_group_owner(file="/etc/at.deny", group="root") }}} | ||
|
||
template: | ||
name: file_groupowner | ||
vars: | ||
filepath: /etc/at.deny | ||
missing_file_pass: 'true' | ||
gid_or_name: '0' | ||
ericeberry marked this conversation as resolved.
Show resolved
Hide resolved
|
27 changes: 27 additions & 0 deletions
27
linux_os/guide/services/cron_and_at/restrict_at_cron_users/file_owner_at_deny/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,27 @@ | ||
documentation_complete: true | ||
|
||
|
||
title: 'Verify User Who Owns /etc/at.deny file' | ||
|
||
description: |- | ||
If <tt>/etc/at.deny</tt> exists, it must be owned by <tt>root</tt>. | ||
{{{ describe_file_owner(file="/etc/at.deny", owner="root") }}} | ||
|
||
rationale: |- | ||
If the owner of the at.deny file is not set to root, the possibility exists for an | ||
unauthorized user to view or edit sensitive information. | ||
|
||
severity: medium | ||
|
||
|
||
ocil_clause: '{{{ ocil_clause_file_owner(file="/etc/at.deny", owner="root") }}}' | ||
|
||
ocil: |- | ||
{{{ ocil_file_owner(file="/etc/at.deny", owner="root") }}} | ||
|
||
template: | ||
name: file_owner | ||
vars: | ||
filepath: /etc/at.deny | ||
missing_file_pass: 'true' | ||
fileuid: '0' |
35 changes: 35 additions & 0 deletions
35
linux_os/guide/services/cron_and_at/restrict_at_cron_users/file_permissions_at_deny/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,35 @@ | ||
documentation_complete: true | ||
|
||
title: 'Verify Permissions on /etc/at.deny file' | ||
|
||
{{% if 'rhel' not in product %}} | ||
{{% set target_perms_octal="0640" %}} | ||
{{% set target_perms="-rw-r-----" %}} | ||
{{% else %}} | ||
{{% set target_perms_octal="0600" %}} | ||
{{% set target_perms="-rw-------" %}} | ||
{{% endif %}} | ||
|
||
description: |- | ||
If <tt>/etc/at.deny</tt> exists, it must have permissions <tt>{{{ target_perms_octal }}}</tt> | ||
or more restrictive. | ||
|
||
{{{ describe_file_permissions(file="/etc/at.deny", perms=target_perms_octal) }}} | ||
|
||
rationale: |- | ||
If the permissions of the at.deny file are not set to {{{ target_perms_octal }}} or more restrictive, | ||
the possibility exists for an unauthorized user to view or edit sensitive information. | ||
|
||
severity: medium | ||
|
||
ocil_clause: '{{{ ocil_clause_file_permissions(file="/etc/at.deny", perms=target_perms) }}}' | ||
|
||
ocil: |- | ||
{{{ ocil_file_permissions(file="/etc/at.deny", perms=target_perms) }}} | ||
|
||
template: | ||
name: file_permissions | ||
vars: | ||
filepath: /etc/at.deny | ||
missing_file_pass: 'true' | ||
filemode: '{{{ target_perms_octal }}}' |
4 changes: 4 additions & 0 deletions
4
...on_and_at/restrict_at_cron_users/file_permissions_at_deny/tests/missing_file_test.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,4 @@ | ||
#!/bin/bash | ||
# | ||
|
||
rm -f /etc/at.deny |
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.
I don't think we should disable the at_deny rules, both files should be checked according to 2.4.2.1