ComplianceAsCode / content

Security automation content in SCAP, Bash, Ansible, and other formats
https://complianceascode.readthedocs.io/en/latest/
Other
2.18k stars 694 forks source link

libaudit package name is wrong for sles 15 sp4 #11201

Closed kabepst closed 10 months ago

kabepst commented 1 year ago

Description of problem:

The libaudit package is called "libaudit1" on SLES 15 SP4 and not "libaudit". Therefore evaluation (and automatic remediation) fails for related rules. The rule this occured for me is 'CCE-92478-7' (CIS Benchmark for SUSE Enterprise Linux 15 - Server Level 2)

SCAP Security Guide Version: 0.1.69

Operating System Version: SUSE Linux Enteprise 15 SP4

Steps to Reproduce:

  1. Scan system and create remediation, for example: oscap xccdf eval --profile xccdf_ch.ksg_profile_cis_KSG_customized --tailoring-file /home/sysadmin/ssg-sle15-ds-1.2-tailoring.xml --results-arf /home/sysadmin/ospp-results.xml --report /home/sysadmin/ospp-results.html /home/sysadmin/ssg-sle15-ds-1.2.xml
  2. Create remediation playbook (the vars reference to the values above as this is copy/pasted from an ansible-playbook): oscap xccdf generate fix --fix-type ansible --profile {{ profile }} --tailoring-file /home/sysadmin/{{ tailoring }} --output /home/sysadmin/oscap-remediation-sles15-base.yml /home/sysadmin/ospp-results.xml
  3. Run remediation-playbook which will fail when trying to install libaudit (see below "Actual Results")

Actual Results:

Running the remediation playbook aborts with "error: No provider for libaudit found"

Expected Results:

Playbook should install or detect (as it is installed by default for me) that libaudit is already installed. However changing the package name below from 'libaudit' to 'libaudit1' fixes the error and playbook runs without error for this specific rule: image

Additional Information/Debugging Steps:

The shown steps to reproduce are exported from an automated ansible-playbook run and therefore use our internal customized/tailored version of the cis-benchmark. However the same happens when using a non-tailored/customized content from scap security guide. Therefore I assume this is a bug in general.

kabepst commented 1 year ago

As an additional information: image

kabepst commented 11 months ago

@marcusburghardt I've had a quick look at this (as you set the label good first issue) to fix it by myself. However it looks like this should already be correctly implemented:

https://github.com/ComplianceAsCode/content/blob/639639bde105fc66291b87071c03da595475cfe3/linux_os/guide/system/auditing/package_audit-libs_installed/rule.yml#L2

Is this the wrong place I look at or is perhaps something else going wrong (which won't be that easy to fix) since the package name in the referenced file seems to be correct already ?

marcusburghardt commented 10 months ago

@marcusburghardt I've had a quick look at this (as you set the label good first issue) to fix it by myself. However it looks like this should already be correctly implemented:

https://github.com/ComplianceAsCode/content/blob/639639bde105fc66291b87071c03da595475cfe3/linux_os/guide/system/auditing/package_audit-libs_installed/rule.yml#L2

Is this the wrong place I look at or is perhaps something else going wrong (which won't be that easy to fix) since the package name in the referenced file seems to be correct already ?

It was probably already fixed in the meantime. If so, we can close this issue. Could you confirm @teacup-on-rockingchair , please?

kabepst commented 10 months ago

@marcusburghardt I've had a quick look at this (as you set the label good first issue) to fix it by myself. However it looks like this should already be correctly implemented: https://github.com/ComplianceAsCode/content/blob/639639bde105fc66291b87071c03da595475cfe3/linux_os/guide/system/auditing/package_audit-libs_installed/rule.yml#L2

Is this the wrong place I look at or is perhaps something else going wrong (which won't be that easy to fix) since the package name in the referenced file seems to be correct already ?

It was probably already fixed in the meantime. If so, we can close this issue. Could you confirm @teacup-on-rockingchair , please?

You are right, see https://github.com/ComplianceAsCode/content/commit/05e058bc50f5c2f45002c4bc1414352a2ca74be1 which belongs to v0.1.71 . I was still using v.0.1.69 and can confirm: No error with v.0.1.71 and therefore issue closed :)