Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCCDF -> Inspec is not processing text with \) correctly #78

Open
rlakey opened this issue Sep 26, 2023 · 0 comments
Open

XCCDF -> Inspec is not processing text with \) correctly #78

rlakey opened this issue Sep 26, 2023 · 0 comments

Comments

@rlakey
Copy link

rlakey commented Sep 26, 2023

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.

image

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.

U_VMware_vSphere_8_STIG_Readiness_Guide_v1r2.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant