Sub topic 10
XProtect: built-in malware detection and removal
This chapter assumes you know how Gatekeeper checks an app at first launch and that you can open Terminal and run a command. XProtect is the part of macOS that recognizes known malware by its characteristics. It works alongside Gatekeeper but answers a different question.
What XProtect does
Gatekeeper asks where an app came from and whether it was signed and notarized. XProtect asks whether the file matches a known malware family. Apple maintains the detection rules, and macOS applies them in three situations:
- When an app, plug-in, or disk image is first opened, or after it changes.
- When XProtect receives updated signatures, which triggers a scan of existing files.
- Periodically, through a background component called XProtect Remediator.
XProtect has two jobs. Detection blocks a known-bad file from running. Remediation removes malware that is already present. Remediation is handled by XProtect Remediator, which runs scans in the background and removes the malware it finds.
Updates arrive without a macOS upgrade
Apple updates XProtect data independently of macOS releases. Your Mac checks for these updates automatically, and they install as background security data updates. This is why new malware families can be blocked within days. It also means you should keep automatic installation of security responses and system files turned on in System Settings under General, then Software Update, then the information button next to Automatic Updates.
You can see which XProtect version is installed in System Information. Open it from the Apple menu while holding Option, then go to Software and choose Installations to review recent XProtect entries. You can also list the files directly:
ls /Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/ResourcesThe folder contents vary between macOS versions. Treat them as read-only. Do not edit or delete anything there.
What you will see when XProtect acts
When XProtect matches a file, macOS shows a message that the file "will damage your computer" or "contains malware". The usual choices are Move to Trash or Cancel. Choose Move to Trash. Do not look for a way around the warning, because this block is not the same as a Gatekeeper "unidentified developer" prompt. You cannot override it through Privacy & Security.
Limits you should know
- XProtect only knows known threats. A new or heavily modified sample can pass until Apple adds a rule for it.
- It does not judge behavior such as an app asking for broad permissions. Review those yourself in Privacy & Security.
- It does not replace checking the source. A signed, notarized app can still be unwanted software, and a scam installer can trick you into approving it.
- It is not a full antivirus suite. It has no user-facing scan button or quarantine list.
Exercise
A coworker says that because XProtect is built in, any app that opens without a warning is safe. Give two reasons this is wrong.
Show answer
XProtect only detects known malware, so new or modified malware can pass until Apple adds a rule. It also does not evaluate whether an app is legitimate, trustworthy, or asking for excessive permissions, and a signed, notarized app can still be unwanted. You still need to vet the source and review permissions.