mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
fixtext commands are broken; have newline chars instead of spaces #296
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @securevia1 on GitHub.
Summary
(Summarize the bug encountered concisely)
fixtext commands are broken; have newline chars instead of spaces. for example, see the fix command below
Same issue is there for description fields of rules. See below:
Smartcard authentication
MUST be enforced.
If the result is not
1, this is a finding.
Steps to reproduce
(How one can reproduce the issue - this is very important)
Open the XML file and see fixtext
Operating System version
(macOS Version and build)
What is the current bug behavior?
(What actually happens)
What is the expected correct behavior?
(What you should see instead)
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
Output of checks
(Paste any output that occurs with the bug)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
@robertgendler commented on GitHub:
This was resolved with the
generate_scap.pyscript.@GaryGapinski commented on GitHub:
@securevia1 what XML document did you inspect? Would you please provide (or link to) a copy?
What you noticed is incorrect content in the fixtext and description elements.
I just did a build from the
mainbranch and see the following in the SCAP datastream:and
In both cases the
<fixtext>element contains HTML which encapsulates the shell commands in a<pre>element (and would be rendered as separate lines).The
<description>and<fixtext>content of the first rule looks wrong as if it was arbitrarily wrapped . The companion HTML and PDF of the first rule are also incorrect.The
<description>of the second rule is incorrect and looks arbitrarily wrapped. It appears to be an error in the build process translation from HTML to XHTML.@robertgendler commented on GitHub:
It turns out this may be an issue with how asciidoctor is transforming the adoc into HTML
Something like this in the adoc file
/usr/bin/profiles -P -o stdout | /usr/bin/grep -c 'allowSmartCard = 1'Gets turned into this
<pre class="rouge highlight"><code data-lang="bash">/usr/bin/profiles <span class="nt">-P</span> <span class="nt">-o</span> stdout | /usr/bin/grep <span class="nt">-c</span> <span class="s1">'allowSmartCard = 1'</span></code></pre>So the XHTML and XML are not at fault, it seems to be adoc -> html. We may be able to figure out a way to parse this and remove it when it's converted to XHTML and XML.
@securevia1 commented on GitHub:
We used this link to download the macOS benchmark:
https://github.com/usnistgov/macos_security/releases/download/big_sur_rev1/MSCP_Big_Sur_Rev_1.zip