feat: Add macOS ESF pipeline (ecs_macos_esf) - #171
Merged
thomaspatzke merged 1 commit intoJan 13, 2026
Conversation
Add processing pipeline for macOS Endpoint Security Framework (ESF) events. - Maps Sigma taxonomy fields to ECS fields - Supports 16 logsource categories (process_creation, file_event, etc.) - Includes 8 unit tests - Adds field mappings for process, user, file, network, and code signature fields - Includes macOS-specific fields (SignalNumber, PtraceRequest, XpcServiceName, etc.)
Member
|
Great pull request! 🚀 We had a short discussion how to handle the logsource (specific for esf vs generic) but because there are lot of fields specific to ESF the additional service attribute in the log source is justified. Could you please also provide a pull request to the specification that documents the new log source (would best fit here and fields (as own subsection in the fields section? |
Contributor
Author
|
Thanks, @thomaspatzke! So glad to hear it was well received. Yes, I have a lot of that documented, but I'll do another round of updates and review this week. |
This was referenced Jan 21, 2026
Contributor
Author
|
Hi @thomaspatzke, I submitted the requested spec documentation PR. Please let me know if it needs any revisions. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Add macOS Endpoint Security Framework (ESF) Pipeline
Summary
This PR adds
ecs_macos_esf, a processing pipeline for macOS Endpoint Security Framework (ESF) events that maps Sigma taxonomy fields to ECS (Elastic Common Schema) fields.Type: New Pipeline
Platform: macOS
Data Source: Endpoint Security Framework (ESF) via
esloggerSUBMITTER NOTE: This is a follow-on PR from a previous PR submitted on 2025-11-05 [https://github.com/SigmaHQ/pySigma/pull/411] and addressing feedback from @thomaspatzke.
Description
The macOS Endpoint Security Framework (ESF) is Apple's modern security telemetry API that provides real-time notifications for security-relevant events including process execution, file operations, authentication, network connections, and more.
This pipeline enables Sigma rules to query ESF data that has been normalized to ECS format, following the same pattern as existing pipelines like
ecs_windowsandecs_zeek_beatsand Elastic Defend ECS fields for macOS telemetry.Data Flow
Files Changed
sigma/pipelines/elasticsearch/macos.pysigma/pipelines/elasticsearch/__init__.pyecs_macos_esfexporttests/test_pipelines_macos.pyREADME.mdField Mappings
Legend:
Process Fields (Sigma to ECS)
Imageprocess.executableProcessIdprocess.pidProcessNameprocess.nameCommandLineprocess.command_lineCurrentDirectoryprocess.working_directoryParentImageprocess.parent.executableParentProcessIdprocess.parent.pidParentProcessNameprocess.parent.nameParentCommandLineprocess.parent.command_lineUser/Group Fields (Sigma to ECS)
Userprocess.user.nameUserIdprocess.user.idEffectiveUserIdprocess.user.idRealUserIdprocess.real_user.idRealUserprocess.real_user.nameGroupIdprocess.group.idEffectiveGroupIdprocess.group.idRealGroupIdprocess.real_group.idTargetUseruser.target.nameTargetUserIduser.target.idTargetGroupgroup.target.nameTargetGroupIdgroup.target.idFile Fields (Sigma to ECS)
TargetFilenamefile.pathFileNamefile.nameFileDirectoryfile.directorySourceFilenamefile.source.pathDestinationFilenamefile.target.pathNetwork Fields (Sigma to ECS)
DestinationIpdestination.ipDestinationPortdestination.portSourceIpsource.ipSourcePortsource.portCode Signature Fields (Sigma to ECS)
Signedprocess.code_signature.existsSignatureStatusprocess.code_signature.statusSigningIDprocess.code_signature.signing_idTeamIDprocess.code_signature.team_idProcess Injection Fields (Sigma to ECS)
SourceImageprocess.executableSourceProcessIdprocess.pidTargetImagetarget.process.executableTargetProcessIdtarget.process.pidTargetProcessNametarget.process.nameTargetProcessGUIDtarget.process.entity_idUnix/macOS-Specific Fields (All NEW)
Note: All fields in this section are NEW and have no Windows/Sysmon equivalent.
SignalNumbersignal.numberPtraceRequestptrace.requestXpcServiceNamexpc.service_nameKextIdentifierdriver.nameMemoryProtectionmemory.protectionSummary of New Fields
Total New Fields: 22
UserId,EffectiveUserId,RealUserId,RealUser,GroupId,EffectiveGroupId,RealGroupId,TargetUser,TargetUserId,TargetGroup,TargetGroupId(11)FileDirectory,SourceFilename,DestinationFilename(3)SigningID,TeamID(2)TargetProcessName,TargetProcessGUID(2)SignalNumber,PtraceRequest,XpcServiceName,KextIdentifier,MemoryProtection(5)Why These New Fields?
Unix User/Group Model: Unix has separate real/effective user/group IDs for privilege management (setuid/setgid), which Windows handles differently with tokens.
macOS Code Signing: Apple's code signing uses
SigningIDandTeamIDfor developer identification, unique to macOS.Unix Process Control:
SignalNumberandPtraceRequestare Unix-specific mechanisms for process control/debugging.macOS IPC: XPC is Apple's inter-process communication framework, unique to macOS/iOS.
Kernel Extensions: macOS kernel extensions (kexts) have unique identifiers not found on Windows.
Supported Logsource Categories
process_creationevent.action:exec AND esf.event_type:9file_eventevent.category:filefile_createevent.action:create AND esf.event_type:13file_deleteevent.action:unlink AND esf.event_type:19file_renameevent.action:rename AND esf.event_type:21authenticationevent.category:authentication AND esf.event_type:111privilege_escalationevent.category:iamprocess_injectionevent.action:ptrace AND esf.event_type:64process_accessevent.action:ptrace AND esf.event_type:64process_signalevent.action:signal AND esf.event_type:27kernel_extensionevent.category:driverdriver_loadevent.category:drivercodesigningevent.action:cs_invalidatedsecurity_policyevent.category:malware,configurationmountevent.action:mount AND esf.event_type:22memory_protectionevent.action:mprotect AND esf.event_type:20Example Usage
Sigma Rule
Generated Lucene Query
CLI Usage
Tests
All 8 tests pass:
Run tests with:
Checklist
ecs_windows/ecs_zeek_beatspatterns__init__.pyexports the pipelineelasticsearch,eql,lucene,opensearchRelated Resources
ESF Event Types Reference
Notes for Reviewers
ECS Compliance: All field mappings have been verified against the official ECS specification. Some macOS-specific fields (like
signal.number,ptrace.request) are custom extensions that follow ECS naming conventions.Elastic Defend Compatibility: The ECS field names are aligned with Elastic Defend's field naming conventions for seamless integration with Elastic Security.
Cross-Platform Compatibility: The Sigma taxonomy fields used (
Image,CommandLine,TargetFilename, etc.) are the same as Windows Sysmon, enabling cross-platform rule development.Data Collection: This pipeline expects ESF data to be collected and normalized to ECS format. The ESF collector outputs data with ECS field names that this pipeline targets.