Detection Engineering
The Detection Engineering view in the LME Dashboard is where you manage all your detection rules. LME supports three detection systems: Elastic/Kibana prebuilt rules, Sigma rules (converted and imported into Kibana), and ElastAlert2 custom rules. This page walks through exactly how to use each one.
Accessing Detection Engineering
- Open the dashboard at
https://<your-lme-server-ip>:8502 - Click the Detection Engineering tab in the navigation bar
The page has several sections stacked vertically, plus an AI assistant sidebar on the right.
Importing Elastic Prebuilt Detection Rules
Elastic provides hundreds of prebuilt detection rules that cover common attack techniques (MITRE ATT&CK mapped). These rules are built into Kibana and just need to be activated.
How to Import Prebuilt Rules
- In the Detection Engineering view, find the "Import Elastic Prebuilt Rules" section
- You will see a status line showing:
N installed — X available — Y updates - Click the "Import Elastic Prebuilt Rules" button (yellow)
- The button changes to "Importing... this may take a minute" with a spinner
- Wait for the import to complete (this can take 1-2 minutes on first import as hundreds of rules are installed)
- A result message appears: "N rules installed, N skipped, N failed"
- The status line updates to show the new counts
Prebuilt rules are installed disabled by default. After importing, you need to enable the rules you want active. See Enabling and Disabling Rules below.
Upgrading Prebuilt Rules
Elastic periodically updates their prebuilt rules. When updates are available:
- The status line will show a non-zero update count (e.g., "30 updates")
- Click the "Import" button again — it handles both fresh installs and upgrades
- Updated rules replace the old versions
When to Use Prebuilt Rules
- Best for: Getting detection coverage quickly with minimal effort
- Coverage: Covers Windows, Linux, and macOS attack techniques
- Examples: Suspicious PowerShell, credential dumping, lateral movement, persistence mechanisms
Managing Kibana Detection Rules
After importing rules (prebuilt or Sigma), they appear in the Kibana Detection Rules table.
Finding Rules
The table has several filters:
- Search box — type a rule name or keyword to filter (e.g., "powershell", "brute force")
- Enabled filter dropdown — show All, Enabled only, or Disabled only
- OS/Tag filter dropdown — filter by:
OS: Windows,OS: Linux,OS: macOS(Elastic prebuilt rules)Sigma Windows,Sigma Linux,Sigma macOS(imported Sigma rules)
The table shows columns: On/Off toggle, Rule Name (with description), Severity, Risk Score, and Status.
Click any column header to sort by that column.
Enabling and Disabling Kibana Rules
Enable/Disable a Single Rule
- Find the rule in the table
- Click the toggle switch next to the rule name
- The rule is instantly enabled or disabled — no page reload needed
Enable/Disable Rules in Bulk by Checkbox
- Check the checkbox next to each rule you want to change
- A toolbar appears showing "N selected"
- Click "Enable Selected" or "Disable Selected"
- All checked rules are updated at once
Enable/Disable All Rules for an OS
Above the table, you will see Bulk by OS buttons for each platform:
- OS: Windows — [Enable All] [Disable All]
- OS: Linux — [Enable All] [Disable All]
- OS: macOS — [Enable All] [Disable All]
- Sigma Windows — [Enable All] [Disable All]
- Sigma Linux — [Enable All] [Disable All]
- Sigma macOS — [Enable All] [Disable All]
- Click "Enable All" or "Disable All" next to the desired platform
- A confirmation dialog appears: "Enable ALL Windows rules?"
- Click OK to proceed
- All matching rules are updated (this may take a moment for large rule sets)
A good starting strategy: import all prebuilt rules, then enable only the platforms relevant to your environment (e.g., enable all Windows rules if you only monitor Windows endpoints).
Rule Pagination
The table shows 50 rules per page. Use the Prev and Next buttons at the bottom to navigate. A counter shows "Showing X-Y of Z".
Sigma Rules
Sigma is a generic, open-source signature format for SIEM systems. LME can download the entire SigmaHQ rule collection, convert the rules to Kibana-compatible format, and import them.
Download and Convert the Full SigmaHQ Collection
This downloads all Sigma rules from the SigmaHQ repository and converts them to Kibana NDJSON format.
- In the Detection Engineering view, find the "Sigma Rules" section
- Click the "Download & Convert Latest" button (purple)
- The button shows "Downloading & converting..." with a spinner
- Wait for the conversion to complete (this can take several minutes — it downloads all SigmaHQ rules, installs the sigma CLI tool, and converts thousands of rules)
- When complete, platform cards appear showing:
- Windows — number of converted rules, last conversion timestamp
- Linux — number of converted rules, last conversion timestamp
- macOS — number of converted rules, last conversion timestamp
Upload Converted Rules to Kibana
After conversion, each platform card has an "Upload to Kibana" button:
- Click "Upload to Kibana" on the platform you want (e.g., Windows)
- The button shows "Uploading..." with a spinner
- A result message appears: "windows: N rules imported (all disabled by default)"
- The imported rules now appear in the Kibana Detection Rules table with a "Sigma Windows" (or "Sigma Linux", "Sigma macOS") tag
All Sigma rules are imported disabled by default for safety. You must explicitly enable the rules you want. See Enabling and Disabling Rules.
Duplicate rules are not overwritten. If you re-import rules that already exist in Kibana, the duplicates will be skipped and reported as errors in the result.
Upload Individual Sigma YAML Files
If you have your own Sigma rules (or downloaded individual rules from SigmaHQ), you can convert and import them directly:
- Click the "Upload YAML" button (gray) in the Sigma section
- A file picker opens — select one or more
.ymlor.yamlSigma rule files - The button shows "Converting..."
- The dashboard:
- Detects the platform for each rule (from the
logsource.productfield) - Applies the correct conversion pipeline (
ecs_windowsfor Windows, generic for others) - Converts to NDJSON format and uploads to Kibana
- Detects the platform for each rule (from the
- A result message appears: "N rules imported from M YAML files (all disabled by default)"
Example Sigma YAML file:
title: Suspicious PowerShell Download
status: test
logsource:
product: windows
category: process_creation
detection:
selection:
CommandLine|contains:
- 'Invoke-WebRequest'
- 'wget'
- 'curl'
condition: selection
level: medium
Upload Pre-Converted NDJSON Files
If you already have Sigma rules in Kibana NDJSON format (e.g., from a previous conversion or a colleague):
- Click the "Upload NDJSON" button (gray)
- A file picker opens — select a
.ndjsonfile - The button shows "Uploading..."
- The rules are imported directly into Kibana
- A result message appears: "N rules imported from filename.ndjson (all disabled by default)"
How Sigma Conversion Works (Behind the Scenes)
The conversion pipeline:
- Downloads the latest
sigma_all_rules.zipfrom the SigmaHQ GitHub release - Extracts rules into
windows/,linux/,macos/directories - Installs
sigma-cliand theelasticsearchbackend plugin - Runs
sigma convertfor each platform:- Windows: target=lucene, pipeline=ecs_windows, format=siem_rule_ndjson
- Linux/macOS: target=lucene, no pipeline, format=siem_rule_ndjson
- Post-processes the output:
- Tags each rule with its platform (e.g., "Sigma Windows")
- Downgrades "informational" severity to "low" (Kibana does not support "informational")
- Sets all rules to
enabled: false
- Produces NDJSON files ready for Kibana import
ElastAlert2 Rules
ElastAlert2 is a separate alerting framework that runs custom detection rules against Elasticsearch data. Unlike Kibana rules, ElastAlert2 rules are YAML files stored on disk.
ElastAlert2 automatically picks up new or changed rules within 5 minutes.
Viewing Existing Rules
In the Detection Engineering view, the "ElastAlert2 Rules" section shows all current rules with:
- Rule name
- Filename (monospace)
- Rule type badge (frequency, any, flatline, etc.)
- Index pattern the rule queries
Click any rule row to expand it and see the full YAML content.
Creating a Rule by Pasting YAML
-
Click the "Paste YAML" button in the ElastAlert2 section
-
A dialog opens with a text area
-
Paste your ElastAlert2 rule YAML into the text area. Example:
name: Multiple Failed SSH Loginstype: frequencyindex: logs-*num_events: 10timeframe:minutes: 5filter:- query:query_string:query: "event.action:ssh_login AND event.outcome:failure"alert:- debug -
Optionally enter a filename in the text field below (e.g.,
ssh_brute_force.yml). If you leave this blank, the filename is auto-generated from the rule'snamefield. -
Click "Save Rule"
-
The dialog shows "Saved as ssh_brute_force.yml" in green, then closes automatically
-
The rule appears in the list
Validation: The YAML must:
- Be valid YAML syntax
- Parse as a mapping (key-value pairs, not a list or scalar)
- Have a
namefield if you do not provide a filename
Creating a Rule by Uploading a File
- Click the "Upload File" button (green) in the ElastAlert2 section
- A file picker opens — select one or more
.ymlor.yamlfiles - The button shows "Uploading..."
- Each file is validated and saved to
/opt/lme/config/elastalert2/rules/ - A result message shows: "Uploaded N rules" (with errors listed if any files were invalid)
- The rule list updates automatically
Deleting a Rule
- Find the rule in the list
- Click the trash icon on the right side of the rule row
- A confirmation dialog appears: "Delete rule 'filename'?"
- Click OK to confirm
- The rule is removed from disk and disappears from the list
ElastAlert2 Rule Examples
Frequency rule — alert when an event happens too many times:
name: Brute Force Login Attempts
type: frequency
index: logs-*
num_events: 20
timeframe:
minutes: 10
filter:
- query:
query_string:
query: "event.action:logon-failed"
alert:
- debug
Any rule — alert on every matching event:
name: New Service Installed
type: any
index: logs-*
filter:
- query:
query_string:
query: "event.code:7045"
alert:
- debug
Flatline rule — alert when events stop arriving (dead host detection):
name: No Logs from Critical Server
type: flatline
index: logs-*
threshold: 1
timeframe:
minutes: 30
filter:
- term:
host.name: "critical-server-01"
alert:
- debug
Using alert: [debug] writes alerts to the ElastAlert2 log. For production, configure email, Slack, or other alert destinations per the ElastAlert2 documentation.
KEV Overview (on Detection Engineering Page)
At the bottom of the Detection Engineering view, three stat cards show:
- Total KEVs — how many vulnerabilities are in the local CISA catalog copy
- CVEs Matched — how many KEV vulnerabilities were found on your hosts (highlighted orange if > 0)
- Overdue — how many matched KEVs are past the CISA remediation due date (highlighted red if > 0)
A link to the full CISA KEV catalog opens in a new tab.
For full KEV management, see KEV Integration.
Detection Assistant (AI Sidebar)
The right side of the Detection Engineering view has a dedicated Detection Assistant AI chat panel. It works identically to the Alerts AI chat (see Using the AI Chat) but has its own independent conversation history.
The Detection Assistant is pre-configured with context about detection engineering topics. Good questions to ask:
- "How do I write an ElastAlert2 rule that detects lateral movement?"
- "What Sigma rules cover ransomware behavior?"
- "How do I tune a noisy Kibana detection rule?"
- "What does Sysmon Event ID 10 detect?"
- "Write a Sigma rule for detecting PowerShell encoded commands"
Vulnerability Report Submission
At the bottom of the Detection Engineering page:
- Paste a vulnerability report into the text area
- Click "Submit Report"
- The report is submitted to the backend
This feature is currently a stub — reports are received but not processed further. It will be expanded in a future release.
Recommended Workflow for New LME Deployments
If you just installed LME and want to get detection rules running, follow these steps in order:
Step 1: Import Prebuilt Elastic Rules
- Go to Detection Engineering
- Click "Import Elastic Prebuilt Rules"
- Wait for the import to complete
Step 2: Enable Rules for Your Platforms
- In the Kibana Detection Rules table, use the Bulk by OS buttons
- Click "Enable All" next to the platforms in your environment:
- Have Windows endpoints? Enable OS: Windows
- Have Linux servers? Enable OS: Linux
Step 3: Add Sigma Rules for Broader Coverage
- Click "Download & Convert Latest" in the Sigma section
- After conversion, click "Upload to Kibana" for each platform
- Use the Bulk by OS buttons to enable Sigma rules selectively:
- Enable Sigma Windows for Windows coverage
- Enable Sigma Linux for Linux coverage
Step 4: Create Custom Rules for Your Environment
- Write ElastAlert2 rules for organization-specific detections (VPN anomalies, specific application alerts, etc.)
- Upload or paste them in the ElastAlert2 section
Step 5: Review Alerts
- Switch to the Alerts tab
- Monitor the Kibana Alerts and Wazuh Alerts tabs for matches
- Use the Analyze button to get AI explanations of any alert you do not understand