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

Move RPM verify rules to use --restore #12413

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ done
# correct values
for RPM_PACKAGE in "${!SETPERMS_RPM_DICT[@]}"
do
{{% if "rhel" in product %}}
rpm --restore "${RPM_PACKAGE}"
{{% else %}}
rpm --setugids "${RPM_PACKAGE}"
{{% endif %}}
done
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ description: |-
run the following command to determine which package owns it:
<pre>$ rpm -qf <i>FILENAME</i></pre>
Next, run the following command to reset its permissions to the correct values:
{{%- if 'rhel' in product %}}
<pre>$ sudo rpm --restore <i>PACKAGENAME</i></pre>
{{%- else %}}
<pre>$ sudo rpm --setugids <i>PACKAGENAME</i></pre>
{{% endif %}}


rationale: |-
Ownership of binaries and configuration files that is incorrect could allow an unauthorized
Expand Down Expand Up @@ -60,7 +65,11 @@ fixtext: |-

Reset the user and group ownership of files within a package with the following command:

{{%- if 'rhel' in product %}}
$ sudo rpm --restore [package]
{{%- else %}}
$ sudo rpm --setugids [package]
{{% endif %}}

srg_requirement: '{{{ full_name }}} must be configured so that the file ownership and group membership of system files and commands match the vendor values.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ description: |-
<pre>$ rpm -qf <i>FILENAME</i></pre>
<br />
Next, run the following command to reset its permissions to the correct values:
{{% if 'rhel' in product %}}
<pre>$ sudo rpm --restore <i>PACKAGENAME</i></pre>
{{% else %}}
<pre>$ sudo rpm --setperms <i>PACKAGENAME</i></pre>
{{% endif %}}

rationale: |-
Permissions on system binaries and configuration files that are too generous could allow an
Expand Down Expand Up @@ -66,7 +70,11 @@ fixtext: |-

Reset the permissions of files within a package with the following command:

{{% if 'rhel' in product %}}
$ sudo rpm --restore [package]
{{% else %}}
$ sudo rpm --setperms [package]
{{% endif %}}

srg_requirement: '{{{ full_name }}} must be configured so that the file permissions of system files and commands match the vendor values.'

Expand Down
Loading