mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
Incorrect MacBook detection logic in os_sleep_and_display_sleep_apple_silicon_enable check script on Apple Silicon #21
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 @phaninder-scalefusion on GitHub.
Summary
The rule os_sleep_and_display_sleep_apple_silicon_enable for macOS benchmark fails due to an incorrect check condition in the script. The current logic does not properly identify Apple Silicon Macs and fails to correctly detect MacBook systems on some Apple Silicon devices.
Steps to reproduce
Operating System version
macOS Sonoma / macOS Sequoia (any Apple Silicon MacBook)
Intel or Apple Silicon
Apple Silicon
What is the current bug behavior?
The /usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice | grep -q "MacBook" check fails to detect Apple Silicon MacBooks correctly. As a result, the script does not proceed with evaluating sleepMode and displaysleepMode, leading to inaccurate benchmark results.
What is the expected correct behavior?
The script should correctly identify Apple Silicon MacBooks and validate both system type and CPU architecture as per CIS documentation.
Relevant logs and/or screenshots
Output of checks
The script returns 0 (no errors) even though the conditions for sleep and display sleep might not be correctly enforced, due to skipping the main check logic.
Possible fixes
Update the detection logic to align with CIS documentation: