mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
JXA Checks are causing the generated baseline_compliance.sh to break #261
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 @jordanburnette on GitHub.
Summary
When running
generate_guidance.pyon dev_cis_moneterey branch for cis_lvl1 rules, the newly updated checks that leverage javascript are preventing the created to break. See Screenshot below of an example from the generated script:Steps to reproduce
generate_guidance.py baselines/cis_lvl1.yaml -sto generate the compliance scriptOperating System version
macOS Monterey 12.X
What is the current bug behavior?
When running the script on a targeted machine, parse errors show
What is the expected correct behavior?
The compliance script should be able to run properly without giving parse error, allowing one to run
Relevant logs and/or screenshots
(contents of cis_lvl1_compliance.sh created from generate_guidance.py at the point of the first jxa check @ Line 1003)

Output of checks
(line items will vary on your testing since I am not using all the rules)
cis_lvl1_compliance.sh:5089: parse errorcis_lvl1_compliance.sh:5275: parse error near 'result_value=$(/usr/...'Possible fixes
Not sure TBH. May require some work on the
generate_guidance.pyscript to allow the compiled script to maintain the Javascript checks when they are being used.@robertgendler commented on GitHub:
Fixed in dev_monterey!
1 rule had
check: not check:|
@jordanburnette commented on GitHub:
Confirmed to be fixed.