mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
Output of check using jq for two DDM rules fail to match #34
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 @jordywitteman on GitHub.
Summary
When parsing
DiskManagement_Settings.plistviaplutilandjq, the.ExternalStoragerestriction outputs"ReadOnly"(with quotes) instead ofReadOnly. This seems to apply for both theos_external_storage_access_definedandos_network_storage_restrictionrules which both usejqSteps to reproduce
ReadOnlyvalue/usr/bin/plutil -convert json /var/db/ManagedConfigurationFiles/DiskManagement/DiskManagement_Settings.plist -o - | /usr/bin/jq '.Restrictions | .ExternalStorage'"ReadOnly"/Library/Logs/YOUR_BASELINE.logand search foros_external_storage_access_definedoros_network_storage_restrictionos_external_storage_access_defined failed (Result: "ReadOnly", Expected: "{'string': 'ReadOnly'}")Operating System version
macOS 15.6 (24G84)
Intel or Apple Silicon
Apple Silicon
What is the current bug behavior?
The rule check outputs the value with double quotes, such as
"ReadOnly"What is the expected correct behavior?
The rule check should out the value without double quotes, such as
ReadOnlywhich matches the expected value in the rule fileRelevant logs and/or screenshots
Output of checks
os_external_storage_access_defined failed (Result: "ReadOnly", Expected: "{'string': 'ReadOnly'}")Possible fixes
Use the
-ror--raw-outputas an option of thejqcommand. For example:/usr/bin/plutil -convert json /var/db/ManagedConfigurationFiles/DiskManagement/DiskManagement_Settings.plist -o - | /usr/bin/jq --raw-output '.Restrictions.ExternalStorage'@robertgendler commented on GitHub:
Thanks for bringing this to our attention.