Automox Worklet: Enable Gatekeeper on macOS

Gatekeeper is a built-in security feature of macOS that was originally introduced in Mac OS X Lion (10.7.3).  Gatekeeper enforces code signing and verifies downloaded applications before allowing them to run. 

This Automox Worklet ensures that Gatekeeper is always enabled on the macOS system.

Automox Worklet: Enable Gatekeeper on macOS

To deploy this endpoint hardening Worklet, do the following:

  1. Log in to your Automox Console.
  2. Navigate to the System Management page and click Create Policy in the upper right-hand section of the screen.
  3. Choose macOS under Worklet. Automox console - create policy
  4. Copy and paste the Evaluation and Remediation code scripts from below. The evaluation code keeps you apprised of each device’s ongoing compliance, as well as flags the device for remediation. The remediation code enforces this setting on the schedule you define.


# helper function to check if a command exists
function command_exists {
    type "$1" &> /dev/null
# only evaluate if the spctl command is available
if command_exists spctl; then
    # check if gatekeeper is enabled
    spctl --status | grep -q "assessments enabled"
    # yay? or nay?
    exit $?
# spctl command not available, move along
exit 0


# enable gatekeeper for all users
spctl --master-enable
# did we succeed?
exit $?

5. Click Create Worklet.

6. Assign Worklet to a group or multiple groups and click Save Changes.

9. Execute the Worklet by clicking the Execute Policy Now button.

That’s it. Your macOS endpoints will now have Gatekeeper enabled. If you need technical assistance, contact our support team at

About Automox

Facing growing threats and a rapidly expanding attack surface, understaffed and alert-fatigued organizations need more efficient ways to eliminate their exposure to vulnerabilities. Automox is a modern cyber hygiene platform that closes the aperture of attack by more than 80% with just half the effort of traditional solutions.

Cloud-native and globally available, Automox enforces OS & third-party patch management, security configurations, and custom scripting across Windows, Mac, and Linux from a single intuitive console. IT and SecOps can quickly gain control and share visibility of on-prem, remote and virtual endpoints without the need to deploy costly infrastructure. 

Experience modern, cloud-native patch management today with a 15-day free trial of Automox and start recapturing more than half the time you're currently spending on managing your attack surface. Automox dramatically reduces corporate risk while raising operational efficiency to deliver best-in-class security outcomes, faster and with fewer resources.

Get Instant Updates on Vulnerabilities

Subscribe to receive Automox vulnerability alerts

Reduce your threat surface by up to 80%

Make all of your corporate infrastructure more resilient by automating the basics of cyber hygiene.

Take 15 days to raise your security confidence!
Start a Free Trial