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

Conversation

Mab879
Copy link
Member

@Mab879 Mab879 commented Sep 24, 2024

Description:

  • Move RPM verify rules to use --restore
  • Due to OL7 support we can't fully convert

Rationale:

Update for RHEL 10

@Mab879 Mab879 added the Update Rule Issues or pull requests related to Rules updates. label Sep 24, 2024
@Mab879 Mab879 added this to the 0.1.75 milestone Sep 24, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@Mab879 Mab879 marked this pull request as draft September 24, 2024 20:30
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Sep 24, 2024
Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
New 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,7 @@
 # correct values
 for RPM_PACKAGE in "${!SETPERMS_RPM_DICT[@]}"
 do
-        rpm --setugids "${RPM_PACKAGE}"
+        
+        rpm --restore "${RPM_PACKAGE}"
+        
 done

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,8 @@
           
           
 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

Copy link

codeclimate bot commented Sep 25, 2024

Code Climate has analyzed commit 6eb7c1e 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.

@Mab879
Copy link
Member Author

Mab879 commented Sep 25, 2024

/retest-required

@Mab879 Mab879 marked this pull request as ready for review September 26, 2024 12:46
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant