View all Worklets
macOS

MacOS - Security - Enforce Lock Screen on Inactivity

This Worklet will read the MacOS's current auto logout time and then determine if this matches the desired amount. If the values do not match, remediation will change the logout timer to the desired value. This value is set to 900 seconds (15 minutes) but can be changed if the user would like to do so.

Worklet Details

Introduction to the Bash-Based MacOS - Security - Enforce Lock Screen on Inactivity Worklet

The bash-based Enforce Lock Screen on Inactivity Worklet is a security tool designed for macOS endpoints, capable of setting an automatic lock screen after a specified period of inactivity. 

This Worklet ensures that your Mac stays protected from unauthorized access by automatically initiating the screen save and lock screenr, which will require users to input their credentials when resuming work.

Why would you use the Enforce Lock Screen on Inactivity Worklet?

Implementing this macOS Security Worklet offers several benefits. It not only enhances your system's security by minimizing unauthorized access but also enforces company policies regarding idle time before triggering sleep or screen saver mode.

It also helps maintain compliance with regulatory requirements and industry best practices in data protection and user privacy.

Components of the MacOS - Security - Enforce Lock Screen on Inactivity Worklet

The Worklet comprises two primary components:an evaluation script, and a remediation script.
The evaluation script checks to see if the desired lock screen timer settings are enabled. If not, it exits for remediation.

Both elements are customizable to suit specific organizational needs. For example, you can adjust the desired_logout_seconds variable to set the auto logout time according to your preferences.

How does the MacOS - Security - Enforce Lock Screen on Inactivity Worklet work?

Upon execution, this Bash-based Worklet first checks whether an existing idle timer is already installed within your system. If not found, or if the configured settings do not match your desired values, it proceeds with remediation steps, such as creating an idle timer shell script and .plist file.

These files are then placed respectively within the "/Library/Application Support/Automox/" directory as "idle_timer.sh" and in the "/Library/LaunchDaemons/" directory as "com.idletimer.axtask.plist." Once these files have been created successfully, the launch daemon loads and schedules the idle timer check at regular intervals, as defined by the plist_interval variable.

What is the expected outcome when you use the MacOS - Security - Enforce Lock Screen on Inactivity Worklet?

This Worklet is designed to create a more secure macOS environment. It ensures that your system preferences are set to automatically lock the screen after a predetermined period of inactivity, preventing unauthorized access to sensitive data and applications.

By implementing this Worklet, you can reduce risks associated with leaving unattended devices open for an extended time and promote better security hygiene among users within your organization.

View in app

CONFIGURE

What's a Worklet?

Consider Automox Worklets your easy button. Grab ready-to-go PowerShell and BASH code from our catalog to automate any scriptable task on your Windows, macOS, and Linux endpoints.

do more with worklets