[New Rules] False Negatives for New BPFDoor Variants#5939
[New Rules] False Negatives for New BPFDoor Variants#5939
Conversation
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
…astic/detection-rules into bpf-door-fn-permission-change
|
⛔️ Test failed Results
|
There was a problem hiding this comment.
Pull request overview
This PR adds two new Linux detection rules intended to address observed false negatives in BPFDoor-related activity by expanding coverage for (1) shell history clearing via environment variables and (2) suspicious file creation in shared writable locations using a new_terms approach to reduce noise.
Changes:
- Added a Linux EQL rule to detect shell history suppression via
HIST*environment variables. - Added a Linux KQL
new_termsrule to detect file creation in shared writable/runtime paths by unusual processes and executables.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| rules/linux/defense_evasion_shell_history_clearing_via_environment_variables.toml | New EQL rule for detecting shell history clearing via environment-variable manipulation. |
| rules/linux/defense_evasion_file_creation_world_writeable_dir_by_unusual_process.toml | New KQL new_terms rule for suspicious file creation in shared writable/runtime directories by unusual processes. |
| query = ''' | ||
| process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and | ||
| process.env_vars like~ ( | ||
| "HISTSIZE=0", "HISTFILESIZE=0", "HISTCONTROL=ignorespace", "HISTFILE=/dev/null" |
There was a problem hiding this comment.
| "HISTSIZE=0", "HISTFILESIZE=0", "HISTCONTROL=ignorespace", "HISTFILE=/dev/null" | |
| "HISTSIZE=0", "HISTFILESIZE=0", "HISTCONTROL=ignorespace", "HISTCONTROL=ignoreboth", "HISTFILE=/dev/null" |
I think we should add ignoreboth as well.
Ref: https://www.geeksforgeeks.org/linux-unix/histcontrol-command-in-linux-with-examples/
There was a problem hiding this comment.
ignoreboth is commonly used, so it might be okay for DR, but for ER its too restrictive (based on telemetry)
Summary
Adding coverage for BPFDoor false negatives as per detonations and references in:
The rules were checked across telemetry and are performing well, especially when accounting for the additional noise reduction via the new_terms rule type.
Shell History Clearing via Environment Variables
This rule detects the clearing of the shell history via environment variables. Attackers may clear the shell history to hide their activities from being tracked. By leveraging environment variables such as HISTSIZE, HISTFILESIZE, HISTCONTROL, and HISTFILE, attackers can clear the shell history by setting them to 0, ignoring spaces, or redirecting the history to /dev/null, effectively erasing the command history.
File Creation in World-Writable Directory by Unusual Process
This rule detects the creation of files in world-writable directories by an unusual process. Attackers may attempt to hide their activities by creating files in world-writable directories, which are commonly used for temporary file storage. This behavior is often associated with lateral movement and can be an indicator of an attacker attempting to move laterally within a network.
1k+ TPs in detonate last 90d, and limited FPs in telemetry: