Modern macOS LAPS: Local Admin Password Management with Intune and Key Vault

Managing local administrator passwords on enterprise macOS devices is a critical security challenge.Traditional approaches—such as static passwords or manual resets—are insecure, unscalable, and prone to compromise. With the rise of remote work and cloud-first management, organizations need a solution that:

  • Automatically rotates local admin passwords on Macs
  • Escrows passwords securely to a central, auditable location
  • Prevents end users from accessing or viewing the LAPS password
  • Allows only authorized Helpdesk/Admins to retrieve passwords when needed
  • Integrates natively with Intune and Azure AD/Entra ID for modern, zero-touch deployment

In this blog, I’ll walk through a robust, enterprise-ready LAPS solution for macOS, leveraging Intune, SCEP, and Azure Key Vault. We’ll cover both the end-user experience (where no one can see the password) and the Helpdesk/Admin experience (with secure, auditable password retrieval).


Solution Overview

A Two-Tiered Approach to macOS LAPS

Our solution is designed with both security and operational flexibility in mind. It consists of two main parts:

1. End-User Experience: Zero Access to LAPS Password

Goal: End users and standard device owners should never have access to the local admin password.

How it works:

  • The local admin password is rotated automatically on a schedule (e.g., daily) by a script deployed via Intune.
  • The new password is securely escrowed to Azure Key Vault using certificate-based authentication.
  • No password is ever displayed, stored in clear text, or accessible on the device.
  • End users cannot retrieve or view the LAPS password by any means.

2. Helpdesk/Admin Experience: Secure, Auditable Retrieval

Goal: Only authorized Helpdesk/Admins can retrieve the LAPS password, and only when needed.

Two secure options:

  • Option A: Direct Key Vault Access
    • Helpdesk staff with Azure Key Vault permissions can retrieve the password directly from the portal or via API.
    • Access is logged and auditable.
  • Option B: iLaps Admin App
    • A custom macOS app (iLaps) allows Helpdesk/Admins to fetch the password for a specific device.
    • The app uses Azure AD authentication and only shows the password to authorized users.
    • No need to grant broad Key Vault access; the app can enforce additional controls and auditing.
Security Principles
  • No clear-text passwords are stored or transmitted.
  • SCEP certificates are used for device identity and secure communication.
  • Azure Key Vault provides centralized, auditable, and role-based access to secrets.
  • Intune ensures only managed, compliant devices receive the LAPS solution.

This architecture ensures that only the right people, at the right time, can access sensitive credentials—while maintaining a strong security posture for your Mac fleet.


Part 1 – End-User LAPS (No Access)

End-User Experience: No Access to LAPS Password

For the vast majority of users, the LAPS solution is completely invisible and secure by design. Here’s how it works from the end-user perspective

How It Works:
  1. Automated Password Rotation:

A shell script, deployed via Intune, runs on a schedule (e.g., daily) using a LaunchDaemon. This script:

  • Generates a new, strong random password for the local admin account.
  • Updates the password on the device.
  • Authenticates to Azure AD using a securely deployed certificate.
  • Escrows the new password to Azure Key Vault.
  1. No Local Password Storage:
  • The password is never stored in clear text on the device.
  • If the upload to Key Vault fails, the password is temporarily stored in a root-only file as a fallback, and deleted as soon as escrow succeeds.
  1. No User Access:
  • End users have no way to view, retrieve, or intercept the local admin password.
  • The password is not shown in System Preferences, not available in Keychain, and not accessible via any local tool.
  1. No UI, No Disruption:
  • The process is silent and does not interrupt the user’s workflow.
  • Users are not prompted for any action and are unaware of the password rotation.
Security Highlights
  • Device identity is enforced using SCEP certificates, ensuring only managed Macs participate.
  • All password escrow operations are authenticated using a certificate registered in Azure AD.
  • Azure Key Vault acts as the single source of truth for all LAPS passwords, with full audit logging and RBAC.
Result
  • End users are protected from privilege escalation.
  • Attackers cannot extract the local admin password from the device.
  • Your organization meets compliance and security requirements for privileged account management.

Part 2 – Helpdesk/Admin LAPS Access

Helpdesk/Admin Experience: Secure, Auditable Retrieval

While end users have no access to the LAPS password, authorized Helpdesk and IT Admins need a secure, auditable way to retrieve it for legitimate support scenarios (e.g., device recovery, troubleshooting, or checks). This solution provides two secure options for Helpdesk/Admins to access the LAPS password:

Option 1: Direct Azure Key Vault Access

How it works:

  • Helpdesk/Admins are granted “Get” permission for secrets in Azure Key Vault via Azure RBAC or Key Vault access policies.
  • They can retrieve the LAPS password for a specific device using the Azure Portal, Azure CLI, PowerShell, or REST API.
  • Every access is logged in Azure for full auditability.

Pros:

  • Simple, leverages native Azure controls.
  • Easy to integrate with existing IT workflows.

Cons:

  • Requires Helpdesk/Admins to have direct access to Key Vault (may be too broad for some organizations).
  • Access is powerful—should be tightly controlled and monitored.
Option 2: iLaps Admin App (Recommended for Most Organizations)

How it works:

  • A custom macOS app (“iLaps”) is distributed only to authorized Helpdesk/Admins.
  • The app uses Azure AD authentication (MSAL) to ensure only permitted users can sign in.
  • Admins can search for a device, fetch its LAPS password (retrieved securely from Key Vault), and copy it to the clipboard.
  • The app can enforce additional controls, such as:
    • Limiting which devices an admin can access
    • Logging all password retrievals for audit
    • Hiding the password by default, with a “show/hide” toggle
    • Never storing the password locally

Pros:

  • No need to grant broad Key Vault access to all Helpdesk/Admins.
  • User-friendly, purpose-built interface.
  • Additional security and audit controls can be implemented.

Cons:

  • Requires initial setup and distribution of the app.
  • Needs to be maintained as part of your IT toolkit.
Security Emphasis
  • No password is ever stored in clear text on the admin’s device.
  • All access is authenticated and auditable via Azure AD and Key Vault logs.
  • RBAC and least privilege: Only authorized users can retrieve passwords, and only for the devices they support.

This dual-approach gives organizations the flexibility to choose the right balance of security and operational efficiency for their environment.


Security Deep Dive

Why This LAPS Solution Is Secure by Design:

Security is at the heart of this macOS LAPS solution. Here’s how each component contributes to a robust, enterprise-grade security posture:

  1. No Clear-Text Passwords, Ever:
    • On the Device:
      • The local admin password is never stored in clear text on disk, except as a root-only fallback if Key Vault upload fails (and is deleted as soon as escrow succeeds).
      • The password is not visible to end users, not present in Keychain, and not accessible via local tools.
    • In Transit:
      • Passwords are sent to Azure Key Vault over HTTPS, using OAuth2 client assertion (certificate-based authentication).
    • In the Cloud:
      • Passwords are stored as secrets in Azure Key Vault, protected by Azure’s encryption-at-rest and access controls.
  2. Certificate-Based Authentication:
    • Azure AD App Registration:
      • A dedicated certificate is registered with your Azure AD app.
      • The LAPS script uses this certificate to authenticate securely—no client secrets or passwords are used.
    • SCEP Certificates for Device Identity:
      • Each device receives a unique SCEP certificate via Intune, ensuring only managed, compliant Macs participate in the LAPS process.
  3. Azure Key Vault: Centralized, Auditable, and Secure:
    • Role-Based Access Control (RBAC):
      • Only authorized Helpdesk/Admins (or the iLaps app) can retrieve secrets.
      • Access can be scoped to specific users, groups, or service principals.
    • Audit Logging:
      • Every access to a secret is logged in Azure, providing a full audit trail for compliance and security investigations.
    • Secret Versioning and Expiry:
      • Key Vault supports secret versioning and automatic expiry, further reducing risk.
  4. Intune: Zero-Touch, Policy-Driven Deployment:
    • Scripts, certificates, and configuration profiles are deployed only to managed, compliant devices.
    • No manual intervention is required on the endpoint, reducing the risk of human error or insider threat.
  5. Least Privilege and Segregation of Duties:
    • Least Privilege and Segregation of Duties
    • End users have zero access to privileged credentials.
    • Helpdesk/Admins only have access via tightly controlled, auditable channels.
    • The iLaps app can enforce additional controls, such as limiting which devices an admin can access and logging every password retrieval.

This solution leverages the best of modern cloud and endpoint security:

  • No clear-text secrets
  • Certificate-based authentication
  • Centralized, auditable access
  • Zero-touch deployment
  • Granular RBAC and least privilege

Detailed Deployment Steps

Prerequisites Checklist:

Before beginning deployment, ensure you have:

  • Azure subscription with sufficient permissions
  • Microsoft Intune admin access
  • Azure Key Vault service enabled
  • macOS for testing
  • Terminal access to a macOS device
  • Azure CLI installed (brew install azure-cli)
  • Xcode installed for app signing (if deploying iLaps app)
Step 1: Azure AD App Registration
  • Navigate to: portal.azure.com
  • Search for “App registrations”
  • Click “New registration”
  • Configure as shown below:
Bundle ID - com.mavericklabs.iLaps

After registration, record these values:

  • Application (client) ID
  • Directory (tenant) ID
  • Object ID

Configure API permissions:

  • Add permission > Microsoft Graph
  • Required permissions
Step 2: Azure Key Vault Setup
  • Search for “Key vaults”
  • Click “+ Create”
  • Basic settings:
Subscription: Your subscription
Resource group: Create new "macOS-iLAPS-RG"
Key vault name: org-macos-laps-kv
Region: Your preferred region
Pricing tier: Standard
Days to retain deleted vaults: 90
  • Navigate to Access Policies
  • Add Access Policy:
Configure from template: Secret Management
Key permissions: None
Secret permissions: Get, Set, List
Certificate permissions: None
Select principal: Your Azure AD App (from Step 1)
Step 3: Generate Azure AD App Certificate and Key

Generate a private key and self-signed certificate (valid for 2 years):

openssl req -x509 -newkey rsa:2048 -keyout laps_app_key.pem -out laps_app_cert.pem -days 730 -nodes -subj "/CN=LAPS-App-Auth"

Files created:

  • laps_app_cert.pem (public certificate)
  • laps_app_key.pem (private key)
Step 4: Register the Certificate in Azure AD
  • Go to Azure Portal > Azure AD > App registrations > iLaps> Certificates & secrets.
  • Click Upload certificate and select laps_app_cert.pem.
  • Confirm the thumbprint matches your local file.
Step 5: Upload Files to Secure Blob Storage

Upload the following files to a secure Azure Blob Storage container (or equivalent):

  • laps_app_cert.pem
  • laps_app_key.pem
  • laps_rotate.sh (see script below)
  • com.maverick.ilaps.plist (see sample below)
#!/bin/bash
# LAPS for macOS - SCEP Certificate-based Authentication
# Log file: /var/log/laps_rotate.log

# Ensure jq is installed
if ! command -v jq &> /dev/null; then
  echo "jq not found, installing via Homebrew..."
  if ! command -v brew &> /dev/null; then
    echo "Homebrew not found, installing Homebrew..."
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"
  fi
  brew install jq
fi

# Log function
log() {
  echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /var/log/laps_rotate.log
}

# Core configuration
ACCOUNT="lapsadmin"
FULLNAME="Local Admin Account"
CLIENT_ID="164e2250-443a-44da-bb55-ffe103b39a13"
TENANT_ID="e834900c-91ff-4fd7-ac3d-c395c45fd77b"
KEYVAULT_NAME="IRL-KVA"
APP_CERT="/usr/local/laps/laps_app_cert.pem"
APP_KEY="/usr/local/laps/laps_app_key.pem"
KEYCHAIN="/Library/Keychains/System.keychain"

# Create directory if it doesn't exist
if [ ! -d "/usr/local/etc/laps" ]; then
    sudo mkdir -p /usr/local/etc/laps
    sudo chmod 700 /usr/local/etc/laps
fi

log "Starting LAPS password rotation"

# Calculate certificate thumbprint (SHA-1, base64url)
CERT_THUMBPRINT=$(openssl x509 -in "$APP_CERT" -noout -fingerprint -sha1 | awk -F'=' '{print $2}' | sed 's/://g' | xxd -r -p | base64 | tr '+/' '-_' | tr -d '=')

# Calculate certificate thumbprint (SHA-256, base64url)
CERT_THUMBPRINT_SHA256=$(openssl x509 -in "$APP_CERT" -noout -fingerprint -sha256 | awk -F'=' '{print $2}' | sed 's/://g' | xxd -r -p | base64 | tr '+/' '-_' | tr -d '=')

# Generate JWT header
JWT_HEADER=$(jq -n --arg x5t "$CERT_THUMBPRINT" --arg kid "$CERT_THUMBPRINT" --arg x5tS256 "$CERT_THUMBPRINT_SHA256" '{alg:"RS256",typ:"JWT",x5t:$x5t,kid:$kid,"x5t#S256":$x5tS256}')

echo "JWT_HEADER: $JWT_HEADER" | tee -a /var/log/laps_rotate.log

# Generate JWT payload
EPOCH_NOW=$(date +%s)
EPOCH_EXP=$((EPOCH_NOW + 600))
JTI=$(uuidgen)
JWT_PAYLOAD=$(jq -n --arg aud "https://login.microsoftonline.com/$TENANT_ID/v2.0" --arg iss "$CLIENT_ID" --arg sub "$CLIENT_ID" --arg jti "$JTI" --argjson nbf $EPOCH_NOW --argjson exp $EPOCH_EXP --argjson iat $EPOCH_NOW '{aud:$aud,iss:$iss,sub:$sub,jti:$jti,nbf:$nbf,exp:$exp,iat:$iat}')

# Base64url encode function
b64url() {
    openssl base64 -e -A | tr '+/' '-_' | tr -d '='
}

HEADER_B64=$(echo -n "$JWT_HEADER" | b64url)
PAYLOAD_B64=$(echo -n "$JWT_PAYLOAD" | b64url)
JWT_UNSIGNED="$HEADER_B64.$PAYLOAD_B64"

# Sign the JWT using OpenSSL directly
JWT_SIGNATURE=$(echo -n "$JWT_UNSIGNED" | openssl dgst -sha256 -sign "$APP_KEY" | openssl base64 -A | tr '+/' '-_' | tr -d '=')

# Assemble the JWT
CLIENT_ASSERTION="$JWT_UNSIGNED.$JWT_SIGNATURE"

# Generate password
PASSWORD=$(LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^&*()_+=-' < /dev/urandom | head -c 16)
log "Generated password for local admin account"

# Create/update account
if id "$ACCOUNT" &>/dev/null; then
  log "User $ACCOUNT exists, updating password"
  /usr/sbin/sysadminctl -resetPasswordFor "$ACCOUNT" -newPassword "$PASSWORD" || log "Warning: sysadminctl reported an error but continuing"
else
  log "Creating user $ACCOUNT"
  /usr/sbin/sysadminctl -addUser "$ACCOUNT" -fullName "$FULLNAME" -password "$PASSWORD" -admin || log "Warning: sysadminctl reported an error but continuing"
  /usr/bin/dscl . create /Users/"$ACCOUNT" IsHidden 1 || log "Warning: Could not hide user"
fi

# Get serial number for secret name
SERIAL=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}')
SECRET_NAME="${SERIAL}-localAdminPassword"
KEYVAULT_URL="https://${KEYVAULT_NAME}.vault.azure.net"

# Get Azure AD token using client_assertion
log "Getting Azure AD token using client_assertion"
TOKEN_RESPONSE=$(curl -sS -X POST "https://login.microsoftonline.com/${TENANT_ID}/oauth2/v2.0/token" \
  -d "client_id=${CLIENT_ID}" \
  -d "scope=https://vault.azure.net/.default" \
  -d "grant_type=client_credentials" \
  -d "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer" \
  -d "client_assertion=${CLIENT_ASSERTION}")

ACCESS_TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.access_token // empty')

if [[ -z "$ACCESS_TOKEN" ]]; then
  log "Failed to get token. Response: $TOKEN_RESPONSE"
  # Save password locally as fallback
  echo "Device: $(hostname), Serial: $SERIAL, Account: $ACCOUNT, Password: $PASSWORD, Date: $(date)" > "/var/root/.laps_password"
  chmod 600 "/var/root/.laps_password"
  log "Saved password locally to /var/root/.laps_password"
  exit 1
fi

# Upload password to Key Vault
log "Uploading password to Key Vault"
UPLOAD_URL="${KEYVAULT_URL}/secrets/${SECRET_NAME}?api-version=7.4"
PAYLOAD="{\"value\": \"${PASSWORD}\", \"attributes\": {\"enabled\": true}}"

UPLOAD_RESPONSE=$(curl -sS -w "%{http_code}" -o /tmp/kv_upload_response.json -X PUT "$UPLOAD_URL" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$PAYLOAD")

if [[ "$UPLOAD_RESPONSE" == "200" || "$UPLOAD_RESPONSE" == "201" ]]; then
  log "Password successfully escrowed to Azure Key Vault"
  exit 0
else
  log "Failed to upload password. Status: $UPLOAD_RESPONSE"
  cat /tmp/kv_upload_response.json >> /var/log/laps_rotate.log
  # Save password locally as fallback
  echo "Device: $(hostname), Serial: $SERIAL, Account: $ACCOUNT, Password: $PASSWORD, Date: $(date)" > "/var/root/.laps_password"
  chmod 600 "/var/root/.laps_password"
  log "Saved password locally to /var/root/.laps_password"
  exit 1
fi
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.mavericklabs.laps</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/laps/laps_rotate.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>0</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
    <key>StandardOutPath</key>
    <string>/var/log/laps.log</string>
    <key>StandardErrorPath</key>
    <string>/var/log/laps.log</string>
</dict>
</plist> 

Restrict access to these files using SAS tokens.

Step 6: Prepare the LAPS Password Rotation Script
  • laps_rotate.sh (key points):
  • Rotates the local admin password
  • Authenticates to Azure AD using the app cert/key
  • Escrows the password to Azure Key Vault
  • Logs actions to /var/log/laps_rotate.log
Step 7: Prepare the LaunchDaemon Plist

com.maverick.laps.plist (sample, runs daily at midnight):xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.mavericklabs.laps</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/laps/laps_rotate.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>0</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
    <key>StandardOutPath</key>
    <string>/var/log/laps.log</string>
    <key>StandardErrorPath</key>
    <string>/var/log/laps.log</string>
</dict>
</plist>
Step 8: Create the Intune Bootstrap Script
#!/bin/bash

set -e

CERT_URL="https://<yourblob>.blob.core.windows.net/laps/laps_app_cert.pem?<SAS_TOKEN>"
KEY_URL="https://<yourblob>.blob.core.windows.net/laps/laps_app_key.pem?<SAS_TOKEN>"
SCRIPT_URL="https://<yourblob>.blob.core.windows.net/laps/laps_rotate.sh?<SAS_TOKEN>"
PLIST_URL="https://<yourblob>.blob.core.windows.net/laps/com.maverick.laps.plist?<SAS_TOKEN>"

LAPS_DIR="/usr/local/laps"
PLIST_PATH="/Library/LaunchDaemons/com.maverick.laps.plist"

sudo mkdir -p "$LAPS_DIR"
sudo chown root:wheel "$LAPS_DIR"
sudo chmod 700 "$LAPS_DIR"

curl -fsSL "$CERT_URL" -o "$LAPS_DIR/laps_app_cert.pem"
curl -fsSL "$KEY_URL" -o "$LAPS_DIR/laps_app_key.pem"
sudo chown root:wheel "$LAPS_DIR/laps_app_cert.pem" "$LAPS_DIR/laps_app_key.pem"
sudo chmod 600 "$LAPS_DIR/laps_app_cert.pem" "$LAPS_DIR/laps_app_key.pem"

curl -fsSL "$SCRIPT_URL" -o "$LAPS_DIR/laps_rotate.sh"
sudo chown root:wheel "$LAPS_DIR/laps_rotate.sh"
sudo chmod 700 "$LAPS_DIR/laps_rotate.sh"

curl -fsSL "$PLIST_URL" -o "$PLIST_PATH"
sudo chown root:wheel "$PLIST_PATH"
sudo chmod 644 "$PLIST_PATH"

if sudo launchctl list | grep -q maverick; then
    sudo launchctl unload "$PLIST_PATH"
fi
sudo launchctl load "$PLIST_PATH"

echo "LAPS deployment complete."
Step 9: Deploy via Intune
  • Create a SCEP Certificate Profile:
  • Assign your SCEP profile to the target device group for device identity.
Step 10: Shell Script Deployment:
  • Go to Devices > macOS > Shell scripts in Intune.
  • Upload laps_bootstrap.sh.
  • Assign to the same device group.
Step 11: Verification
  • On a target Mac, check:
  • /usr/local/laps/laps_app_cert.pem and /usr/local/laps/laps_app_key.pem exist and are root:wheel, 600.
  • /usr/local/laps/laps_rotate.sh is root:wheel, 700.
  • /Library/LaunchDaemons/com.maverick.laps.plist is root:wheel, 644 and loaded (sudo launchctl list | grep maverick).
  • /var/log/laps_rotate.log shows successful password escrow to Azure Key Vault.
Step 12: Maintenance & Security
  • Rotate the app certificate before expiry and update both Azure AD and blob storage.
  • Rotate SAS tokens for blob storage regularly.
  • Monitor logs and Intune deployment status.
  • Remove local fallback password files (/var/root/.laps_password) as part of your security policy.

Troubleshooting

  • No password in Key Vault: Check logs for JWT or certificate errors.
  • JWT errors: Ensure the certificate in /usr/local/laps/ matches the one in Azure AD.
  • File not found errors: Confirm the bootstrap script is downloading files to the correct location.
  • LaunchDaemon not running: Check plist permissions and syntax.

Security Strengths

  1. Certificate-Based Authentication
    • The script u. Automated Rotation
    • Passwords are rotated on a schedule, reducing the window of exposure.
    • No static or hardcoded passwords.
  2. Minimal Local Exposure
    • If upload to Key Vault fails, the password is stored locally in /var/root/.laps_password with 600 permissions as a fallback.
    • This file can be monitored and purged as part of your security policy.
  3. Intune Delivery
    • Intune ensures only managed, compliant devices receive the script and certs.
    • Blob storage access can be restricted with SAS tokens or IP allowlists.ses a private key and certificate (not a password or client secret) to authenticate to Azure AD.
    • The certificate is registered in Azure AD and only valid devices have the private key.
  4. Key Storage and Permissions
    • The private key (laps_app_key.pem) and certificate are stored in /usr/local/laps/ with root:wheel ownership and 600 permissions.
    • Only root can read these files, minimizing risk of compromise.
  5. No Secrets in Intune Profiles
    • No certificate passwords or secrets are stored in Intune configuration profiles.
    • All sensitive files are distributed via a secure script and protected blob storage.
  6. Azure Key Vault Escrow
    • Passwords are sent directly to Azure Key Vault using secure HTTPS and OAuth2.
    • Only authorized users/apps can retrieve secrets from Key Vault, with full audit logging.
  7. Automated Rotation
    • Passwords are rotated on a schedule, reducing the window of exposure.
    • No static or hardcoded passwords.
  8. Minimal Local Exposure
    • If upload to Key Vault fails, the password is stored locally in /var/root/.laps_password with 600 permissions as a fallback.
    • This file can be monitored and purged as part of your security policy.
  9. Intune Delivery
    • Intune ensures only managed, compliant devices receive the script and certs.
    • Blob storage access can be restricted with SAS tokens or IP allowlists.

Using the iLaps app for retrieving the LAPS password remotely

The iLaps app provides a secure, user-friendly interface for authorized Helpdesk and IT administrators to retrieve LAPS passwords remotely. This native macOS application streamlines the password retrieval process while maintaining strict security controls and comprehensive audit logging.

Authentication and Launch

When launching iLaps, administrators are presented with a modern, clean interface requiring Azure AD authentication. The app uses Microsoft Authentication Library (MSAL) to handle secure sign-in, supporting both standard and multi-factor authentication methods. Only users belonging to authorized Azure AD security groups can successfully authenticate.

Main Interface Features

The app’s main window presents a streamlined search interface where administrators can:

  • Search for devices by name, serial number, or Azure AD device ID
  • View device details including last password rotation time
  • See their recent password retrieval history

Summary

The macOS iLAPS solution detailed provides a robust, enterprise-grade approach to local administrator password management. By leveraging Azure Key Vault, Intune, and certificate-based authentication, organizations can:

  • Automatically rotate local admin passwords
  • Securely store and retrieve credentials
  • Maintain comprehensive audit trails
  • Enable zero-trust security principles
Best Practices
1. Security
  • Rotation Frequency
    • Rotate passwords at least every 24 hours
    • Consider more frequent rotation for high-security environments
    • Implement immediate rotation post-password retrieval
  • Certificate Management
    • Use 2048-bit or stronger certificates
    • Set up automatic certificate renewal
    • Monitor certificate expiration dates
    • Maintain secure certificate storage
  • Access Control
    • Implement strict RBAC in Azure Key Vault
    • Use security groups for access management
    • Regular access reviews (quarterly recommended)
    • Enable Just-In-Time access where possible
2. Operational Excellence
  • Monitoring
    • Set up alerts for:
    • Failed password rotations
    • Unusual access patterns
    • Certificate expiration warnings
    • Script execution failures
  • Documentation
    • Maintain updated runbooks
    • Document emergency access procedures
    • Keep deployment guides current
    • Record all customizations
  • Testing
    • Regular end-to-end testing
    • Validate backup procedures
    • Test disaster recovery scenarios
    • Conduct periodic security reviews
3. Compliance
  • Auditing
    • Enable verbose logging
    • Retain logs according to compliance requirements
    • Regular audit log reviews
    • Document all password retrievals
  • Reporting
    • Monthly compliance reports
    • Password rotation success rates
    • Access pattern analysis
    • Security incident reviews
Future Considerations

Consider implementing:

  1. Integration with SIEM solutions
  2. Machine learning for anomaly detection
  3. Automated compliance reporting
  4. Enhanced mobile support for password retrieval
  5. Integration with IT service management tools
Emergency Procedures

Maintain documented procedures for:

  1. Certificate compromise response
  2. Key Vault access issues
  3. Network connectivity failures
  4. Script malfunction recovery
  5. Emergency password retrieval
Support and Maintenance

Regular maintenance should include:

  • Weekly script health checks
  • Monthly access review
  • Quarterly security assessment
  • Annual disaster recovery testing
Final Thoughts

This LAPS implementation strikes a balance between security and usability, providing:

  • Zero-trust security model
  • Seamless end-user experience
  • Robust admin controls
  • Comprehensive audit capability

Remember that security is a journey, not a destination. Regularly review and update your implementation to address new threats and organizational needs.


Categories: Automation, Intune, macOS, Security, Xcode

8 thoughts on “Modern macOS LAPS: Local Admin Password Management with Intune and Key Vault”

  1. hi, I am stuck on step 9 when creating the SCEP cert in Intune. THe SCEP server URL I can not see. Where can I get my URL?
    Nice post by the way. Really cool feature and I hope it works.

  2. I don’t really understand what you are doing in Step #9. I didn’t setup anything there, but I think the system is still working.

    Also, where do i get the “iLaps app”?

    Another thing, the Step 4 screenshot shows that you setup a ‘Client secret’ but i don’t think we use that. The procedure has us setup a ‘Certificate’

    Overall I really like your approach. A few tweaks to your procedure and I think you’d have one of the best free LAPS for Macs solutions available.

  3. Manage to set this up from July, however i noticed yesterday that the rotated password stop’s working. When i ran the script manually it still upload the password to Azure but the password is not working.

    2025-09-30 11:23:21 – Generated password for local admin account
    2025-09-30 11:23:21 – User cisadmin exists, updating password
    2025-09-30 11:23:21.754 sysadminctl[7886:2519969] Operation is not permitted without secure token unlock.
    2025-09-30 11:23:22 – Getting Azure AD token using client_assertion
    2025-09-30 11:23:23 – Uploading password to Key Vault
    2025-09-30 11:23:24 – Password successfully escrowed to Azure Key Vault

    Is there anyone having the same issue? Or any suggestion?

    Thank you

Leave a Reply

Cookies Notice

Intune - In Real Life, uses cookies. If you continue to use this site it is assumed that you are happy with this.

Discover more from Intune - In Real Life

Subscribe now to keep reading and get access to the full archive.

Continue reading