-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rule docs for 8.3 rule changes (#2083)
* updating pre-existing pre-built detection rule security docs with newly generated * updating generate file dictionary reference Co-authored-by: Janeen Mikell-Straughn <[email protected]>
- Loading branch information
1 parent
81013e9
commit 6edadae
Showing
209 changed files
with
136,677 additions
and
2,348 deletions.
There are no files selected for viewing
This file contains 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
402 changes: 199 additions & 203 deletions
402
docs/detections/prebuilt-rules/prebuilt-rules-reference.asciidoc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
91 changes: 91 additions & 0 deletions
91
...s/prebuilt-rules/rule-details/abnormal-process-id-or-lock-file-created.asciidoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
[[abnormal-process-id-or-lock-file-created]] | ||
=== Abnormal Process ID or Lock File Created | ||
|
||
Identifies the creation of a Process ID (PID), lock or reboot file created in temporary file storage paradigm (tmpfs) directory /var/run. On Linux, the PID files typically hold the process ID to track previous copies running and manage other tasks. Certain Linux malware use the /var/run directory for holding data, executables and other tasks, disguising itself or these files as legitimate PID files. | ||
|
||
*Rule type*: eql | ||
|
||
*Rule indices*: | ||
|
||
* logs-endpoint.events.* | ||
|
||
*Severity*: medium | ||
|
||
*Risk score*: 43 | ||
|
||
*Runs every*: 5 minutes | ||
|
||
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>) | ||
|
||
*Maximum alerts per execution*: 100 | ||
|
||
*References*: | ||
|
||
* https://www.sandflysecurity.com/blog/linux-file-masquerading-and-malicious-pids-sandfly-1-2-6-update/ | ||
* https://twitter.com/GossiTheDog/status/1522964028284411907 | ||
* https://exatrack.com/public/Tricephalic_Hellkeeper.pdf | ||
|
||
*Tags*: | ||
|
||
* Elastic | ||
* Host | ||
* Linux | ||
* Threat Detection | ||
* Execution | ||
* BPFDoor | ||
|
||
*Version*: 1 | ||
|
||
*Added ({stack} release)*: 8.3.0 | ||
|
||
*Rule authors*: Elastic | ||
|
||
*Rule license*: Elastic License v2 | ||
|
||
==== Potential false positives | ||
|
||
False-Positives (FP) can appear if the PID file is legitimate and holding a process ID as intended. To differentiate, if the PID file is an executable or larger than 10 bytes, it should be ruled suspicious. | ||
|
||
==== Investigation guide | ||
|
||
|
||
[source,markdown] | ||
---------------------------------- | ||
## Triage and analysis | ||
### Investigating Abnormal Process ID or Lock File Created | ||
Detection alerts from this rule indicate that an unusual PID file was created and could potentially have alternate purposes during an intrusion. Here are some possible avenues of investigation: | ||
- Run the following in Osquery to quickly identify unsual PID file size: "SELECT f.size, f.uid, f.type, f.path from file f WHERE path like '/var/run/%pid';" | ||
- Examine the history of this file creation and from which process it was created by using the "lsof" command. | ||
- Examine the contents of the PID file itself, simply by running the "cat" command to determine if the expected process ID integer exists and if not, the PID file is not legitimate. | ||
- Examine the reputation of the SHA256 hash from the PID file in a database like VirusTotal to identify additional pivots and artifacts for investigation. | ||
---------------------------------- | ||
|
||
|
||
==== Rule query | ||
|
||
|
||
[source,js] | ||
---------------------------------- | ||
/* add file size filters when data is available */ file where | ||
event.type == "creation" and user.id == "0" and file.path regex~ | ||
"""/var/run/\w+\.(pid|lock|reboot)""" and file.extension in | ||
("pid","lock","reboot") and /* handle common legitimate files */ | ||
not file.name in ( "auditd.pid", "python*", "apport.pid", | ||
"apport.lock", "kworker*", "gdm3.pid", "sshd.pid", | ||
"acpid.pid", "unattended-upgrades.lock", "unattended- | ||
upgrades.pid", "cmd.pid", "cron*.pid" ) | ||
---------------------------------- | ||
|
||
==== Threat mapping | ||
|
||
*Framework*: MITRE ATT&CK^TM^ | ||
|
||
* Tactic: | ||
** Name: Execution | ||
** ID: TA0002 | ||
** Reference URL: https://attack.mitre.org/tactics/TA0002/ | ||
* Technique: | ||
** Name: Native API | ||
** ID: T1106 | ||
** Reference URL: https://attack.mitre.org/techniques/T1106/ |
Oops, something went wrong.