AI agents: see /llms.txt for a full index of this site, or /llms-full.txt for concatenated documentation.

Back
Credential ProtectionFile AccessUpdated Dec 3, 2025

Protect iMessage Database from Unauthorized Access

Restrict iMessage chat.db database access to Apple Messages processes only, blocking infostealers from harvesting private chat history on macOS.

Idea

All of your private iMessage history is stored in an SQLite database in ~/Library/Messages. Apple's TCC might block new applications from getting to it, but if you've already given an application full disk access permission, like your favorite terminal emulator, programs can just go and read it. Santa's file access rules make it easy to limit access to this directory.

Solutions

File AccessiMessage Database Protection
Restrict access to Messages database to system processes only
Path Prefixes
Options
Allow Read Access:
Audit Only:
Rule Type:
Processes
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
  • Signing ID:
Custom Message

Mitre Attack

Tags

imessagepiichat

Deployment Notes

This rule is safe to deploy widely. It only restricts access to legitimate system processes that need access. Running sudo fs_usage -f filesys -w can show all processes that are able to read this directory.

Testing Instructions

  1. Deploy the rule
  2. Try: sqlite3 ~/Library/Messages/chat.db "SELECT * FROM message LIMIT 1"
  3. Verify Santa blocks the access
  4. Open Messages app and verify it works normally

Resources