Errors generating CIS compliance profiles #272

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

Originally created by @Oh4sh0 on GitHub.

Hello!

I've been trying to test out generation of profiles for CIS benchmark compliance.

With all components installed, trying to run:
./scripts/generate_guidance.py build/baselines/CIS-Benchmark.yaml -l /Git/macOS-Security/custom/Images/cis_banner.png -p -x

yields:
FileNotFoundError: [Errno 2] No such file or directory: '../sections/useraccounts.yaml'

And I can confirm that file does not exist in the sections folder. I can create a generic placeholder file, but that punts me to the next error of:
./scripts/generate_guidance.py build/baselines/CIS-Benchmark.yaml -p -x

Profile YAML: build/baselines/CIS-Benchmark.yaml
Output path: /Users/xxx/macos_security/build/CIS-Benchmark/CIS-Benchmark.adoc
Custom template found for : adoc_foreword
Custom template found for : adoc_authors
Custom template found for : adoc_acronyms
Custom template found for : adoc_additional_docs
Rule file not found in library, checking in custom folder for rule: useraccounts_password_hints_disable
Traceback (most recent call last):
File "./scripts/generate_guidance.py", line 1805, in
main()
File "./scripts/generate_guidance.py", line 1591, in main
if glob.glob('../custom/rules/**/{}'.format(rule_file), recursive=True):
UnboundLocalError: local variable 'rule_file' referenced before assignment

Am I missing something in this process?

Originally created by @Oh4sh0 on GitHub. Hello! I've been trying to test out generation of profiles for CIS benchmark compliance. With all components installed, trying to run: ./scripts/generate_guidance.py build/baselines/CIS-Benchmark.yaml -l /Git/macOS-Security/custom/Images/cis_banner.png -p -x yields: FileNotFoundError: [Errno 2] No such file or directory: '../sections/useraccounts.yaml' And I can confirm that file does not exist in the sections folder. I can create a generic placeholder file, but that punts me to the next error of: ./scripts/generate_guidance.py build/baselines/CIS-Benchmark.yaml -p -x Profile YAML: build/baselines/CIS-Benchmark.yaml Output path: /Users/xxx/macos_security/build/CIS-Benchmark/CIS-Benchmark.adoc Custom template found for : adoc_foreword Custom template found for : adoc_authors Custom template found for : adoc_acronyms Custom template found for : adoc_additional_docs Rule file not found in library, checking in custom folder for rule: useraccounts_password_hints_disable Traceback (most recent call last): File "./scripts/generate_guidance.py", line 1805, in <module> main() File "./scripts/generate_guidance.py", line 1591, in main if glob.glob('../custom/rules/**/{}'.format(rule_file), recursive=True): UnboundLocalError: local variable 'rule_file' referenced before assignment Am I missing something in this process?
Author
Owner

@robertgendler commented on GitHub:

This issue pertains to a fork of the project that can be found at https://github.com/mvdbent/CIS-macOS-Security. You will need to open an issue with the author of the fork.

But make sure you read the directions and follow them exactly from the forked version.

@robertgendler commented on GitHub: This issue pertains to a fork of the project that can be found at [https://github.com/mvdbent/CIS-macOS-Security](https://github.com/mvdbent/CIS-macOS-Security). You will need to open an issue with the author of the fork. But make sure you read the directions and follow them exactly from the forked version.
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#272