RHEL Family
Detection rules for RHEL Family data sources. Each rule includes its MITRE ATT&CK mapping, impact rating, and a description of what it detects. These rules analyze events with the data type linux, which the Linux Agent integration sends.
This category contains 10 detection rules.
| Rule | Category | Technique | Impact (C/I/A) |
|---|---|---|---|
| Container Platform Security Attacks | Privilege Escalation | T1611 - Escape to Host | C:3 / I:3 / A:2 |
| Critical SELinux Policy Violation | Privilege Escalation | T1068 - Exploitation for Privilege Escalation | C:3 / I:3 / A:2 |
| OpenShift Security Violations | Credential Access | T1552.007 - Unsecured Credentials: Container API | C:3 / I:3 / A:2 |
| RHEL Boot Loader Attack Detection | Defense Evasion, Persistence | T1542.003 - Pre-OS Boot: Bootkit | C:2 / I:3 / A:2 |
| RHEL Secure Boot Violation Detection | Defense Evasion | T1553.006 - Subvert Trust Controls: Code Signing Policy Modification | C:2 / I:3 / A:2 |
| RHEL-Specific Kernel Exploitation Attempt | Privilege Escalation | Exploitation for Privilege Escalation | C:3 / I:3 / A:3 |
| RHEL-Specific Malware Detection | Defense Evasion, Privilege Escalation | T1055 - Process Injection | C:3 / I:3 / A:2 |
| RPM Database Tampering Detection | Defense Evasion | T1070 - Indicator Removal | C:2 / I:3 / A:2 |
| SystemD Unit File Attack Detected | Persistence, Privilege Escalation | T1543.002 - Create or Modify System Process: Systemd Service | C:2 / I:3 / A:2 |
| YUM/DNF Repository Manipulation Attack | Initial Access | T1195.001 - Supply Chain Compromise: Compromise Software Dependencies and Development Tools | C:3 / I:3 / A:2 |
Rule Example
Below is an example of a rule definition for Container Platform Security Attacks (view in repository):
# Rule version v1.0.1
dataTypes:
- linux
name: Container Platform Security Attacks
impact:
confidentiality: 3
integrity: 3
availability: 2
category: Privilege Escalation
technique: "T1611 - Escape to Host"
adversary: origin
references:
- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/building_running_and_managing_containers/index
- https://attack.mitre.org/techniques/T1611/
description: |
Detects attacks against container platforms including Docker, Podman, and CRI-O such as container escape attempts, privilege escalation, unauthorized image pulls, and runtime manipulation. This rule identifies suspicious container activities that may indicate an adversary attempting to break out of container isolation or manipulate container runtime environments.
Next Steps:
1. Investigate the affected container and host system for signs of compromise
2. Review container logs and runtime configurations for unauthorized changes
3. Check for unusual process execution or file system modifications
4. Verify container image integrity and scan for malicious content
5. Review security policies for containers (seccomp, AppArmor, SELinux)
6. Consider isolating the affected container and host system
7. Update container security policies and runtime configurations as needed
where: |
regexMatch("origin.command", "(docker|podman) (run|create|exec).*(--privileged|--pid=host|--net=host|/var/run/docker.sock|-v /:)") || (contains("origin.command", "nsenter") && contains("origin.command", "--target"))
deduplicateBy:
- dataSource
Rule Details
Container Platform Security Attacks
Detects attacks against container platforms including Docker, Podman, and CRI-O such as container escape attempts, privilege escalation, unauthorized image pulls, and runtime manipulation. This rule identifies suspicious container activities that may indicate an adversary attempting to break out of container isolation or manipulate container runtime environments.
Category: Privilege Escalation
Technique: T1611 - Escape to Host
Impact: C:3 / I:3 / A:2
Rule file: container_platform_attacks.yaml
Reference: https://attack.mitre.org/techniques/T1611/
Critical SELinux Policy Violation
Detects critical SELinux policy violations that may indicate privilege escalation attempts, unauthorized access, or malicious activity bypassing mandatory access controls. This rule identifies AVC denials for sensitive capabilities and SELinux security operations, attempts to access shadow files, modifications to critical system directories, unconfined processes accessing executables, SELinux management commands run from a confined domain, and SELinux being switched from enforcing to permissive mode.
AVC denials come from the agent's audit collector (log.avc). A denial with log.avc.permissive "1" was logged but not blocked. Mode changes come from the MAC_STATUS audit record (log.macstatus), from the journal's audit transport, or from sudo running setenforce.
Category: Privilege Escalation
Technique: T1068 - Exploitation for Privilege Escalation
Impact: C:3 / I:3 / A:2
Rule file: selinux_policy_violations.yaml
Reference: https://attack.mitre.org/techniques/T1068/
OpenShift Security Violations
Detects security violations in OpenShift Container Platform including unauthorized API access, RBAC violations, security context constraint breaches, and malicious pod deployments. These violations indicate potential security breaches or misconfigurations that could lead to unauthorized access or privilege escalation within the cluster.
The rule reads OpenShift and Kubernetes components that log to the journal (kubelet, kubenswrapper, hyperkube, CRI-O, and control planes that run as system services, such as k3s, RKE2 and MicroK8s). It matches authorization denials, security context constraint and Pod Security rejections, and admission webhook denials. Denials for node and control-plane identities (system:node:, system:kube-) are left out because they are routine while a cluster starts or reschedules.
Category: Credential Access
Technique: T1552.007 - Unsecured Credentials: Container API
Impact: C:3 / I:3 / A:2
Rule file: openshift_security_violations.yaml
Reference: https://docs.openshift.com/container-platform/latest/security/index.html
RHEL Boot Loader Attack Detection
Detects attempts to modify or tamper with the boot loader configuration, including unauthorized changes to GRUB files, boot parameters, or kernel modules that could indicate bootkit installation attempts.
Category: Defense Evasion, Persistence
Technique: T1542.003 - Pre-OS Boot: Bootkit
Impact: C:2 / I:3 / A:2
Rule file: boot_loader_attacks.yaml
RHEL Secure Boot Violation Detection
Detects violations of UEFI Secure Boot policy including unsigned kernel modules, tampering with MOK (Machine Owner Key) database, attempts to disable Secure Boot, or loading of unauthorized boot components. This indicates potential compromise of the boot chain integrity or attempts to bypass security controls.
The rule reads the kernel's module signature and lockdown messages from the journal, module loads that the audit collector saw fail with a key or signature error, and mokutil commands that change the MOK database or disable shim validation. Read-only mokutil commands such as --sb-state and --test-key do not match.
Category: Defense Evasion
Technique: T1553.006 - Subvert Trust Controls: Code Signing Policy Modification
Impact: C:2 / I:3 / A:2
Rule file: secure_boot_violations.yaml
RHEL-Specific Kernel Exploitation Attempt
Detects kernel-transport journald lines matching real dmesg/kernel-log crash and SELinux-denial patterns
(segfault with an instruction/stack pointer, "kernel BUG", "Oops", KASLR-bypass-related messages, or an AVC
denial line), which can indicate exploitation attempts against a kernel vulnerability.
Rewritten v2.0.0: the previous version gated on log.facility/log.process, neither of which this filter populates
for kernel messages -- the real, populated field for "this journal line came from the kernel ring buffer" is
log.TRANSPORT == "kernel" (journald's _TRANSPORT field). It also matched literal phrases the kernel never prints
verbatim ("kernel exploit", "privilege escalation", "CVE-...exploit") -- dropped as fictional. The afterEvents
correlation referenced log.facility too; fixed to log.TRANSPORT.
Category: Privilege Escalation
Technique: Exploitation for Privilege Escalation
Impact: C:3 / I:3 / A:3
Rule file: rhel_kernel_exploits.yaml
Reference: https://access.redhat.com/security/vulnerabilities
Reference: https://attack.mitre.org/techniques/T1068/
RHEL-Specific Malware Detection
Detects indicators of malware specifically targeting RHEL systems including known rootkits, suspicious kernel modules, process injection attempts, and malicious RPM packages or scripts exploiting RHEL-specific vulnerabilities.
Category: Defense Evasion, Privilege Escalation
Technique: T1055 - Process Injection
Impact: C:3 / I:3 / A:2
Rule file: rhel_specific_malware.yaml
Reference: https://attack.mitre.org/techniques/T1055/
RPM Database Tampering Detection
Detects potential tampering with the RPM database which could indicate an attacker attempting to hide malicious package installations or system modifications. This includes unauthorized access to RPM database files, non-privileged users attempting to rebuild the database, or corruption indicators in RPM logs.
File activity comes from the agent's audit collector and needs an audit watch on /var/lib/rpm: a file in the database directory created, deleted, renamed or truncated by a process that is not a package manager. Rebuild attempts come from audited rpm commands, and corruption reports from the journal.
Category: Defense Evasion
Technique: T1070 - Indicator Removal
Impact: C:2 / I:3 / A:2
Rule file: rpm_database_tampering.yaml
Reference: https://attack.mitre.org/techniques/T1070/
Reference: https://access.redhat.com/articles/3763
SystemD Unit File Attack Detected
Detects malicious SystemD unit file creation or modification attempts, including privilege escalation through invalid usernames, suspicious service directives, or attempts to create persistent backdoors through systemd generators or malicious service configurations.
Category: Persistence, Privilege Escalation
Technique: T1543.002 - Create or Modify System Process: Systemd Service
Impact: C:2 / I:3 / A:2
Rule file: systemd_unit_file_attacks.yaml
Reference: https://www.linuxjournal.com/content/systemd-service-strengthening
YUM/DNF Repository Manipulation Attack
Detects potential attacks on YUM/DNF repositories including unauthorized repository additions, GPG key modifications, or suspicious package installations that could indicate supply chain compromise. This rule identifies attempts to manipulate package management systems to install malicious software or bypass security controls.
The rule reads signature failures and successful key imports that dnf, yum or PackageKit write to the journal, and package-manager commands, from the audit collector or from sudo, that disable signature checks, add a repository or import a signing key.
Category: Initial Access
Technique: T1195.001 - Supply Chain Compromise: Compromise Software Dependencies and Development Tools
Impact: C:3 / I:3 / A:2
Rule file: yum_dnf_repository_attacks.yaml