build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi' #138

Closed
opened 2026-01-19 18:29:21 +00:00 by michael · 1 comment
Owner

Originally created by @Frissi0n on GitHub.

Summary

Cannot run compliance scripts on Sonoma.

Steps to reproduce

git clone https://github.com/usnistgov/macos_security.git
git checkout sonoma
pip3 install -r requirements.txt
bundle install --binstubs --path mscp_gems
python3 scripts/generate_guidance.py -s baselines/cis_lvl1.yaml
sudo bash build/cis_lvl1/cis_lvl1_compliance.sh
Password:
build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi'
build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: `fi'

Operating System version

14.1.1

Intel or Apple Silicon

Intel

What is the current bug behavior?

Compliance scripts fail, not just the CIS one.

What is the expected correct behavior?

Compliance script should work and print help menu

Relevant logs and/or screenshots

[build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi'
](https://github.com/usnistgov/macos_security.git)build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: `fi'

Output of checks

build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi'
build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: `fi'
Originally created by @Frissi0n on GitHub. ### Summary Cannot run compliance scripts on Sonoma. ### Steps to reproduce ``` git clone https://github.com/usnistgov/macos_security.git git checkout sonoma pip3 install -r requirements.txt bundle install --binstubs --path mscp_gems python3 scripts/generate_guidance.py -s baselines/cis_lvl1.yaml sudo bash build/cis_lvl1/cis_lvl1_compliance.sh Password: build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi' build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: `fi' ``` ### Operating System version 14.1.1 ### Intel or Apple Silicon Intel ### What is the current *bug* behavior? Compliance scripts fail, not just the CIS one. ### What is the expected *correct* behavior? Compliance script should work and print help menu ### Relevant logs and/or screenshots ``` [build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi' ](https://github.com/usnistgov/macos_security.git)build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: `fi' ``` ### Output of checks ``` build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: syntax error near unexpected token `fi' build/cis_lvl1/cis_lvl1_compliance.sh: line 6359: `fi' ```
Author
Owner

@brodjieski commented on GitHub:

The compliance script is a zsh script. Calling it with bash will cause issues and not run correctly.

Try calling the script directly as the generate guidance script should set it to executable.

@brodjieski commented on GitHub: The compliance script is a zsh script. Calling it with bash will cause issues and not run correctly. Try calling the script directly as the generate guidance script should set it to executable.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: usnistgov/macos_security#138