mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 05:53:24 +00:00
mobileconfig creation ignores exempt preferences settings #291
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 @noambernstein on GitHub.
Originally assigned to: @golbiga on GitHub.
Summary
settings applied by mobileconfig ignore exempt preferences settings
Steps to reproduce
set the defaults plist in /Library/Preferences/org.PROFILE.plist exempt entry to true (and exempt_reason) for a rule that is enforced by mobileconfig, e.g. os_camera_disable. Then generate the mobileconfigs with
scripts/generate_guidance.py -p build/baselines/stig_6390.yaml. The resulting mobileconfig will contain the entry that disables the camera, even though it should be exempt. Only the [source,bash] fixes take exempt into account, from what I can tell,Operating System version
11.3.0
What is the current bug behavior?
things are disabled by the generated mobileconfig files even if they should not be.
What is the expected correct behavior?
rules that are exempt should not produce entries in the generated mobileconfig files.
Possible fixes
modify
generate_guidance.py -y, I suppose, to read the preferences before deciding if a rule's mobileconfig entry should be created.@golbiga commented on GitHub:
@noambernstein the exemptions are used when you configure something that is "out of compliance" but want to report it as such... it's not meant to configure a system out of compliance, only for reporting.
If you do not want os_camera_disable included in your guidance, you can create a stig baseline with
generate_baseline.py -k stigremove the rule from baseline inbuild/baselines/stig.yaml, and rungenerate_guidance.pyagainst it, then the profile will not be generated.@noambernstein commented on GitHub:
This is what I figured (although more documentation of this capability would be helpful). What I'd really like is for it to be tested, reported as passed or exempt (or maybe "failed but exempt"), but not remediated.
In that case, why does the
..._compliance.shscript not apply the fix if exempt is set to true?I assumed the workflow for remediation (whether or not some rules were set to exempt) was
However, in its current state it will behave inconsistently. The compliance script will not remediate exempt rules, but the generated mobileconfigs will enforce settings required by exempt rules.
Am I just misunderstanding the intended process for a system with exempt rules?
@noambernstein commented on GitHub:
Is this in essence the problem? Are the exempt settings are meant to be set independently for each managed machine (by e.g. copying a modified version of the default
....audit.plistinto the real location, namely /Library/Preferences/) , so it doesn't make sense to do anything with them when the mobile profiles are being generated?If that's the intended workflow, perhaps this could be documented someplace (in general I didn't see any documentation for the exempt functionality), but if so I agree that no source code changes are needed. I could always write a script that removes mobileconfig payloads and modifies the default plist entries corresponding to things that need to be exempt.