Description
When running saf generate xccdf_benchmark2inspec_stub
from saf cli we are seeing some issues with some content that contains parenthesis that are inside the %q() syntax.
For example given this original check text:
At the command prompt, run the following command:
# /opt/vmware/sbin/vami-lighttpd -p -f /opt/vmware/etc/lighttpd/lighttpd.conf 2>/dev/null|awk '/server\.modules/,/\)/'|grep mod_accesslog
Expected result:
"mod_accesslog",
If the output does not match the expected result, this is a finding.
Note: The command must be run from a bash shell and not from a shell generated by the "appliance shell". Use the "chsh" command to change the shell for the account to "/bin/bash". Refer to KB Article 2100508 for more details:
https://kb.vmware.com/s/article/2100508
The conversion is adding an additional \ before the ) in the command which is causing the quoting to break and produce invalid content like in this screenshot.

If i remove the added \ it is fine or if i change the delimeter from () to {} or [] it works but that still leaves the undesirable added \ which changes the command in the text and causes it to break if people try to copy it out of the InSpec text and run it.
I attached the source XCCDF for this to reproduce it if you take the U_VMware_vSphere_8_vCenter_Appliance_VAMI_STIG_Readiness_Guide_V1R2-xccdf.xml
file from the zip.