Incident Detection and Triage · Topic 4 of 6

Using AI to Generate SIEM Rules

Learn how SOC teams use generative AI to draft SIEM detection rules, the risks involved, and how to validate and test AI drafts before use for CSA 312-39.

  • 5 min
In a nutshell
  • AI speeds up drafting, translating and explaining rules, but its output is a draft.
  • Hallucinated fields and event IDs are the most common failure.
  • Every AI draft goes through the normal use case lifecycle: review, test, tune, document.

What it is

Writing detection rules takes skill and time. Analysts must know the attack, the log fields and the rule language of their SIEM. Generative AI, through large language models (LLMs), can draft a rule from a plain language request such as "alert when the Security log is cleared on any server."

The AI produces a draft, not a finished control. A detection engineer must review, test and tune it before it goes into production.

Analyst requestplain languageAI assistantdraft ruleHuman reviewlogic and fieldsTestsimulate and replayTune and deploy

How it works

Where AI helps

TaskHow AI helps
Drafting rulesTurns a described behavior into rule logic in a SIEM's language or a vendor neutral format such as Sigma
Translating rulesConverts a rule from one SIEM's language to another during migration
Explaining rulesDescribes in plain words what an existing rule detects
Mapping to frameworksSuggests the MITRE ATT&CK technique a rule covers
Suggesting tuningProposes exclusions after seeing false positive examples
Coverage ideasLists behaviors for a technique that the SOC does not yet detect

Many SIEM and XDR products now include an AI assistant for these tasks. General purpose LLMs can also be used, subject to company policy on data sharing.

Sigma as a common target

Sigma is an open, vendor neutral format for writing detection rules in YAML. A Sigma rule can be converted to many SIEM query languages, so it is a useful format for an AI to draft in. Here is a minimal valid Sigma rule for a cleared Security log:

title: Security Event Log Cleared
status: experimental
description: Detects clearing of the Windows Security event log
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 1102
  condition: selection
level: high

The parts are: what logs to look at (logsource), what to match (detection), when to fire (condition), and how serious it is (level).

Risks of AI generated rules

RiskWhat can go wrong
HallucinationThe model invents a field name, event ID or function that does not exist, so the rule never matches
Wrong logicConditions joined with the wrong operator, causing the rule to fire on everything or nothing
Environment mismatchField names differ from how the SOC's SIEM actually parses its logs
Too broadGeneric logic floods analysts with false positives
Too narrowLogic tied to one sample misses variants of the same behavior
Data exposurePasting real logs with usernames, addresses or secrets into an external AI service
Over trustAnalysts deploy without testing because the output "looks right"

Validating an AI draft

  1. Read the logic. Confirm each condition matches the intended behavior.
  2. Check fields and IDs. Verify every field name against the SIEM's actual schema and every event ID against official documentation.
  3. Test positive cases. Replay or safely simulate the attack and confirm the rule fires.
  4. Test negative cases. Run it against normal historical data and count false positives.
  5. Tune. Add thresholds, grouping and exclusions.
  6. Document and own. Record the objective, ATT&CK mapping, author, reviewer and review date, as with any use case.
AI draftField checkmatches SIEM schemaAttack replayrule firesNormal datafew false positivesProduction

A worked example

An analyst asks an AI assistant for a rule that detects new services installed on servers. The draft looks for event 4697 in the System log.

The reviewer checks the documentation. Event 7045 is the service install event in the System log, while 4697 is a Security log event that only appears when its audit setting is on. The reviewer fixes the log source, confirms the SOC collects the needed log, replays a test service install, and only then promotes the rule.

How the exam asks about this

  • "What is the main risk of deploying an AI generated SIEM rule without review?" → It may contain invented fields or wrong logic and fail to detect, or flood the SOC with false positives.
  • "Which vendor neutral rule format is commonly used to share detections across SIEMs?" → Sigma.
  • "Before using a public AI service to draft a rule from sample logs, what should the analyst do?" → Remove or mask sensitive data and follow the organization's AI use policy.

What to remember for the exam

  • AI speeds up drafting, translating and explaining rules, but its output is a draft.
  • Hallucinated fields and event IDs are the most common failure.
  • Every AI draft goes through the normal use case lifecycle: review, test, tune, document.
  • Test both that the rule fires on the attack and that it stays quiet on normal data.
  • Do not paste sensitive logs into external AI tools without approval and masking.
Watch out

A rule that never fires is worse than no rule, because the SOC believes it has coverage. Always prove an AI draft detects the behavior before relying on it.

Common mistakes

Trusting syntax as proof of correctness. A rule can be perfectly valid and still match nothing because the field names are wrong for that SIEM.

Skipping negative testing. Without testing against normal data, a broad AI draft can produce hundreds of false positives on day one.

Leaving no human owner. AI does not maintain the rule. Someone must own tuning and review like any other use case.

Check yourself

  • What is a hallucination in an AI generated SIEM rule?

    The AI invents something that does not exist, such as a field name, event ID or function, so the rule is wrong.

  • Why is Sigma useful when drafting rules with AI?

    It is an open, vendor neutral YAML format that can be converted to many SIEM query languages.

  • What two kinds of test should an AI draft pass?

    It must fire when the target behavior is simulated, and stay quiet on normal historical data.

Topic 4 of 6 in Incident Detection and Triage

Test yourself on Incident Detection and Triage

The full EC-Council 312-39 question bank has 700 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by EC-Council. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.