Most endpoint alerts, log records and exploit write-ups assume you already know what a kernel, a process and a system call are, and many analysts are never taught. This guide explains the operating system concepts that sit underneath endpoint detection: the split between kernel mode and user mode, how processes and memory are isolated, how programs ask the kernel for work through system calls, and where security tools attach to watch that traffic. It covers Linux, macOS and Windows side by side, listed alphabetically, at concept level rather than exploitation detail. It is written for junior analysts, career changers and detection engineers who want to read telemetry with confidence.
Key takeaways
- Two privilege worlds: applications run in user mode with private memory, while the kernel and most drivers share one privileged address space, so a fault or compromise there affects the whole machine.
- System calls are the choke point: almost everything an attacker wants to do (start a process, open a file, connect to a host, load a driver) ends in a request to the kernel, which is why that boundary is where the best telemetry lives.
- APIs are not system calls: on Windows the documented Win32 API sits above an undocumented native layer, and on Linux glibc wraps syscalls, so a tool that only watches the top layer can be bypassed.
- Each OS offers a supported telemetry path: eBPF on Linux, the Endpoint Security framework on macOS and Event Tracing for Windows (ETW) on Windows, each with different trade-offs in depth and stability.
- Kernel compromise ends the game: code running in the kernel can blind or remove any user-mode defence, so driver control, signing and kernel hardening matter as much as detection.
What an operating system does
An operating system shares one set of hardware between many programs safely. It schedules CPU time, hands out memory, mediates access to files and devices, and enforces who may do what. For a defender the important point is that the OS is also the referee: it decides whether a request is allowed, and it is the only component that sees every request. That is why endpoint security tools try to sit as close to the OS as they can.
- Kernel: the core that runs with full hardware privilege and implements scheduling, memory management, file systems, networking and security checks.
- Drivers and modules: code that extends the kernel to talk to hardware or add features. On Linux these are loadable kernel modules; on Windows, kernel-mode drivers; on macOS, kernel extensions (kexts), now discouraged in favour of system extensions.
- User space: everything else, from shells and browsers to services and the security agent's own console.
Networking concepts used later (sockets, ports, connections) are covered in the Networking Fundamentals for Defenders Guide.
Kernel mode and user mode
Modern CPUs provide hardware privilege levels, traditionally drawn as rings. Mainstream operating systems use only two of them: the most privileged level for the kernel and the least privileged for applications. Microsoft's driver documentation describes it plainly: applications operate in user mode, core operating system components function in kernel mode, and the processor switches between the two depending on the code it is running.
1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.
+-------------------------------------------------+
| Ring 3: user mode |
| browsers, shells, services, EDR user agent |
| each process: private virtual address space |
| | system call (controlled entry) ^ |
| v | |
| +-------------------------------------------+ |
| | Ring 0: kernel mode | |
| | kernel, drivers/modules, EDR sensor | |
| | one shared address space, full privilege | |
| +-------------------------------------------+ |
+-------------------------------------------------+
Below ring 0 (where present): hypervisor and
firmware, used for features such as Windows
memory integrity (HVCI)
Two consequences follow, and both shape security tooling:
- Isolation in user mode: each application gets its own process with a private virtual address space, so one application cannot modify another's data, and a crash affects only that process.
- No isolation in kernel mode: all kernel code shares a single virtual address space. Microsoft notes that a kernel-mode driver is not isolated from other drivers or the operating system, and that a crashing kernel-mode driver crashes the entire operating system. The same property means malicious kernel code can read or alter anything, including a security product.
The stability and visibility trade-off between agents built in each mode is examined in Kernel-Mode vs User-Mode EDR.
Processes, threads and memory
- Process: a running program plus its resources: a virtual address space, open handles or file descriptors, and a security identity. On Windows each process also has a private handle table.
- Thread: the unit the scheduler actually runs. A process has one or more threads sharing its memory.
- Parent and child: every process is started by another. Parent and child relationships (for example an office application spawning a shell) are among the most useful signals in detection.
- Virtual memory: each process sees its own address range, mapped by the kernel onto physical memory. Memory regions carry permissions (read, write, execute), and memory that is both writable and executable in an unexpected process is a classic sign of injected code.
- Loaded modules: shared libraries (DLLs on Windows, shared objects on Linux, dylibs on macOS) are mapped into processes. Unexpected modules or modules loaded from user-writable paths are common detection points.
Attackers abuse these structures rather than break them. Process injection (ATT&CK T1055 Process Injection Defensive Guide) runs code inside another process to borrow its identity, and reading the memory of the Windows credential process (T1003.001 LSASS Memory) is a standard credential theft step. Both depend on one process obtaining access to another, which is a request the kernel sees.
System calls and APIs
A system call is the controlled doorway from user mode into the kernel. The Linux syscalls manual calls it the fundamental interface between an application and the Linux kernel, and notes that programs usually reach it through C library wrapper functions rather than directly. Windows layers this further: applications call documented Win32 functions in libraries such as kernel32.dll, which call the native API in ntdll.dll, which performs the transition into the kernel. Attackers who call the native layer directly (ATT&CK T1106 Native API) can avoid tools that only watch the documented layer.
| Action | Linux system call | macOS (Endpoint Security event) | Windows API path | Typical telemetry source |
|---|---|---|---|---|
| Start a program | execve, clone | ES_EVENT_TYPE_AUTH_EXEC / NOTIFY_EXEC, NOTIFY_FORK | CreateProcess (Win32) to native process creation in ntdll | auditd execve records, eBPF; Endpoint Security; Security event 4688, Sysmon event 1 |
| Open or create a file | openat | AUTH_OPEN / NOTIFY_CREATE | CreateFile to native file open | auditd file watches, eBPF; Endpoint Security; Sysmon event 11, ETW file providers |
| Map memory | mmap | AUTH_MMAP | VirtualAlloc, MapViewOfFile | eBPF; Endpoint Security; ETW and EDR sensors |
| Inspect another process | ptrace | process access events | OpenProcess, ReadProcessMemory | auditd ptrace rules, eBPF; Endpoint Security; Sysmon event 10 |
| Load kernel code | init_module, finit_module | kext loading (restricted) | driver service creation and load | auditd module rules; MDM and system logs; Sysmon event 6, Security event 7045 (service install, System log) |
| Load an eBPF program | bpf | not applicable | not applicable | auditd bpf rules, bpftool inventory |
Event names and IDs above are examples to orient you; confirm each against your platform's documentation and your agent's configuration. Detailed coverage is in the Linux Logging and auditd for Defenders Guide, the Sysmon Guide and the Windows Event Log Guide.
Privilege, users and access control
Every process runs as some identity, and the kernel checks that identity on each sensitive request.
- Linux: processes carry user and group IDs. The capabilities manual explains that privileged processes (effective UID 0) traditionally bypass all kernel permission checks, and that since Linux 2.2 root's power is divided into capabilities that can be granted separately: CAP_SYS_MODULE loads kernel modules, CAP_SYS_PTRACE traces arbitrary processes, CAP_BPF (split out in Linux 5.8) permits privileged BPF operations, and CAP_SYS_ADMIN is so broad the manual calls it the new root.
- macOS: a Unix user model (root and standard users) with additional layers: System Integrity Protection, privacy consent (TCC) for protected data, and code signing with entitlements. The Endpoint Security framework itself requires the com.apple.developer.endpoint-security.client entitlement.
- Windows: each process has a primary access token holding the user SID, group SIDs, a logon SID and a list of privileges. Mandatory Integrity Control adds integrity levels (low, medium, high, system): standard users run at medium, elevated users at high, services at system, and by default a lower-integrity process cannot write to a higher-integrity object.
| Boundary | Linux | macOS | Windows | Why defenders care |
|---|---|---|---|---|
| User to administrator | sudo, setuid binaries, capabilities | admin group, authorisation prompts | UAC elevation from medium to high integrity | Privilege escalation (T1068) usually crosses this line first |
| Administrator to kernel | module loading, eBPF loading | system extensions, kexts (Reduced Security needed) | driver loading, signed driver rules | Kernel code can disable user-mode defences |
| Process to process | ptrace scope, namespaces | code signing, hardened runtime | integrity levels, protected processes | Injection and credential dumping rely on cross-process access |
Why kernel exploits matter
Once an attacker runs code in the kernel, through a kernel vulnerability (T1068), a malicious or vulnerable driver, or a loaded module (T1547.006 Kernel Modules and Extensions), the user and process boundaries above no longer protect anything. Rootkits (T1014) hide processes and files from the very APIs tools rely on, and defence impairment (T1685 Disable or Modify Tools) becomes trivial. Microsoft's guidance on its vulnerable driver blocklist explains the pattern: kernel code runs with the highest privileges, so attackers look for flaws in legitimate signed drivers to reach the kernel. The defensive response is covered in the Bring Your Own Vulnerable Driver and EDR Killers Guide.
How security tools hook in
Security agents need to see requests as they cross into the kernel. Each OS now offers a supported, documented route, and the older approach of patching kernel structures is discouraged or blocked.
- Linux: eBPF. eBPF runs sandboxed programs inside the kernel without changing kernel source or loading modules. A verifier checks each program for safety before it attaches, and programs attach to system calls, tracepoints, function entry and exit, or kprobes and uprobes. Data flows to user space through maps such as ring buffers. eBPF is also an attack surface; see the eBPF Security Guide. The audit subsystem (auditd) is the older, widely deployed alternative.
- macOS: Endpoint Security framework. A C API, available since macOS 10.15, that a system extension uses to authorise pending events or receive notifications of events that already occurred, including process execution, mounting file systems, forking and signals. AUTH events wait for the client's verdict; if the client misses its deadline the documented default is that the client is killed, with fail-open and fail-closed modes available. Apple describes system extensions as running in user space with only the privileges they need, unlike kernel extensions that have full access to the operating system.
- Windows: ETW plus kernel callbacks. ETW is a kernel-level tracing facility built from controllers that start sessions, providers that emit events and consumers that read them in real time or from a log. EDR drivers also register kernel notification callbacks for process, thread and image load events and use file system minifilters. Sysmon and the Security log are built on these mechanisms.
| Property | eBPF (Linux) | Endpoint Security (macOS) | ETW and callbacks (Windows) |
|---|---|---|---|
| Where the logic runs | Verified program in kernel, analysis in user space | System extension in user space | Kernel driver plus user-mode consumer |
| Can it block? | Yes, with LSM or enforcement hooks on supported kernels | Yes, through AUTH events | Yes, through drivers and minifilters |
| Who may load it | Processes with CAP_BPF or CAP_SYS_ADMIN | Signed apps with Apple's entitlement, approved by user or MDM | Signed drivers; ETW sessions need administrative rights |
| Main blind spot | Kernel version differences, attacker-loaded eBPF | Events outside the framework's coverage | Tampering with providers or callbacks from kernel code |
Windows, Linux and macOS differences
- Linux: one kernel with many distributions and versions, so available hooks and audit defaults vary. Containers share the host kernel, which means a kernel flaw affects every container on the node. Hardening options such as kernel lockdown, module signing and sysctl settings are in the Linux Kernel Hardening and sysctl Guide.
- macOS: Apple controls the kernel tightly. Kernel extensions on macOS 11 and later need administrator approval, a restart and Reduced Security boot mode, and Apple recommends solutions that do not extend the kernel. Management happens through MDM payloads for system and kernel extensions. Enterprise baselines are in the macOS Security Guide for Enterprises.
- Windows: a stable documented API above an internal native layer, a rich built-in event log, and kernel driver signing requirements. Memory integrity (HVCI) uses the hypervisor to protect kernel code integrity, and the Microsoft vulnerable driver blocklist is on by default from the Windows 11 2022 update, with blocks taking effect for running drivers after a reboot.
Where identity fits
The kernel does not know people, only security identities. Service accounts, daemons and scheduled tasks are non-human identities whose tokens and UIDs often carry high integrity or broad capabilities, and an attacker who steals one inherits every kernel permission it holds. Treat local service identities, the SYSTEM and root contexts your agents run in, and any account allowed to load drivers or eBPF programs as privileged. See the Service Account Security Guide and the Endpoint Privilege Management Guide.
Detection and measurement
- Collect at the boundary: process creation with full command line and parent, cross-process access, driver, module and eBPF loads, and image loads from user-writable paths.
- Watch the watchers: alert on agent service stops, ETW session or provider changes, Endpoint Security client failures and audit rule changes.
- Metrics: percentage of endpoints sending process creation events with command lines; percentage of Windows devices with memory integrity and the driver blocklist enforced; count of unsigned or unapproved kernel modules and drivers; mean time from agent tamper event to analyst triage; percentage of Linux hosts where only approved processes hold CAP_BPF or CAP_SYS_MODULE.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | DE.CM-09, PR.PS-01 | Monitoring runtime environments; configuration management of OS settings |
| NIST SP 800-53 Rev 5 | AC-6, AU-12, CM-7, CM-14, SI-4, SI-16 | Least privilege, audit record generation, least functionality, signed components, system monitoring, memory protection |
| MITRE ATT&CK v20 | T1003.001, T1014, T1055, T1068, T1106, T1547.006, T1685 | Techniques that act on the kernel, process and system call boundaries described here |
| MITRE D3FEND | D3-KBPI, D3-OSM | Kernel-based process isolation and operating system monitoring; see D3-OSM Operating System Monitoring |
Common failure patterns
- Reading API names as ground truth: assuming a Win32 call is the only path, when the native layer or direct system calls produce the same effect without the documented function.
- Collecting process events without parents or command lines: the record says a shell started but not why or by whom, which makes triage guesswork.
- Allowing any administrator to load kernel code: no driver blocklist, no module signing, and CAP_SYS_ADMIN granted to containers or tools that do not need it.
- Trusting a silent agent: no alert when the sensor, ETW session or audit rules stop, so a kernel-level attacker removes visibility unnoticed.
- Treating macOS and Linux as afterthoughts: rich Windows telemetry and nothing equivalent from Endpoint Security clients or eBPF and auditd on servers.
Practitioner checklist
- Learn to read a process tree: parent, child, command line, user and integrity level or UID.
- Map each detection you own to the system call or kernel event that produces it, per OS.
- Confirm process creation, cross-process access and driver or module load events reach the SIEM from all three OS families.
- Enforce memory integrity and the Microsoft vulnerable driver blocklist on Windows, testing in audit mode first.
- Restrict kernel module and eBPF loading on Linux to approved processes and audit the bpf and init_module calls.
- Approve macOS system extensions centrally through MDM and avoid kernel extensions where an alternative exists.
- Alert on security agent stops, telemetry gaps and audit configuration changes.
- Inventory service accounts and daemons that run as root, SYSTEM or with broad capabilities, and reduce them.
Standards and references
- Microsoft Learn: User mode and kernel mode
- Linux man-pages: syscalls(2), Linux system calls
- Linux man-pages: capabilities(7)
- Apple Developer: Endpoint Security
- Apple Platform Deployment: System and kernel extensions in macOS
- Microsoft Learn: About Event Tracing
- Microsoft Learn: Mandatory Integrity Control
- eBPF.io: What is eBPF?
Related NHI Mgmt Group resources: EDR Guide · Kernel-Mode vs User-Mode EDR · eBPF Security Guide · Networking Fundamentals for Defenders Guide