macos_security
macos_security copied to clipboard
system_settings_sleep_enforce rule has same detection limitations as os_sleep_and_display_sleep_apple_silicon_enable on Apple Silicon
Summary
The system_settings_sleep_enforce rule in macOS Sonoma has similar limitations as os_sleep_and_display_sleep_apple_silicon_enable (issue #576). It fails to correctly detect Apple Silicon MacBooks, lacks CPU architecture validation, and includes sleep/display logic that may conflict with remediation, causing false positives. Since os_sleep_and_display_sleep_apple_silicon_enable already checks and remediates the same settings, this rule appears redundant.
Steps to reproduce
- Run the system_settings_sleep_enforce check script on an Apple Silicon MacBook.
- Observe that Apple Silicon MacBooks may not be correctly identified due to missing CPU architecture checks.
- Observe potential false positives due to sleep vs displaysleep evaluation conflicts.
- Compare functionality with os_sleep_and_display_sleep_apple_silicon_enable which already covers the same remediation.
Operating System version
macOS Sonoma
Intel or Apple Silicon
Apple Silicon
What is the current bug behavior?
- The rule does not correctly detect Apple Silicon MacBooks, causing skipped or incorrect evaluations.
- CPU architecture detection is missing, so Intel and Apple Silicon Macs are not distinguished.
- The sleep vs displaysleep check may conflict with remediation values, producing false positives.
- Redundant functionality exists because os_sleep_and_display_sleep_apple_silicon_enable already checks and remediates the same settings.
What is the expected correct behavior?
- The rule should correctly identify Apple Silicon MacBooks and evaluate sleep settings as per CIS documentation.
- CPU architecture should be checked to differentiate Intel and Apple Silicon Macs.
- Sleep vs displaysleep logic should align with remediation to avoid false positives.
- Consider removing the rule or consolidating it with os_sleep_and_display_sleep_apple_silicon_enable to avoid redundancy.
Relevant logs and/or screenshots
# Similar checks as issue #576 would fail on Apple Silicon MacBooks:
$ /usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice | grep -q "MacBook"
# Returns non-zero on Apple Silicon
$ /usr/bin/sudo /usr/sbin/system_profiler SPHardwareDataType | grep -e MacBook
# Correctly detects MacBook on Apple Silicon
$ /usr/bin/sudo /usr/sbin/sysctl -n machdep.cpu.brand_string
# Returns: "Apple M3 Pro" or similar
Output of checks
The rule may produce false positives, skip checks, or incorrectly report compliance due to detection and logic limitations.
Possible fixes
- Remove system_settings_sleep_enforce for Apple Silicon or consolidate it with os_sleep_and_display_sleep_apple_silicon_enable.
- Align detection logic with issue #576, including proper Apple Silicon detection, CPU architecture check, and sleep vs displaysleep logic.