Bug 1736850

Summary: anaconda remediation not generated by oscap xccdf generate --fix-type anaconda
Product: Red Hat Enterprise Linux 8 Reporter: Marek Haicman <mhaicman>
Component: openscapAssignee: Jan Černý <jcerny>
Status: CLOSED ERRATA QA Contact: Vojtech Polasek <vpolasek>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: ekolesni, mhaicman, mmarhefk, vpolasek
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openscap-1.3.2-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 15:40:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Haicman 2019-08-02 07:57:43 UTC
Description of problem:
command

`oscap xccdf generate fix --fix-type anaconda <ds>`

 is, according to the man page, meant to generate anaconda remediation snippets. It works for other fix types (bash, ansible, puppet), but anaconda is generated empty. It only works when full name is used in --template:

`oscap xccdf generate fix --profile pci-dss --template urn:redhat:anaconda:pre <ds>`

Version-Release number of selected component (if applicable):
openscap-scanner-1.3.1-1.el8.x86_64
scap-security-guide-0.1.44-2.el8.noarch


How reproducible:
reliably

Steps to Reproduce:
1. oscap xccdf generate fix --profile pci-dss --template urn:xccdf:fix:script:puppet /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
2. oscap xccdf generate fix --profile pci-dss --fix-type puppet /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
3. oscap xccdf generate fix --profile pci-dss --template urn:redhat:anaconda:pre /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
4. oscap xccdf generate fix --profile pci-dss --fix-type anaconda /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc

Actual results:
[root@ci-vm-10-0-136-41 ~]# oscap xccdf generate fix --profile pci-dss --template urn:xccdf:fix:script:puppet /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
     28      52     420
[root@ci-vm-10-0-136-41 ~]# oscap xccdf generate fix --profile pci-dss --fix-type puppet /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
     28      52     420
[root@ci-vm-10-0-136-41 ~]# oscap xccdf generate fix --profile pci-dss --template urn:redhat:anaconda:pre /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
      8       8      92
[root@ci-vm-10-0-136-41 ~]# oscap xccdf generate fix --profile pci-dss --fix-type anaconda /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
      0       0       0


Expected results:
[root@ci-vm-10-0-136-41 ~]# oscap xccdf generate fix --profile pci-dss --fix-type anaconda /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | wc
      8       8      92

Additional info:

Comment 1 Marek Haicman 2019-08-02 09:32:29 UTC
PR fixing the issue: https://github.com/OpenSCAP/openscap/pull/1390

Comment 2 Jan Černý 2019-08-05 10:49:34 UTC
The issue has been fixed upstream in https://github.com/OpenSCAP/openscap/pull/1390/

Comment 5 Jan Černý 2020-01-14 09:53:10 UTC
A simple test that tests this bug has been proposed to upstream in https://github.com/OpenSCAP/openscap/pull/1459

Comment 13 errata-xmlrpc 2020-04-28 15:40:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1629