-
Notifications
You must be signed in to change notification settings - Fork 706
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
Move RPM verify rules to use --restore #12413
Conversation
b79f1ee
to
6eb7c1e
Compare
This datastream diff is auto generated by the check Click here to see the full diffNew content has different text for rule 'xccdf_org.ssgproject.content_rule_rpm_verify_ownership'.
--- xccdf_org.ssgproject.content_rule_rpm_verify_ownership
+++ xccdf_org.ssgproject.content_rule_rpm_verify_ownership
@@ -11,7 +11,7 @@
$ rpm -qf FILENAME
Next, run the following command to reset its permissions to the correct values:
-$ sudo rpm --setugids PACKAGENAME
+$ sudo rpm --restore PACKAGENAME
[warning]:
Profiles may require that specific files be owned by root while the default owner defined
bash remediation for rule 'xccdf_org.ssgproject.content_rule_rpm_verify_ownership' differs.
--- xccdf_org.ssgproject.content_rule_rpm_verify_ownership
+++ xccdf_org.ssgproject.content_rule_rpm_verify_ownership
@@ -17,5 +17,5 @@
# correct values
for RPM_PACKAGE in "${!SETPERMS_RPM_DICT[@]}"
do
- rpm --setugids "${RPM_PACKAGE}"
+ rpm --restore "${RPM_PACKAGE}"
done
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_rpm_verify_ownership' differs.
--- xccdf_org.ssgproject.content_rule_rpm_verify_ownership
+++ xccdf_org.ssgproject.content_rule_rpm_verify_ownership
@@ -55,7 +55,7 @@
- rpm_verify_ownership
- name: Correct file ownership with RPM
- command: rpm --setugids '{{ item }}'
+ command: rpm --restore '{{ item }}'
with_items: '{{ list_of_packages.results | map(attribute=''stdout_lines'') | list
| unique }}'
when: (files_with_incorrect_ownership.stdout_lines | length > 0)
New content has different text for rule 'xccdf_org.ssgproject.content_rule_rpm_verify_permissions'.
--- xccdf_org.ssgproject.content_rule_rpm_verify_permissions
+++ xccdf_org.ssgproject.content_rule_rpm_verify_permissions
@@ -16,7 +16,7 @@
Next, run the following command to reset its permissions to the correct values:
-$ sudo rpm --setperms PACKAGENAME
+$ sudo rpm --restore PACKAGENAME
[warning]:
Profiles may require that specific files have stricter file permissions than defined by
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_rpm_verify_permissions' differs.
--- xccdf_org.ssgproject.content_rule_rpm_verify_permissions
+++ xccdf_org.ssgproject.content_rule_rpm_verify_permissions
@@ -57,7 +57,7 @@
- rpm_verify_permissions
- name: Correct file permissions with RPM
- command: rpm --setperms '{{ item }}'
+ command: rpm --restore '{{ item }}'
with_items: '{{ list_of_packages.results | map(attribute=''stdout_lines'') | list
| unique }}'
when: (files_with_incorrect_permissions.stdout_lines | length > 0) |
/retest-required |
@@ -22,5 +22,9 @@ done | |||
# correct values | |||
for RPM_PACKAGE in "${!SETPERMS_RPM_DICT[@]}" | |||
do | |||
{{% if "rhel" in product %}} | |||
rpm --restore "${RPM_PACKAGE}" |
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 think the same change needs do be done in Ansible code.
@@ -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> |
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 think in rpm_verify_permissions you need to update also the Bash and Ansible remediations.
To match the rpm_verify_permissions bash remedation.
6eb7c1e
to
06fbf18
Compare
Change in Ansible Please consider using more suitable Ansible module than |
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
Code Climate has analyzed commit 06fbf18 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 59.5% (0.0% change). View more on Code Climate. |
/packit build |
Description:
Rationale:
Update for RHEL 10