security-detection-rule-management
Create, tune, and manage Elastic Security detection rules (SIEM and Endpoint). Use for false positives, exceptions, new coverage, noisy rules, or rule management via Kibana API.
What this skill does
# Detection Rule Management Create new detection rules for emerging threats and coverage gaps, and tune existing rules to reduce false positives. All operations use the Kibana Detection Engine API via `rule-manager.js`. ## Execution rules - Start executing tools immediately — do not read SKILL.md, browse the workspace, or list files first. - Report tool output faithfully. Copy rule IDs, names, alert counts, exception IDs, and error messages exactly as returned by the API. Do not abbreviate rule UUIDs, invent rule names, or round alert counts. - When a tool returns an error (rule not found, API failure), report the exact error — do not guess at alternatives. ## Prerequisites Install dependencies before first use from the `skills/security` directory: ```bash cd skills/security && npm install ``` Set the required environment variables (or add them to a `.env` file in the workspace root): ```bash export ELASTICSEARCH_URL="https://your-cluster.es.cloud.example.com:443" export ELASTICSEARCH_API_KEY="your-api-key" export KIBANA_URL="https://your-cluster.kb.cloud.example.com:443" export KIBANA_API_KEY="your-kibana-api-key" ``` ## Common multi-step workflows | Task | Tools to call (in order) | | ----------------------------------- | ------------------------------------------------------------------------------------------------------- | | **Tune noisy SIEM rule** | `rule_manager` find/noisy-rules → `run_query` (investigate FPs) → `rule_manager` patch or add-exception | | **Add endpoint behavior exception** | `fetch_endpoint_rule` (get rule definition from GitHub) → `add_endpoint_exception` (scoped to rule.id) | | **Create new detection rule** | `run_query` (test query against data) → `rule_manager` create | | **Investigate rule alert volume** | `rule_manager` get → `run_query` (query alerts index) | For endpoint behavior rules, always fetch the rule definition first to understand query logic and existing exclusions before adding an exception. For SIEM rules, always investigate alert patterns with `run_query` before tuning. **Critical:** For endpoint behavior rules, always use `fetch_endpoint_rule` (not `shell` or direct script calls) to get the rule definition, then use `add_endpoint_exception` to add the exception. These are dedicated tools — do not invoke the underlying scripts manually. ## Workflow: Tune a rule for false positives ### Steps 1–2: Identify noisy rules and analyze false positives Find noisy rules with `noisy-rules` or `find`, then get the rule definition and investigate alerts: ```bash node skills/security/detection-rule-management/scripts/rule-manager.js noisy-rules --days 7 --top 20 node skills/security/detection-rule-management/scripts/rule-manager.js find --filter "alert.attributes.name:*Suspicious*" --brief node skills/security/detection-rule-management/scripts/rule-manager.js get --id <rule_uuid> node skills/security/alert-triage/scripts/run-query.js "kibana.alert.rule.name:\"<rule_name>\"" --index ".alerts-security.alerts-*" --days 7 --full ``` Look for patterns: same process/user/host → exception candidate; broad pattern → tighten query; legitimate software → exception; too broad → rewrite or adjust threshold. ### Step 3: Choose a tuning strategy **In order of preference:** 1. **Add exception** — Best for specific known-good processes, users, or hosts. Does not modify the rule query. Use when the rule is correct in general but fires on known-legitimate activity. 2. **Tighten the query** — Patch the rule's query to exclude the FP pattern. Best when the false positives stem from the query being too broad. 3. **Adjust threshold / alert suppression** — For threshold rules, increase the threshold value. For any rule type, enable alert suppression to reduce duplicate alerts on the same entity. 4. **Reduce risk score / severity** — Downgrade the rule's priority if it generates many low-value alerts but still has some detection value. 5. **Disable the rule** — Last resort. Only if the rule provides no value or is completely redundant with another rule. ### Steps 4–5: Apply tuning, verify, and document **Add exception** (single/multi-condition, wildcard via `matches`): ```bash node skills/security/detection-rule-management/scripts/rule-manager.js add-exception \ --rule-uuid <rule_uuid> \ --entries "process.executable:is:C:\\Program Files\\SCCM\\CcmExec.exe" "process.parent.name:is:CcmExec.exe" \ --name "Exclude SCCM" --comment "FP: SCCM deployment" --tags "tuning:fp" "source:soc" --yes ``` **Patch query, threshold, severity, or disable:** ```bash node skills/security/detection-rule-management/scripts/rule-manager.js patch --id <rule_uuid> --query "process.name:powershell.exe AND NOT process.parent.name:CcmExec.exe" --yes node skills/security/detection-rule-management/scripts/rule-manager.js patch --id <rule_uuid> --max-signals 50 --yes node skills/security/detection-rule-management/scripts/rule-manager.js patch --id <rule_uuid> --severity low --risk-score 21 --yes node skills/security/detection-rule-management/scripts/rule-manager.js disable --id <rule_uuid> --yes ``` Write operations (`patch`, `enable`, `disable`, `delete`, `add-exception`, `bulk-action`) prompt for confirmation by default. Pass `--yes` to skip the prompt (required when called by an agent). Verify with `rule-manager.js get --id <rule_uuid>`. Update triage cases via the `case-management` skill. --- ## Workflow: Create new detection rule ### Steps 1–2: Define the threat, data sources, and fields Specify MITRE ATT&CK technique(s), required data sources (Endpoint, Network, Cloud), and malicious vs legitimate behavior. Common indexes: `logs-endpoint.events.process-*`, `logs-endpoint.events.network-*`, `.alerts-security.alerts-*`, `logs-windows.*`, `logs-aws.*`. Key fields: `process.name`, `process.command_line`, `process.parent.name`, `destination.ip`, `winlog.event_id`, `event.action`. Verify data with `run-query.js`: ```bash node skills/security/alert-triage/scripts/run-query.js "process.name:certutil.exe" --index "logs-endpoint.events.process-*" --days 30 --size 5 ``` ### Step 3: Write and test the query Rule types: `query` (KQL field matching), `eql` (event sequences), `esql` (aggregations), `threshold` (volume-based), `threat_match` (IOC correlation), `new_terms` (first-seen). Test against Elasticsearch before creating: ```bash node skills/security/alert-triage/scripts/run-query.js "process.name:certutil.exe AND process.command_line:(*urlcache* OR *decode*)" \ --index "logs-endpoint.events.process-*" --days 30 ``` For EQL, use `--query-file` to avoid shell escaping issues. **Validate query syntax before creating or patching a rule.** The `validate-query` command catches common errors locally — escaped backslashes, mismatched parentheses, unbalanced quotes, and duplicate boolean operators: ```bash node skills/security/detection-rule-management/scripts/rule-manager.js validate-query \ --query "process.name:taskkill.exe AND process.command_line:(*chrome.exe* OR *msedge.exe*)" --language kuery ``` The `create` and `patch` commands also run validation automatically and reject invalid queries. Pass `--skip-validation` only if you are certain the query is correct despite triggering a check. Common KQL syntax mistakes: - **Escaped forward-slashes** — KQL wildcards use plain text. Write `*/IM chrome.exe*`, not `*\/IM chrome.exe*`. - **Mismatched parentheses** — every `(` must have a matching `)`. - **Unbalanced quotes** — every `"` must be paired. - **Duplicate operators** — `AND AND` or `OR OR` is always an error. ### Step 4: Create the rule ```bash node skills/security/detection-rule-management/scripts/rule-manager.js create \ --name "Certutil URL Download or Decode" \ --description "Dete
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.