Skip to content

xsl/xccdf-share.xsl is missing fix-type labels for kickstart, ignition, and bootc remediation systems #2405

Description

@ggbecker

utils/oscap-xccdf.c's app_generate_fix() (lines 1071-1097) supports the following --fix-type values, each mapped to an XCCDF fix/@system URN:

--fix-type fix/@system
bash urn:xccdf:fix:script:sh
ansible urn:xccdf:fix:script:ansible
kickstart urn:xccdf:fix:script:kickstart
puppet urn:xccdf:fix:script:puppet
anaconda urn:redhat:anaconda:pre
ignition urn:xccdf:fix:script:ignition
kubernetes urn:xccdf:fix:script:kubernetes
blueprint urn:redhat:osbuild:blueprint
bootc urn:xccdf:fix:script:bootc

The HTML-guide XSLT (xsl/xccdf-share.xsl, the $fix_type variable at lines 318-328) only translates 6 of these 9 systems into a human-readable label:

<xsl:variable name="fix_type">
    <xsl:choose>
        <xsl:when test="$fix/@system = 'urn:xccdf:fix:script:sh'">Shell script</xsl:when>
        <xsl:when test="$fix/@system = 'urn:xccdf:fix:script:ansible'">Ansible snippet</xsl:when>
        <xsl:when test="$fix/@system = 'urn:xccdf:fix:script:puppet'">Puppet snippet</xsl:when>
        <xsl:when test="$fix/@system = 'urn:redhat:anaconda:pre'">Anaconda snippet</xsl:when>
        <xsl:when test="$fix/@system = 'urn:xccdf:fix:script:kubernetes'">Kubernetes snippet</xsl:when>
        <xsl:when test="$fix/@system = 'urn:redhat:osbuild:blueprint'">OSBuild Blueprint snippet</xsl:when>
        <xsl:otherwise>script</xsl:otherwise>
    </xsl:choose>
</xsl:variable>

Missing xsl:when branches for:

  • urn:xccdf:fix:script:kickstart (kickstart)
  • urn:xccdf:fix:script:ignition (ignition)
  • urn:xccdf:fix:script:bootc (bootc)

Fixes generated with these three --fix-type values fall through to the generic "script" label in the generated HTML guide instead of a descriptive one (e.g. "Kickstart snippet", "Ignition snippet", "Bootc script").

Suggested fix: add the three missing xsl:when branches to xsl/xccdf-share.xsl, with labels consistent with the existing naming convention.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions