forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 0
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 ComplianceAsCode#11640 from marcusburghardt/system…
…map_files Add new templated rules for System.map files
- Loading branch information
Showing
26 changed files
with
170 additions
and
59 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
35 changes: 35 additions & 0 deletions
35
linux_os/guide/system/permissions/files/file_groupowner_systemmap/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 Group Who Owns System.map Files' | ||
|
||
description: |- | ||
The System.map files are symbol map files generated during the compilation of the Linux | ||
kernel. They contain the mapping between kernel symbols and their corresponding memory | ||
addresses. These files must be group-owned by root. | ||
{{{ describe_file_group_owner(file="/boot/System.map*", group="root") }}} | ||
rationale: |- | ||
The purpose of <tt>System.map</tt> files is primarily for debugging and profiling the kernel. | ||
Unrestricted access to these files might disclose information useful to attackers and | ||
malicious software leading to more sophisticated exploitation. | ||
severity: low | ||
|
||
identifiers: | ||
cce@rhel7: CCE-86582-4 | ||
cce@rhel8: CCE-86583-2 | ||
cce@rhel9: CCE-86584-0 | ||
|
||
ocil_clause: '{{{ ocil_clause_file_group_owner(file="/boot/System.map*", group="root") }}}' | ||
|
||
ocil: |- | ||
{{{ ocil_file_group_owner(file="/boot/System.map*", group="root") }}} | ||
template: | ||
name: file_groupowner | ||
vars: | ||
filepath: /boot/ | ||
file_regex: ^.*System\.map.*$ | ||
gid_or_name: root | ||
missing_file_pass: 'true' |
4 changes: 4 additions & 0 deletions
4
...guide/system/permissions/files/file_groupowner_systemmap/tests/correct_groupowner.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 | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
chgrp root /boot/System.map* |
5 changes: 5 additions & 0 deletions
5
...rmissions/files/file_groupowner_systemmap/tests/correct_groupowner_multiple_files.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 @@ | ||
#!/bin/bash | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
mktemp -p /boot System.map-5.99.0-XXX | ||
chgrp root /boot/System.map* |
4 changes: 4 additions & 0 deletions
4
...ide/system/permissions/files/file_groupowner_systemmap/tests/incorrect_groupowner.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,4 @@ | ||
#!/bin/bash | ||
|
||
FAKE_FILE=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chgrp 5 $FAKE_FILE |
7 changes: 7 additions & 0 deletions
7
...issions/files/file_groupowner_systemmap/tests/incorrect_groupowner_multiple_files.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,7 @@ | ||
#!/bin/bash | ||
|
||
FAKE_FILE1=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chgrp root $FAKE_FILE1 | ||
|
||
FAKE_FILE2=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chgrp 5 $FAKE_FILE2 |
3 changes: 3 additions & 0 deletions
3
.../guide/system/permissions/files/file_groupowner_systemmap/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,3 @@ | ||
#!/bin/bash | ||
|
||
rm -f /boot/System.map* |
35 changes: 35 additions & 0 deletions
35
linux_os/guide/system/permissions/files/file_owner_systemmap/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 User Who Owns System.map Files' | ||
|
||
description: |- | ||
The System.map files are symbol map files generated during the compilation of the Linux | ||
kernel. They contain the mapping between kernel symbols and their corresponding memory | ||
addresses. These files must be owned by root. | ||
{{{ describe_file_owner(file="/boot/System.map*", owner="root") }}} | ||
rationale: |- | ||
The purpose of <tt>System.map</tt> files is primarily for debugging and profiling the kernel. | ||
Unrestricted access to these files might disclose information useful to attackers and | ||
malicious software leading to more sophisticated exploitation. | ||
severity: low | ||
|
||
identifiers: | ||
cce@rhel7: CCE-86585-7 | ||
cce@rhel8: CCE-86586-5 | ||
cce@rhel9: CCE-86587-3 | ||
|
||
ocil_clause: '{{{ ocil_clause_file_owner(file="/boot/System.map*", owner="root") }}}' | ||
|
||
ocil: |- | ||
{{{ ocil_file_owner(file="/boot/System.map*", owner="root") }}} | ||
template: | ||
name: file_owner | ||
vars: | ||
filepath: /boot/ | ||
file_regex: ^.*System\.map.*$ | ||
fileuid: '0' | ||
missing_file_pass: 'true' |
4 changes: 4 additions & 0 deletions
4
linux_os/guide/system/permissions/files/file_owner_systemmap/tests/correct_owner.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 | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
chown root /boot/System.map* |
5 changes: 5 additions & 0 deletions
5
.../system/permissions/files/file_owner_systemmap/tests/correct_owner_multiple_files.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 @@ | ||
#!/bin/bash | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
mktemp -p /boot System.map-5.99.0-XXX | ||
chown root /boot/System.map* |
4 changes: 4 additions & 0 deletions
4
linux_os/guide/system/permissions/files/file_owner_systemmap/tests/incorrect_owner.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,4 @@ | ||
#!/bin/bash | ||
|
||
FAKE_FILE=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chown 5 $FAKE_FILE |
7 changes: 7 additions & 0 deletions
7
...ystem/permissions/files/file_owner_systemmap/tests/incorrect_owner_multiple_files.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,7 @@ | ||
#!/bin/bash | ||
|
||
FAKE_FILE1=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chown root $FAKE_FILE1 | ||
|
||
FAKE_FILE2=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chown 5 $FAKE_FILE2 |
3 changes: 3 additions & 0 deletions
3
linux_os/guide/system/permissions/files/file_owner_systemmap/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,3 @@ | ||
#!/bin/bash | ||
|
||
rm -f /boot/System.map* |
40 changes: 0 additions & 40 deletions
40
linux_os/guide/system/permissions/files/file_permissions_systemmap/oval/shared.xml
This file was deleted.
Oops, something went wrong.
30 changes: 22 additions & 8 deletions
30
linux_os/guide/system/permissions/files/file_permissions_systemmap/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 |
---|---|---|
@@ -1,22 +1,36 @@ | ||
documentation_complete: true | ||
|
||
title: 'Verify that local System.map file (if exists) is readable only by root' | ||
title: 'Verify Permissions on System.map Files' | ||
|
||
description: |- | ||
Files containing sensitive informations should be protected by restrictive | ||
permissions. Most of the time, there is no need that these files need to be read by any non-root user | ||
{{{ describe_file_permissions(file="/boot/System.map-*", perms="0600") }}} | ||
The System.map files are symbol map files generated during the compilation of the Linux | ||
kernel. They contain the mapping between kernel symbols and their corresponding memory | ||
addresses. In general, there is no need for non-root users to read these files. | ||
{{{ describe_file_permissions(file="/boot/System.map*", perms="0600") }}} | ||
rationale: |- | ||
The <tt>System.map</tt> file contains information about kernel symbols and | ||
can give some hints to generate local exploitation. | ||
The purpose of <tt>System.map</tt> files is primarily for debugging and profiling the kernel. | ||
Unrestricted access to these files might disclose information useful to attackers and | ||
malicious software leading to more sophisticated exploitation. | ||
severity: unknown | ||
severity: low | ||
|
||
identifiers: | ||
cce@rhel7: CCE-82350-0 | ||
cce@rhel8: CCE-82892-1 | ||
cce@rhel9: CCE-86581-6 | ||
|
||
ocil_clause: '{{{ ocil_clause_file_permissions(file="/boot/System.map*", perms="-rw-------") }}}' | ||
|
||
ocil: |- | ||
{{{ ocil_file_permissions(file="/boot/Sysem.map-*", perms="-rw-------") }}} | ||
{{{ ocil_file_permissions(file="/boot/System.map*", perms="-rw-------") }}} | ||
template: | ||
name: file_permissions | ||
vars: | ||
filepath: /boot/ | ||
file_regex: ^.*System\.map.*$ | ||
filemode: '0600' | ||
allow_stricter_permissions: 'true' | ||
missing_file_pass: 'true' |
5 changes: 5 additions & 0 deletions
5
.../system/permissions/files/file_permissions_systemmap/tests/correct_multiple_files.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 @@ | ||
#!/bin/bash | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
mktemp -p /boot System.map-5.99.0-XXX | ||
chmod 0600 /boot/System.map* |
4 changes: 4 additions & 0 deletions
4
...ide/system/permissions/files/file_permissions_systemmap/tests/correct_permissions.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 | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
chmod 0600 /boot/System.map* |
7 changes: 7 additions & 0 deletions
7
.../system/permissions/files/file_permissions_systemmap/tests/lenient_multiple_files.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,7 @@ | ||
#!/bin/bash | ||
|
||
FAKE_FILE1=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chmod 0600 $FAKE_FILE1 | ||
|
||
FAKE_FILE2=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chmod 0644 $FAKE_FILE2 |
4 changes: 4 additions & 0 deletions
4
...ide/system/permissions/files/file_permissions_systemmap/tests/lenient_permissions.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,4 @@ | ||
#!/bin/bash | ||
|
||
FAKE_FILE=$(mktemp -p /boot System.map-5.99.0-XXX) | ||
chmod 0644 $FAKE_FILE |
3 changes: 3 additions & 0 deletions
3
...guide/system/permissions/files/file_permissions_systemmap/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,3 @@ | ||
#!/bin/bash | ||
|
||
rm -f /boot/System.map* |
4 changes: 4 additions & 0 deletions
4
...ide/system/permissions/files/file_permissions_systemmap/tests/stricter_permisions.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 | ||
|
||
mktemp -p /boot System.map-5.99.0-XXX | ||
chmod 0400 /boot/System.map* |
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