Skip to content

Commit 97399d9

Browse files
authored
Merge pull request #11224 from Mab879/make_selinux_context_elevation_for_sudo_more_flexaible
Make selinux context elevation for sudo more flexible
2 parents 4b87b7f + 0ad34bc commit 97399d9

File tree

7 files changed

+25
-7
lines changed

7 files changed

+25
-7
lines changed

linux_os/guide/system/selinux/selinux_context_elevation_for_sudo/oval/shared.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
<ind:textfilecontent54_object id="obj_sudo_selinux_elevation_type" version="1">
2828
<ind:filepath operation="pattern match">^/etc/sudoers(\.d/.*)?$</ind:filepath>
29-
<ind:pattern operation="pattern match">^\s*%wheel.*TYPE=(\w+).*$</ind:pattern>
29+
<ind:pattern operation="pattern match">^\s*%\w+.*TYPE=(\w+).*$</ind:pattern>
3030
<ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
3131
</ind:textfilecontent54_object>
3232

3333
<ind:textfilecontent54_object id="obj_sudo_selinux_elevation_role" version="1">
3434
<ind:filepath operation="pattern match">^/etc/sudoers(\.d/.*)?$</ind:filepath>
35-
<ind:pattern operation="pattern match">^\s*%wheel.*ROLE=(\w+).*$</ind:pattern>
35+
<ind:pattern operation="pattern match">^\s*%\w+.*ROLE=(\w+).*$</ind:pattern>
3636
<ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
3737
</ind:textfilecontent54_object>
3838

linux_os/guide/system/selinux/selinux_context_elevation_for_sudo/tests/conflicting_value.fail.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# platform = multi_platform_ol
1+
#!/bin/bash
2+
3+
# platform = multi_platform_all
24
# packages = sudo
35
# remediation = none
46

linux_os/guide/system/selinux/selinux_context_elevation_for_sudo/tests/correct_value_multiple_files.pass.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# platform = multi_platform_ol
1+
#!/bin/bash
2+
3+
# platform = multi_platform_all
24
# packages = sudo
35

46
echo '%wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL' >> /etc/sudoers
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# platform = multi_platform_ol
1+
#!/bin/bash
2+
3+
# platform = multi_platform_all
24
# packages = sudo
35

46
echo '%wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL' >> /etc/sudoers.d/01-complianceascode.conf
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# platform = multi_platform_all
4+
# packages = sudo
5+
6+
group_add sudoers
7+
8+
echo '%sudoers ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL' >> /etc/sudoers.d/01-complianceascode.conf

linux_os/guide/system/selinux/selinux_context_elevation_for_sudo/tests/missing_role.fail.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# platform = multi_platform_ol
1+
#!/bin/bash
2+
3+
# platform = multi_platform_all
24
# packages = sudo
35
# remediation = none
46

linux_os/guide/system/selinux/selinux_context_elevation_for_sudo/tests/missing_type.fail.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# platform = multi_platform_ol
1+
#!/bin/bash
2+
3+
# platform = multi_platform_all
24
# packages = sudo
35
# remediation = none
46

0 commit comments

Comments
 (0)