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

Fix zipl_bootmap_is_up_to_date #11980

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

jan-cerny
Copy link
Collaborator

First, we prioritize order of all zIPL rules that are changing the bootloader arguments in order to put them before
zipl_bootmap_is_up_to_date. This should ensure that the fixed rule zipl_bootmap_is_up_to_date isn't broken by remediations executed later.

Second, we align the Ansible remediation in zipl_bootmap_is_up_to_date to consider modification time of /boot/loader/entries/.

Fixes #11944

First, we prioritize order of all zIPL rules that are changing the
bootloader arguments in order to put them before
zipl_bootmap_is_up_to_date. This should ensure that the fixed rule
zipl_bootmap_is_up_to_date isn't broken by remediations executed later.

Second, we align the Ansible remediation in zipl_bootmap_is_up_to_date
to consider modification time of /boot/loader/entries/.

Fixes ComplianceAsCode#11944
@jan-cerny jan-cerny added the productization-issue Issue found in upstream stabilization process. label May 9, 2024
@jan-cerny jan-cerny added this to the 0.1.74 milestone May 9, 2024
Copy link

github-actions bot commented May 9, 2024

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

Copy link

github-actions bot commented May 9, 2024

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

Click here to see the full diff
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_zipl_bootmap_is_up_to_date' differs.
--- xccdf_org.ssgproject.content_rule_zipl_bootmap_is_up_to_date
+++ xccdf_org.ssgproject.content_rule_zipl_bootmap_is_up_to_date
@@ -11,11 +11,20 @@
       path: /etc/zipl.conf
     register: zipl_conf
 
+  - name: Obtain stats of /boot/loader/entries
+    stat:
+      path: /boot/loader/entries
+    register: boot_loader_entries
+
   - name: Update zIPL bootmap
     command: /usr/sbin/zipl
     changed_when: true
-    when: boot_bootmap.stat.mtime is defined and zipl_conf.stat.mtime is defined and  boot_bootmap.stat.mtime
-      < zipl_conf.stat.mtime
+    when:
+    - boot_bootmap.stat.mtime is defined
+    - zipl_conf.stat.mtime is defined
+    - boot_loader_entries.stat.mtime is defined
+    - boot_bootmap.stat.mtime < zipl_conf.stat.mtime or boot_bootmap.stat.mtime <
+      boot_loader_entries.stat.mtime
   when:
   - ansible_architecture == "s390x"
   - ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]

Copy link

github-actions bot commented May 9, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:11980
This image was built from commit: bb3dd2c

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:11980

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:11980 make deploy-local

Copy link

codeclimate bot commented May 9, 2024

Code Climate has analyzed commit bb3dd2c 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.4% (0.0% change).

View more on Code Climate.

@jan-cerny
Copy link
Collaborator Author

/test images

@Mab879 Mab879 self-assigned this May 9, 2024
@Mab879
Copy link
Member

Mab879 commented May 9, 2024

/packit retest-failed

4 similar comments
@Mab879
Copy link
Member

Mab879 commented May 9, 2024

/packit retest-failed

@Mab879
Copy link
Member

Mab879 commented May 9, 2024

/packit retest-failed

@Mab879
Copy link
Member

Mab879 commented May 9, 2024

/packit retest-failed

@Mab879
Copy link
Member

Mab879 commented May 9, 2024

/packit retest-failed

@Mab879
Copy link
Member

Mab879 commented May 9, 2024

Waving Automatus due to the fact that zipl_bootmap_is_up_to_date is not applicable on x86.

@Mab879 Mab879 merged commit 4db5d9a into ComplianceAsCode:master May 9, 2024
110 of 113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
productization-issue Issue found in upstream stabilization process.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zipl_bootmap_is_up_to_date is failing after Ansible remediation
2 participants