How jamf/makemeanadmin works
Main Components
• User/Trigger: Represents the person executing the script (for example, via a self-service portal or command line).
• Shell Script (MakeMeAnAdmin.sh): The central component which:
• Instantly upgrades the user’s account privileges.
• Configures a launch daemon to schedule a demotion task after the designated time (30 minutes).
• Initiates log capture, grabbing logs recorded over the last 30 minutes.
• Launch Daemon (Scheduled Task): An OS-level component that is installed/configured by the script to ensure that, regardless of user logouts or system reboots, the privilege escalation will be undone after the given time interval.
• Operating System’s Logging & Privilege Management: The underlying system functionalities that handle the actual admin rights and the collection/storage of log data.
Relationships and Interactions
• The user initiates the process by running the script.
• The script immediately interacts with the OS to grant temporary admin privileges.
• Once privileges are granted, the script sets up a launch daemon. This daemon is responsible for:
• Monitoring uptime.
• Triggering a demotion script once the 30-minute window expires.
• Concurrently, the script directs the OS’s logging system to capture a snapshot of the past 30 minutes and save the logs to a specific directory.
• After the time frame elapses, the launch daemon automatically calls a demotion function that revokes the admin rights.
Architectural Patterns and Key Design Principles
• Sequential Workflow: The execution occurs in a linear sequence where privilege escalation, scheduling, and log capture happen one after the other.
• Automated Revocation: Incorporates an automated rollback mechanism using the OS’s launch daemon to ensure security is maintained, no matter how many times a user logs out or how the system reboots.
• Configuration Flexibility: Clear parameters in the script’s code (e.g., prompt text, duration values, log directory) allow changes per environment or policy requirements.
Relevant Technologies and Frameworks
• Shell/Bash Scripting: The primary language used.
• macOS Launch Daemons: Represented as a system-level service that helps schedule and execute the demotion process.
• System Logging: The built-in log capture facilities that the script leverages to record user activity.