How northpolesec/santa works
Project type and purpose
• This is a macOS security tool (“Santa”) that enforces binary and file-access authorization.
• It comprises multiple user-space components (daemon, GUI agent, CLI, background services) and a kernel/system extension (via EndpointSecurity API).
File structure
• Top-level components under Source/:
• common/ – shared libraries and utilities (XPC interfaces, Protobuf definitions, caching, configuration, logging, CEL engine).
• gui/ – Swift/Objective-C GUI agent that displays block messages.
• santactl/ – CLI front-end for management (uses XPC to talk to daemon).
• santad/ – long-running daemon: monitors events (EndpointSecurity), manages policy, database, decision cache, metrics, process tree.
• santasyncservice/ – background sync service: downloads/upload rules and events from/to a remote sync server.
• santabundleservice/ – XPC “bundle” service for privileged file-access decisions.
• santametricservice/ – background metrics-collection service.
• Conf/ holds launchd plists and install scripts.
• Fuzzing/ contains fuzz-targets.
• docs/ holds a React/Docusaurus site for user/developer documentation.
README for additional insights
• “system extension” monitors exec/file access → events go to daemon.
• user-space components validate each other via XPC and mutual code-sign check.
• Synchronization via “sync servers” (Workshop, Moroz, etc.).
Elements
• Blue for core daemon & extension
• Green for user-interaction (GUI/CLI)
• Yellow for background services (Metrics, Sync, Bundle)
• Gray for external stub
• Important interfaces: Protobuf messages, DataLayer, Policy rules, XPC endpoints.
Adding the sync service & external sync server stub
• Inside SyncService, note Zlib compression, APNS/FCM push clients, SNTPushClientAPNS, SNTPushClientFCM, Polaris integration.