View all Worklets
macOS

macOS - Security - Enforce Lock Screen on Inactivity

Regulates macOS lock screen timing following user inactivity.

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

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets