{"id":3187,"date":"2026-06-16T09:18:36","date_gmt":"2026-06-16T09:18:36","guid":{"rendered":"https:\/\/zecurit.com\/help\/?post_type=docs&#038;p=3187"},"modified":"2026-06-16T09:18:36","modified_gmt":"2026-06-16T09:18:36","slug":"filevault-encryption-management","status":"publish","type":"docs","link":"https:\/\/zecurit.com\/help\/endpoint-management\/bitlocker-management\/filevault-encryption-management\/","title":{"rendered":"FileVault Encryption Management"},"content":{"rendered":"\n<p>Zecurit supports full FileVault disk encryption management on macOS devices through remote script execution. Admins can enable encryption, check status, rotate recovery keys, and disable encryption, all from the Zecurit dashboard without any action required on the end-user device.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Scripts<\/strong><\/h1>\n\n\n\n<p>Download both scripts and upload them to your Zecurit remote script library.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Script File<\/strong><\/td><td><strong>Purpose<\/strong><\/td><td><strong>Script File<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>filevault_enable.sh<\/strong><\/td><td>Enables FileVault with password and escrows the recovery key<\/td><td>Contact Support<\/td><\/tr><tr><td><strong>filevault_manager.sh<\/strong><\/td><td>Status check, disable, key rotation, and key retrieval<\/td><td>Contact Support<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Action Reference<\/strong><\/h1>\n\n\n\n<p>The table below maps each Zecurit dashboard action to the corresponding script and command.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Zecurit UI Action<\/strong><\/td><td><strong>Script to Execute<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>Enable FileVault<\/strong><\/td><td><strong>filevault_enable.sh<\/strong><\/td><td>Enables FileVault encryption and escrows the recovery key<\/td><\/tr><tr><td><strong>Check Status<\/strong><\/td><td><strong>filevault_manager.sh status<\/strong><\/td><td>Reports current encryption state, progress %, and key info<\/td><\/tr><tr><td><strong>Disable FileVault<\/strong><\/td><td><strong>filevault_manager.sh disable<\/strong><\/td><td>Starts decryption process in the background<\/td><\/tr><tr><td><strong>Rotate Recovery Key<\/strong><\/td><td><strong>filevault_manager.sh rotate-key<\/strong><\/td><td>Generates a new Personal Recovery Key and escrows it<\/td><\/tr><tr><td><strong>Retrieve Escrowed Key<\/strong><\/td><td><strong>filevault_manager.sh get-key<\/strong><\/td><td>Retrieves the locally escrowed recovery key<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Setup &amp; Configuration<\/strong><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1 : Upload Scripts to Zecurit<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to the Zecurit Admin Console.<\/li>\n\n\n\n<li>Navigate to <strong>Manage \u2192 Script Repository-> Templates \u2192 <\/strong><\/li>\n\n\n\n<li>Search File Vault Manager <\/li>\n\n\n\n<li>Add both <strong>filevault_enable.sh<\/strong> and <strong>filevault_manager.sh<\/strong> to My Scripts<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2 : Configure the Enable Script<\/strong><\/h2>\n\n\n\n<p>The <strong>filevault_enable.sh<\/strong> script requires the target user&#8217;s password to authenticate with FileVault. Pass it as an environment variable in your Zecurit script payload:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td># Set this in the Zecurit script environment variables section FILEVAULT_USER_PASSWORD=&#8221;user_login_password_here&#8221;<br><br># Then execute: sudo bash filevault_enable.sh<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u26a0 <strong>Security Note: <\/strong>Always pass the password via an environment variable \u2014 never hardcode it in the script body. Zecurit encrypts environment variables at rest and in transit.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3 : Configure Recovery Key Escrow (Optional)<\/strong><\/h2>\n\n\n\n<p>By default, the recovery key is saved to the user&#8217;s Desktop and logged to <strong>\/var\/log\/filevault_manager.log<\/strong>. To push the key directly to your backend, edit the <strong>escrow_key()<\/strong> function in <strong>filevault_manager.sh<\/strong> and uncomment the curl block:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td># In filevault_manager.sh \u2014 escrow_key() function: curl -s -X POST &#8220;https:\/\/YOUR_MDM_ENDPOINT\/api\/filevault\/escrow&#8221; \\ -H &#8220;Authorization: Bearer YOUR_MDM_TOKEN&#8221; \\ -d &#8220;{\\&#8221;serial\\&#8221;:\\&#8221;$SERIAL\\&#8221;,\\&#8221;recovery_key\\&#8221;:\\&#8221;$key\\&#8221;}&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Action Details<\/strong><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Enable FileVault<\/strong><\/h2>\n\n\n\n<p>Enables FileVault disk encryption on the target Mac. The script authenticates with the logged-in user&#8217;s credentials, initiates encryption, and captures the Personal Recovery Key (PRK).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>FILEVAULT_USER_PASSWORD=&#8221;password&#8221; sudo bash filevault_enable.sh<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>What happens:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verifies FileVault is not already enabled<\/li>\n\n\n\n<li>Detects the active GUI user session<\/li>\n\n\n\n<li>Passes credentials securely via <strong>fdesetup -inputplist<\/strong> (Apple&#8217;s only supported method)<\/li>\n\n\n\n<li>Captures the Personal Recovery Key from the output plist<\/li>\n\n\n\n<li>Prints recovery key between <strong>ESCROW_KEY_START<\/strong> \/ <strong>ESCROW_KEY_END<\/strong> markers for Zecurit to scrape<\/li>\n\n\n\n<li>Saves key to user&#8217;s Desktop at <strong>~\/Desktop\/FileVault_Recovery_Key.txt<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Note: <\/strong>FileVault encryption runs in the background after enabling. The Mac remains fully usable during this process. Encryption time depends on disk size (typically 15 min \u2013 2 hours).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Check Status<\/strong><\/h2>\n\n\n\n<p>Returns the current FileVault state as a JSON object, suitable for automated parsing by the Zecurit agent.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>sudo bash filevault_manager.sh status<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Example output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>{ &#8220;status&#8221;: &#8220;success&#8221;, &#8220;filevault_enabled&#8221;: true, &#8220;encryption_in_progress&#8221;: true, &#8220;decryption_in_progress&#8221;: false, &#8220;progress_percent&#8221;: &#8220;43.7&#8221;, &#8220;has_institutional_key&#8221;: false, &#8220;os_version&#8221;: &#8220;14.5.0&#8221; }<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Response fields:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Field<\/strong><\/td><td><strong>Value<\/strong><\/td><td><strong>Meaning<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>filevault_enabled<\/strong><\/td><td><strong>true \/ false<\/strong><\/td><td>Whether FileVault is currently on<\/td><\/tr><tr><td><strong>encryption_in_progress<\/strong><\/td><td><strong>true \/ false<\/strong><\/td><td>Whether encryption is still running<\/td><\/tr><tr><td><strong>decryption_in_progress<\/strong><\/td><td><strong>true \/ false<\/strong><\/td><td>Whether decryption is still running<\/td><\/tr><tr><td><strong>progress_percent<\/strong><\/td><td><strong>0\u2013100 or null<\/strong><\/td><td>Encryption\/decryption completion %<\/td><\/tr><tr><td><strong>has_institutional_key<\/strong><\/td><td><strong>true \/ false<\/strong><\/td><td>Whether an institutional key exists<\/td><\/tr><tr><td><strong>os_version<\/strong><\/td><td><strong>e.g. 14.5.0<\/strong><\/td><td>macOS version on the device<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Disable FileVault<\/strong><\/h2>\n\n\n\n<p>Initiates FileVault decryption. The disk will be decrypted in the background. The Mac remains usable throughout the process.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>sudo bash filevault_manager.sh disable<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u26a0 <strong>Important: <\/strong>Decryption can take as long as the original encryption. Do not force-restart the Mac during this process. Run the <strong>status<\/strong> action to monitor progress.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Rotate Recovery Key<\/strong><\/h2>\n\n\n\n<p>Generates a new Personal Recovery Key, invalidating the old one. The new key is automatically escrowed. Use this action periodically or after a security event.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>sudo bash filevault_manager.sh rotate-key<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>What happens:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Calls <strong>fdesetup changerecovery -personal<\/strong> to generate a new PRK<\/li>\n\n\n\n<li>Writes the new key to <strong>\/Library\/Preferences\/com.company.filevault.escrow.plist<\/strong><\/li>\n\n\n\n<li>Returns the new key in the JSON response for Zecurit to store<\/li>\n\n\n\n<li>Old key is immediately invalidated<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Retrieve Escrowed Key<\/strong><\/h2>\n\n\n\n<p>Retrieves the recovery key that was saved locally during the last enable or rotate action. Useful if the key was not captured by the Zecurit agent at enable time.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>sudo bash filevault_manager.sh get-key<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Recommended Workflow<\/strong><\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>1<\/strong><\/td><td>Admin clicks &#8220;Enable FileVault&#8221; in the Zecurit dashboard for a target device.<\/td><\/tr><tr><td><strong>2<\/strong><\/td><td>Zecurit sets FILEVAULT_USER_PASSWORD in the environment and executes filevault_enable.sh on the device.<\/td><\/tr><tr><td><strong>3<\/strong><\/td><td>Script enables FileVault, captures the recovery key, and prints ESCROW_KEY_START&#8230;ESCROW_KEY_END.<\/td><\/tr><tr><td><strong>4<\/strong><\/td><td>Zecurit agent scrapes the output and stores the recovery key securely in the admin console.<\/td><\/tr><tr><td><strong>5<\/strong><\/td><td>Admin runs the status action periodically to monitor encryption progress.<\/td><\/tr><tr><td><strong>6<\/strong><\/td><td>Once encryption_in_progress returns false, FileVault is fully active.<\/td><\/tr><tr><td><strong>7<\/strong><\/td><td>Admin rotates the recovery key periodically using the rotate-key action.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Troubleshooting<\/strong><\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Error \/ Symptom<\/strong><\/td><td><strong>Resolution<\/strong><\/td><\/tr><\/thead><tbody><tr><td>ERROR: No standard user logged into the GUI<\/td><td>The script requires an active user session. Ensure the user is logged into the Mac (not at the login screen) before running.<\/td><\/tr><tr><td>ERROR: Incorrect password<\/td><td>The FILEVAULT_USER_PASSWORD value doesn&#8217;t match the user&#8217;s current login password. Update it in the Zecurit script payload.<\/td><\/tr><tr><td>FileVault is already enabled (skipped)<\/td><td>No action needed. The device is already encrypted. Run the status action to confirm.<\/td><\/tr><tr><td>UI shows &#8216;Turn On FileVault&#8217; but script says enabled<\/td><td>This is a known macOS UI display lag. Trust the script output. Verify using Disk Utility \u2192 select volume \u2192 check &#8216;Encrypted: Yes&#8217;.<\/td><\/tr><tr><td>Key rotation fails<\/td><td>FileVault must be fully enabled (not in progress) before rotating keys. Run status first and check encryption_in_progress is false.<\/td><\/tr><tr><td>Script exits with no output<\/td><td>Ensure the script is executed with sudo. Non-root execution will exit silently on some macOS versions.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"featured_media":0,"parent":3017,"menu_order":7,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-3187","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/docs\/3187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/comments?post=3187"}],"version-history":[{"count":2,"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/docs\/3187\/revisions"}],"predecessor-version":[{"id":3189,"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/docs\/3187\/revisions\/3189"}],"up":[{"embeddable":true,"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/docs\/3017"}],"prev":[{"title":"Encryption Pre-Requisites","link":"https:\/\/zecurit.com\/help\/endpoint-management\/bitlocker-management\/encryption-prerequisites\/","href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/docs\/3069"}],"wp:attachment":[{"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/media?parent=3187"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/zecurit.com\/help\/wp-json\/wp\/v2\/doc_tag?post=3187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}