Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIS Update - macOS 14, CIS v1.1.0 #21478

Merged
merged 12 commits into from
Oct 21, 2024

Conversation

defensivedepth
Copy link
Collaborator

@defensivedepth defensivedepth commented Aug 21, 2024

Changelog

ADD:

ADD - 2.3.3.2 Ensure the Time Service Is Enabled
ADD - 6.3.10 Ensure Show Status Bar Is Enabled

REMOVE:

REMOVE - 2.3.2.2 Ensure Time Is Set Within Appropriate Limits

UPDATE:

UPDATE - 2.6.1.2  Ensure Location Services Is in the Menu Bar
UPDATE - 3.1 Ensure Security Auditing Is Enabled 
UPDATE - 5.1.6 Ensure No World Writable Folders Exist in the System Folder
UPDATE - 5.7 Ensure an Administrator Account Cannot Login to Another User's Active and Locked Session
UPDATE - 2.9.1.1 Ensure the OS Is Not Active When Resuming from Standby (Intel)
UPDATE - 2.9.1.2 Ensure the OS Is Not Active When Resuming from Sleep and Display Sleep (Apple Silicon)

@defensivedepth defensivedepth changed the title CIS Update - macOS 14, CIS v2.1.0 CIS Update - macOS 14, CIS v1.1.0 Aug 21, 2024
@sharon-fdm sharon-fdm self-assigned this Aug 26, 2024
SELECT 1 FROM managed_policies WHERE
domain='com.apple.Safari' AND
name='ShowOverlayStatusBar' AND
(value = 1 OR value = 'true')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasmrod, when checking the list of users in managed_policies I find username = NULL for which the field ShowOverlayStatusBar = 1 is not deployed by the profile.

Thus this will not work.

SELECT 1 WHERE NOT EXISTS (
      SELECT 1 FROM users AS u
      LEFT JOIN (
        SELECT username FROM managed_policies WHERE
            domain=‘com.apple.Safari’ AND
            name=‘ShowOverlayStatusBar’ AND
            (value != 1 OR value != ‘true’)
      ) AS p
      ON p.username = u.username OR p.username IS NULL
    );

The problem remains that the profile only deploys the desired outcome to one username.
The query as it is now (I removed AND username='') does work here.
TMWYT

Copy link
Member

@lucasmrod lucasmrod Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the following steps:

  1. Installed https://github.com/fleetdm/fleet/blob/main/it-and-security/lib/configuration-profiles/macos-ensure-show-status-bar-is-enabled.mobileconfig on a macOS 14 VM with one user account "lucas".
  2. managed_policies returns the applied setting as expected and with username="lucas"
  3. I then created another user "gandalf".
  4. managed_policies still returns the same results as (2).
  5. I log out as "lucas" and log in as "gandalf".
  6. managed_policies now returns two rows with domain='com.apple.Safari', name='ShowOverlayStatusBar' (one with username='lucas' and one with username='gandalf').
    Screenshot 2024-10-17 at 7 04 41 AM

This means the domain='com.apple.Safari', name='ShowOverlayStatusBar' setting is system wide and, once applied, macOS makes sure all users have such setting applied (IOW, we don't care about username). Thus, knowing this, the query that we need is now actually simpler:

SELECT 1 FROM managed_policies WHERE domain='com.apple.Safari' AND name='ShowOverlayStatusBar' AND (value = 1 OR value = 'true');

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasmrod, In that case the existing query is G2G.
I will merge soon.

@sharon-fdm sharon-fdm marked this pull request as draft October 9, 2024 20:28
@sharon-fdm sharon-fdm marked this pull request as ready for review October 21, 2024 19:23
@sharon-fdm sharon-fdm merged commit 16afe9f into fleetdm:main Oct 21, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants