Remove Quarantine attribute from EPM
Objective
The com.apple.quarantine attribute is a macOS security feature that flags files downloaded from the internet or transferred from external sources. This flag helps macOS protect your system by displaying warning prompts when you try to open such files, ensuring the user is aware of potential risks.
In some occasions, the removal of extended attribute is a must in order to install EPM and create the installation package.
Before the creation of the PKG file, please remove the attribute from the Zip file, unzip and try to see if there is a need to remove the attribute from the .app bundle as well.
Note: it is much preferred to download the EPM zip file on a Mac based machine and not copy from Windows machine to avoid any issues.
Environment
23.12;24.1;24.2;24.3;24.4;24.5;24.6;24.7;24.8;24.9;24.10;24.11 EPM Mac Agent
Procedure
How to Check for the com.apple.quarantine Attribute
You can check if a file or directory has the quarantine flag using the Terminal:
- Open Terminal (located in Applications > Utilities).
- Run the following command to list extended attributes:
xattr <file_or_directory_path>
- If
com.apple.quarantineappears in the output, the file is flagged.
Removing com.apple.quarantine from Files
For .zip Files
When a .zip file is flagged, its contents will also be quarantined upon extraction.
-
Remove the quarantine from the
.zipfile before extracting:
xattr -r -d com.apple.quarantine /path/to/yourfile.zip - Verify the removal: Re-run the
xattrcommand to confirm that the attribute no longer exists:
xattr /path/to/yourfile.zip - Extract the
.zipfile: Use Finder or theunzipcommand in Terminal:
unzip /path/to/yourfile.zip
Examples:
- to list the attributes on the file:
$ xattr '/Users/<username>/Downloads/CyberArkEPMAgentSetupMacos_24.11.0.498(Security Research(cyberark_81))x64.zip'
result:
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine - to remove quarantine attribute:
xattr -r -d 'com.apple.quarantine' '/Users/<username>/Downloads/CyberArkEPMAgentSetupMacos_24.11.0.498(Security Research(cyberark_81))x64.zip' - to verify:
$ xattr '/Users/<username>/Downloads/CyberArkEPMAgentSetupMacos_24.11.0.498(Security Research(cyberark_81))x64.zip'
result:
com.apple.metadata:kMDItemWhereFroms
For .app Bundles
Applications downloaded from the internet are often flagged, resulting in a Gatekeeper prompt when you try to open them.
-
Remove the quarantine from the
.appfile before extracting:
xattr -r -d 'com.apple.quarantine' '/path/to/yourfile.app' - Verify the removal: Re-run the
xattrcommand to confirm that the attribute no longer exists:
xattr /path/to/yourfile.app
After removal of this attribute, you can continue to create EPM package without any issues or errors.
If you're facing an issue, please open a case and contact us.