[New Rules] Three Linux File-Related Web Server Rules - #6742
Conversation
|
⛔️ Test failed Results
|
There was a problem hiding this comment.
🟡 Changes recommended
The new rules include query/metadata inconsistencies that can cause incorrect matching or rule execution issues (notably EQL inline comment syntax and scope/description mismatches).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR migrates three Linux Elastic Defend (endpoint) file-event EQL detections focused on web-server-related suspicious file creation patterns into the detection-rules repo.
Changes:
- Adds a polyglot-bypass detection based on
file.Ext.header_bytesvs suspicious extensions. - Adds a high-entropy file detection based on
file.Ext.entropyfor web-server-created files. - Adds a suspicious double-extension filename detection for web-server-created files.
File summaries
| File | Description |
|---|---|
| rules/linux/persistence_webserver_file_polyglot_bypass.toml | New EQL rule for web-server-created files with suspicious extensions and mismatching magic bytes. |
| rules/linux/persistence_webserver_file_high_entropy.toml | New EQL rule for web-server-created high-entropy files with web-executable extensions. |
| rules/linux/persistence_webserver_file_double_dangerous_extension.toml | New EQL rule for web-server-created files with suspicious double extensions. |
Review details
Suppressed comments (3)
rules/linux/persistence_webserver_file_polyglot_bypass.toml:129
- Including "elf" in the monitored extensions makes this "polyglot/mismatch" rule also fire on normal ELF binaries named *.elf (where the extension matches the ELF header), which doesn’t align with the rule description.
"sh", "elf"
rules/linux/persistence_webserver_file_polyglot_bypass.toml:135
- The EQL query uses trailing
//comments inside the value list; this comment style isn’t used elsewhere in EQL rules here and may cause query parse failures. Consider removing them or converting to a supported block comment style.
file.Ext.header_bytes like (
"ffd8ff*", // JPEG / JPG
"89504e470d0a1a0a*", // PNG
"47494638*", // GIF (GIF87a / GIF89a)
"00000100*", // ICO
rules/linux/persistence_webserver_file_high_entropy.toml:130
- This rule is described as targeting web-executable extensions, but the extension list also includes generic executable/binary extensions ("sh", "elf", "bin"), which broadens scope beyond what the description says.
"psgi",
"lua", "luac",
"sh", "elf", "bin"
)
- Files reviewed: 3/3 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…py.toml Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
⛔️ Test failed Results
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
eric-forte-elastic
left a comment
There was a problem hiding this comment.
Looks good to me too 👍
|
⛔️ Test failed Results
|
Summary
Migrating three new rules that were functioning well in endpoint rules to detection rules, without exclusions.