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

improve applicability of rule package_rear_installed #10144

Conversation

vojtapolasek
Copy link
Collaborator

Description:

Create appropriate platforms to fullfill the following:
Make the rule not applicable in following cases:

  • arch is s390x and RHEL <= 8.4
  • arch is aarch64 and RHEL or OL >= 9.0

Rationale:

  • the rear package is not available on some arches and RHEL / OL versions

Review Hints:

  • build the content
  • instantiate some RHEL (OL) machine on s390x / aarch64 machine
  • test that OVALs are applicable / not applicable in correct cases
  • do the same with Ansible - you can use the e8 Ansible playbook with --tag=package_rear_installed
  • tip: modify the /etc/os-release version_id line to simulate various distro versions

@vojtapolasek vojtapolasek added Oracle Linux Oracle Linux product related. RHEL9 Red Hat Enterprise Linux 9 product related. Update Rule Issues or pull requests related to Rules updates. RHEL8 Red Hat Enterprise Linux 8 product related. labels Jan 31, 2023
@vojtapolasek vojtapolasek added this to the 0.1.66 milestone Jan 31, 2023
@github-actions
Copy link

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

change it in OVAL descriptions
rename the file so taht OS is in capital
@vojtapolasek vojtapolasek force-pushed the rear_applicability_stabilization branch from e1c9b36 to 4d47f60 Compare January 31, 2023 12:18
@jan-cerny
Copy link
Collaborator

I think that the generated if condition in the Bash code isn't complete:

if ! ( ( ( grep -q aarch64 /proc/sys/kernel/osrelease ) || ( grep -q aarch64 /proc/sys/kernel/osrelease ) || ( grep -q s390x /proc/sys/kernel/osrelease ) ) ); then

@vojtapolasek
Copy link
Collaborator Author

@jan-cerny you are unfortunately correct. And there is not much we can do about it right now because we do not have proven way how to compare versions in Bash conditionals so far. Currently, Ansible conditionals will work correctly - you can test it. Bash conditionals won't. I know this is inconsistency and we plan to address it in the future. But at the other hand, Bash remediations should be used with oscap xccdf eval --remediate (or when generated from test results). They should not be blindly used as standalone playbooks and if someone decides to do so, they should review it. Any ideas or proposals for this problem? @yuumasato @matejak

@Mab879 Mab879 self-assigned this Jan 31, 2023
@Mab879 Mab879 merged commit 506aa71 into ComplianceAsCode:stabilization-v0.1.66 Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Oracle Linux Oracle Linux product related. RHEL8 Red Hat Enterprise Linux 8 product related. RHEL9 Red Hat Enterprise Linux 9 product related. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants