Linux operating system internals for detection engineering — process model (fork/exec, /proc filesystem, namespaces), user/group/capability model, auditd subsystem and rule authoring, eBPF hook points and security tools (Falco, Tetragon), systemd service model, PAM authentication, SSH key management, common persistence locations, container isolation boundaries (namespaces, cgroups, seccomp), and the mapping between Linux operations and detection telemetry. Use when authoring detections targeting Linux endpoints, servers, or container workloads.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Linux operating system internals for detection engineering — process model (fork/exec, /proc filesystem, namespaces), user/group/capability model, auditd subsystem and rule authoring, eBPF hook points and security tools (Falco, Tetragon), systemd service model, PAM authentication, SSH key management, common persistence locations, container isolation boundaries (namespaces, cgroups, seccomp), and the mapping between Linux operations and detection telemetry. Use when authoring detections targeting Linux endpoints, servers, or container workloads.
Linux Internals — detection-relevant knowledge
This skill encodes how Linux works at the level needed to write detections for Linux endpoints, servers, and container workloads.
1. Process model
fork/exec
Parent process → fork() → child process (copy of parent)
→ execve() → new program loaded into child's address space
→ Program executes with inherited file descriptors, environment, UID/GID
Detection-relevant: Unlike Windows (single CreateProcess), Linux separates process creation (fork) from program loading (exec). A fork without exec creates a child running the same code as the parent — used in daemonisation and some evasion techniques.
/proc filesystem
/proc/<pid>/ exposes process information:
Path
Content
Detection use
/proc/<pid>/cmdline
Command line (null-separated)
Process command-line inspection
/proc/<pid>/exe
Symlink to executable
Verify actual binary (survives argv[0] spoofing)
/proc/<pid>/environ
Environment variables
Credential exposure, configuration
/proc/<pid>/fd/
Open file descriptors
Network connections, open files
/proc/<pid>/maps
Memory mappings
Injected libraries, memory-only payloads
/proc/<pid>/status
Process status (UID, GID, capabilities)
Privilege verification
/proc/<pid>/ns/
Namespace membership
Container escape detection
Key insight: argv[0] (process name) can be spoofed. /proc/<pid>/exe reveals the actual binary. Detections should verify the executable path, not just the displayed name.
2. User/group/capability model
Traditional model
Concept
Detail
Detection relevance
UID 0 (root)
Full system access
Any process running as UID 0 has unrestricted access
SUID bit
Executable runs as file owner (often root)
SUID binaries are privilege escalation targets. New SUID files are high-signal.
SGID bit
Executable runs with file group
Similar to SUID but for group privileges
Sticky bit
Only owner can delete files in directory
/tmp protection — removal is suspicious
Linux capabilities
Capabilities split root's power into discrete units. Key capabilities:
Capability
What it grants
Detection relevance
CAP_SYS_ADMIN
Broad admin operations (mount, namespace, etc.)
Near-equivalent to root. Container escape vector.
CAP_SYS_PTRACE
Trace/debug any process
Process injection, credential theft from memory
CAP_NET_RAW
Raw socket access
Network sniffing, packet injection
CAP_NET_ADMIN
Network configuration
Firewall modification, routing changes
CAP_DAC_OVERRIDE
Bypass file permission checks
Read any file regardless of permissions
CAP_SETUID / CAP_SETGID
Change UID/GID
Privilege escalation
CAP_SYS_MODULE
Load kernel modules
Rootkit installation
CAP_BPF
eBPF operations
Kernel-level monitoring or evasion
3. auditd
The Linux Audit Framework (auditd) is the primary native security telemetry source.
Key audit record types
Type
Description
Detection use
SYSCALL
System call with arguments
Process creation, file access, network operations
EXECVE
Program execution with full arguments
Command-line capture (equivalent to Windows 4688 + cmdline)
PATH
File path accessed
File access auditing
PROCTITLE
Process title (command line)
Backup command-line source
USER_AUTH
Authentication attempt
Login detection
USER_LOGIN
Login event
Session tracking
USER_CMD
Command executed via sudo
Privileged command auditing
ANOM_PROMISCUOUS
Network interface set to promiscuous mode
Network sniffing detection
ANOM_ABEND
Abnormal process termination
Crash/exploit detection
Critical audit rules
# Process execution
-a always,exit -F arch=b64 -S execve -k exec# File access to sensitive files
-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/sudoers -p wa -k privilege
# SSH key modifications
-w /root/.ssh/ -p wa -k ssh_keys
-w /home/ -p wa -k ssh_keys
# Kernel module loading
-a always,exit -F arch=b64 -S init_module -S finit_module -k modules
# Network connections
-a always,exit -F arch=b64 -S connect -k network
# Privilege escalation
-a always,exit -F arch=b64 -S setuid -S setgid -k privilege_escalation
# Cron modifications
-w /etc/crontab -p wa -k cron
-w /var/spool/cron/ -p wa -k cron
4. eBPF and security tools
eBPF hook points
eBPF programs attach to kernel hook points for security monitoring: