{% extends "base.html" %} {% import "_ui.html" as ui %} {% block title %}{{ r.report.title }}{% endblock %} {% block crumbs %}Runs{{ ui.icon("chevron-right", "sm") }}{{ r.report.title }}{% endblock %} {% block content %} {%- set ns = namespace(q_ok=0, q_all=0, st_pass=0, approved=0, ev_ok=0, ev_all=0) -%} {%- for p in r.packages -%} {%- set ns.q_ok = ns.q_ok + (p.queries|selectattr("query")|list|length) -%} {%- set ns.q_all = ns.q_all + (p.queries|length) -%} {%- if p.selftest == "pass" %}{% set ns.st_pass = ns.st_pass + 1 %}{% endif -%} {%- if p.review_status == "approved" %}{% set ns.approved = ns.approved + 1 %}{% endif -%} {%- endfor -%} {%- for b in r.behaviours -%} {%- set ns.ev_ok = ns.ev_ok + (b.evidence_verified|select|list|length) -%} {%- set ns.ev_all = ns.ev_all + (b.evidence|length) -%} {%- endfor -%} {%- set max_rank = (r.behaviours|map(attribute="rank_score")|max) if r.behaviours else 0 -%} {%- set n_rules = r.packages|length -%}

{{ r.report.title }}

{% if r.report.kind == "incident" %}{{ ui.icon("alert", "sm") }}internal incident {% else %}threat intel{% endif %} {% if r.report.tlp_effective %}{{ r.report.tlp_effective }}{% endif %} {% if r.report.url %}{{ ui.icon("link", "sm") }}{{ r.report.url.split('/')[2] if r.report.url.count('/') >= 2 else r.report.url }} {% else %}{{ ui.icon("file", "sm") }}{{ r.report.source }}{% endif %} {{ ui.icon("clock", "sm") }}{{ ui.short_date(r.created_at) }} {% if r.created_by %}{{ ui.icon("user", "sm") }}{{ r.created_by }}{% endif %}
{{ ui.copy_btn(r.run_id, "Copy run ID", "btn outline") }} {{ ui.icon("download", "sm") }}Download package {% if role == "admin" or user == r.created_by %}
{% endif %}
{{ ui.stat("Behaviours", r.behaviours|length, "list", hint=(ns.ev_ok ~ " of " ~ ns.ev_all ~ " evidence quotes verified") if ns.ev_all else "") }} {{ ui.stat("Rules", n_rules, "target", hint=(ns.st_pass ~ " of " ~ n_rules ~ " self-tests passed") if n_rules else "Pick behaviours below") }} {{ ui.stat("Approved", ns.approved, "check-circle", "ok" if n_rules and ns.approved == n_rules else "", sub=("of " ~ n_rules) if n_rules else "") }} {{ ui.stat("SIEM queries", ns.q_ok, "database", "warn" if ns.q_ok < ns.q_all else "", sub=("of " ~ ns.q_all) if ns.q_all else "", hint="converted across all rules" if ns.q_all else "") }} {% if r.usage.calls or r.usage.cached_calls %} {{ ui.stat("AI cost", ("not priced" if r.usage.unpriced_models and not r.usage.estimated_cost_usd else "$" ~ ("%.4f"|format(r.usage.estimated_cost_usd or 0))), "ai", hint=(r.usage.calls ~ " calls · " ~ ((r.usage.input_tokens + r.usage.output_tokens + r.usage.cache_read_tokens + r.usage.cache_write_tokens)|tok) ~ " tokens")) }} {% endif %}
{# ---------------------------------------------------------------- overview #}

{{ ui.icon("file") }}Overview

{% if r.analysis and r.analysis.summary %}

{{ r.analysis.summary }}

{% endif %} {% if r.warnings %}
{{ ui.icon("alert") }}
{{ r.warnings|length }} warning(s) from this run{{ ui.icon("chevron-right", "sm chev") }}
    {% for w in r.warnings %}
  • {{ w }}
  • {% endfor %}
{% endif %}
{% if r.analysis %}
Threat actors
{% if r.analysis.actors %}{% for a in r.analysis.actors %}{{ a }}{% endfor %}{% else %}—{% endif %}
Malware & tools
{% if r.analysis.malware_tools %}{% for a in r.analysis.malware_tools %}{{ a }}{% endfor %}{% else %}—{% endif %}
{% if r.analysis.victimology %}
Victimology
{{ r.analysis.victimology }}
{% endif %} {% endif %}
Source
{% if r.report.url %}{{ r.report.url }}{% else %}{{ r.report.source }}{% endif %} {% if r.report.authors or r.report.published %}
{{ r.report.authors }}{% if r.report.authors and r.report.published %} · {% endif %}{{ r.report.published }}
{% endif %}
SHA-256
{{ r.report.sha256 }}{{ ui.copy_btn(r.report.sha256, "", "btn ghost icon sm") }}
Run
{{ r.run_id }} · prompts {{ r.prompt_version }}{% if r.tool_version %} · ti2dac {{ r.tool_version }}{% endif %}
{% if r.report.redactions %}
Redacted
{% for k, n in r.report.redactions.items() %}{{ k }} × {{ n }}{% endfor %}
{% endif %} {% if r.usage.calls or r.usage.cached_calls %}
AI usage
{{ r.usage.calls }} calls ({{ r.usage.cached_calls }} served from cache, free) · in {{ "{:,}".format(r.usage.input_tokens) }} / out {{ "{:,}".format(r.usage.output_tokens) }} tokens {% if r.usage.cache_read_tokens %}· cache read {{ "{:,}".format(r.usage.cache_read_tokens) }}{% endif %} {% if r.usage.cache_write_tokens %}· cache write {{ "{:,}".format(r.usage.cache_write_tokens) }}{% endif %} · {% if r.usage.unpriced_models and not r.usage.estimated_cost_usd %}not priced{% else %}est. ${{ "%.4f"|format(r.usage.estimated_cost_usd or 0) }}{% endif %}{% if r.ai_provider %} · {{ r.ai_provider }}{% endif %} {% if r.usage.unpriced_models %}
No price known for {{ r.usage.unpriced_models|join(", ") }}: its tokens are not in the estimate (set ai.prices).
{% endif %} {% if r.usage.fallback_calls or r.usage.failover_calls or r.usage.schema_retries %}
{%- if r.usage.fallback_calls %}{{ r.usage.fallback_calls }} answered by the refusal-fallback model. {% endif %} {%- if r.usage.failover_calls %}{{ r.usage.failover_calls }} answered by the failover provider. {% endif %} {%- if r.usage.schema_retries %}{{ r.usage.schema_retries }} schema re-ask(s).{% endif %}
{% endif %}
{% endif %}
{% if r.usage.by_stage %}
{{ ui.icon("chevron-right", "sm chev") }}AI token usage by stage
{% for stage, u in r.usage.by_stage.items() %}{% endfor %}
StageModelCallsCachedInputOutputCache readCache writeEst. cost
{{ stage }}{{ u.model_price_key }}{{ u.calls }} {{ u.cached_calls }}{{ "{:,}".format(u.input_tokens) }}{{ "{:,}".format(u.output_tokens) }} {{ "{:,}".format(u.cache_read_tokens) }}{{ "{:,}".format(u.cache_write_tokens or 0) }} {{ "not priced" if u.model_price_key in r.usage.unpriced_models and not u.cost_usd else ("$%.4f"|format(u.cost_usd)) if u.cost_usd is defined else "–" }}
Total{{ r.usage.calls }}{{ r.usage.cached_calls }}{{ "{:,}".format(r.usage.input_tokens) }} {{ "{:,}".format(r.usage.output_tokens) }}{{ "{:,}".format(r.usage.cache_read_tokens) }}{{ "{:,}".format(r.usage.cache_write_tokens) }} {{ "not priced" if r.usage.unpriced_models and not r.usage.estimated_cost_usd else "$%.4f"|format(r.usage.estimated_cost_usd or 0) }}

Output tokens include the model's thinking. Analyse = 1 call per report; generate = 1 per rule; repair/translate only when needed. Cached calls cost nothing. Costs are priced at the model that actually answered.

{% endif %}
{# ---------------------------------------------------------------- AI review #}

{{ ui.icon("shield") }}AI review {{ ui.review_badge(review_state, review_running) }}

A second opinion on this run, checked against the report. Nothing changes until you accept a finding.

{% if review_changes %}
{{ ui.icon("alert") }}
Out of date
Changed since this review: {{ review_changes|join(", ") }}. Review again to check the new versions.
{% endif %} {% if review_running %}
{{ ui.icon("clock") }}
A review of this run is running. Reload the page when it has finished.
{% endif %} {% if review %}
{{ ui.icon("clock", "sm") }} {{ ui.short_date(review.created_at) }}{% if review.created_by %} · {{ review.created_by }}{% endif %} {% if review.provider %}{{ ui.icon("ai", "sm") }} {{ review.model }}{% if review.unpriced %} · not priced{% else %} · est. ${{ "%.4f"|format(review.cost_usd) }}{% endif %} {% else %}ti2dac checks only (no AI call){% endif %} {{ review.findings|length }} finding(s){% if review.discarded %} · {{ review.discarded|length }} discarded{% endif %}
{% if review.summary %}

{{ review.summary }}

{% endif %} {% if not review.findings %}{{ ui.empty("No mistakes found", "Neither the checks nor the reviewer found a problem with this run.", "check-circle") }}{% endif %}
{% for area, label in [("rule", "Rules"), ("query", "SIEM queries"), ("simulation", "Simulations"), ("ioc", "IOCs"), ("analysis", "Analysis")] %} {%- set fs = review.findings|selectattr("area", "equalto", area)|list -%} {% if fs %}
{{ label }} {{ fs|length }}
{% for f in fs %}{%- set slug = finding_rule.get(f.id) -%}
{{ ui.icon("chevron-right", "sm chev") }} {{ f.severity }} {{ f.target }}{% if f.siem %} · {{ f.siem }}{% endif %} {{ f.problem }} {% if f.status != "open" %}{{ ui.status(f.status, "ok" if f.status == "accepted" else "muted") }}{% endif %} {{ f.id }} · {{ "ti2dac" if f.source == "code" else "AI" }}
{{ categories.get(f.category, f.category) }}{% if slug %} · open {{ slug }}{% endif %}

{{ f.problem }}

{% if f.report_quote %}
{% if f.quote_verified %}{{ ui.icon("check", "sm") }} {% endif %}{{ f.report_quote }}
{% endif %} {% if f.suggested_fix %}
Suggested fix: {{ f.suggested_fix }}
{% endif %} {% if f.status == "open" %}
{% else %}
{{ f.status|capitalize }} by {{ f.decided_by or "-" }}{% if f.decided_at %} · {{ ui.short_date(f.decided_at) }}{% endif %} {% if f.note %} · {% if f.feedback_id and slug %}{{ f.note }}{% else %}{{ f.note }}{% endif %}{% endif %}
{% endif %}
{% endfor %}
{% endif %} {% endfor %}
{% if review.discarded %}
{{ ui.icon("chevron-right", "sm chev") }}{{ review.discarded|length }} AI finding(s) discarded: their quote is not in the report

A finding that rests on the report must quote it word for word. These quotes were not found, so the reviewer may have misread or invented them. They are kept here so nothing disappears unseen.

    {% for f in review.discarded %}
  • {{ f.target }}{% if f.siem %} · {{ f.siem }}{% endif %}: {{ f.problem }} {% if f.report_quote %}
    Quoted: {{ f.report_quote }}
    {% endif %}
    {{ f.note }}
  • {% endfor %}
{% endif %} {% else %} {{ ui.empty("Not reviewed yet", "Pick a reviewer below. A different model from the one that wrote the rules gives a more independent opinion.", "shield") }} {% endif %}
{{ ui.icon("chevron-right", "sm chev") }}How the review works
  • ti2dac's own checks run first and cost nothing. Then the model you pick reads the report (about {{ review_choices.tokens_in|tok }} input tokens) and this run's rules, simulations, test events and AI-translated queries.
  • A finding that rests on the report must quote it; findings whose quote is not in the report are discarded.
  • Accepting a rule, query or simulation finding opens feedback on that rule; accepting an analysis or IOC finding adds a run warning.
  • Decisions are kept: a finding raised again word for word keeps its decision, and dismissed findings are passed to the next review.
  • The default reviewer is the review stage on the AI page.
{# ---------------------------------------------------------------- behaviours #}

{{ ui.icon("list") }}Behaviours {{ r.behaviours|length }}

TTPs extracted from the report, ranked by how detectable, reproducible and low-noise they are. {% if ai_enabled %}Tick behaviours without a rule to generate more.{% else %}AI is off, so no new rules can be generated here.{% endif %}

{% if ai_enabled %}{% endif %} {% for b in r.behaviours %} {%- set pkg = (r.packages|selectattr("behaviour.id", "equalto", b.id)|list|first) -%} {%- set v = b.evidence_verified|select|list|length -%} {% if ai_enabled %}{% endif %} {% endfor %}
SelectIDBehaviourATT&CKRankRule
{% if not pkg %}{% endif %}{{ b.id }}
{{ b.name }}
{{ b.description }}
{% if b.evidence %}
{{ ui.icon("chevron-right", "sm chev") }}Evidence {{ v }}/{{ b.evidence|length }} verified
    {% for q in b.evidence %}
  • {% if b.evidence_verified[loop.index0] %}{{ ui.icon("check", "sm") }}{% else %}{{ ui.icon("x", "sm") }}{% endif %}{{ q }}
  • {% endfor %}
{% endif %}
{{ b.technique_id }}{{ ui.icon("external", "sm") }} {% if not b.attack_valid %}ATT&CK?{% elif b.attack_note %}note{% endif %}
{{ b.technique_name }}
{{ b.tactic }}
{{ b.rank_score }}
{% if pkg %}{{ ui.icon("target", "sm") }}{{ pkg.slug }}{% else %}—{% endif %}
{% if ai_enabled %}
0 behaviours selected
{% endif %}
{# ---------------------------------------------------------------- rules #} {% if not r.packages %}
{{ ui.empty("No rules yet", "Select behaviours above and generate rules for them." if ai_enabled else "Enable the AI to generate rules from these behaviours.", "target") }}
{% endif %} {% for p in r.packages %} {%- set fbs = feedback|selectattr("slug", "equalto", p.slug)|list -%} {%- set open_fb = fbs|selectattr("status", "equalto", "open")|list|length -%} {%- set trs = results|selectattr("slug", "equalto", p.slug)|list -%} {%- set q_ok = p.queries|selectattr("query")|list|length -%} {%- set ls = p.draft.sigma.logsource -%}
{{ ui.icon("target", "sm") }}{{ p.slug }} · v{{ p.version }}

{{ p.draft.sigma.title }}

{{ p.behaviour.technique_id }}{{ ui.icon("external", "sm") }} from{{ p.behaviour.id }} level{{ p.draft.sigma.level }}{% if p.draft.sigma.correlation %} · threshold{% endif %} logsource{{ ls.product }}/{{ ls.category or ls.service }} {% if p.repair_attempts %}{{ p.repair_attempts }} auto-repair(s){% endif %} {% if p.created_by %}{{ ui.icon("user", "sm") }}author {{ p.created_by }}{% endif %}
{{ ui.status(p.sigma_status, label="sigma") }} {{ ui.status(p.selftest, label="self-test") }} {{ ui.status(p.review_status, label="review") }}
{% if p.selftest == "fail" or p.sim_blocked %}
{{ ui.icon("x") }}
Needs attention before deployment
    {% if p.selftest == "fail" %}{% for d in p.selftest_details %}
  • self-test: {{ d }}
  • {% endfor %}{% endif %} {% if p.sim_blocked %}
  • simulation blocked by safety linter
  • {% endif %}
{% endif %} {% if p.quality_warnings or p.similar_rules %}
{% if p.quality_warnings %}
{{ ui.icon("alert", "sm") }}{{ p.quality_warnings|length }} quality warning{{ "s" if p.quality_warnings|length > 1 }}{{ ui.icon("chevron-right", "sm chev") }}
    {% for w in p.quality_warnings %}
  • {{ w }}
  • {% endfor %}
{% endif %} {% if p.similar_rules %}
{{ ui.icon("duplicate", "sm") }}{{ p.similar_rules|length }} possible duplicate{{ "s" if p.similar_rules|length > 1 }}{{ ui.icon("chevron-right", "sm chev") }}
    {% for x in p.similar_rules %}
  • {{ x }}
  • {% endfor %}
{% endif %}
{% endif %} {% if notice and notice.slug == p.slug %}
{% if notice.status == "applied" %}
{{ ui.icon("check-circle") }}
Feedback #{{ notice.id }} applied: {{ notice.resolution }}
The new version is a draft. Someone other than you has to review and approve it.{% if notice.comment %} Your comment is now a lesson for future rules.{% endif %}
{% elif (notice.resolution or "").startswith("correction rejected") %}
{{ ui.icon("x") }}
Your corrected rule was not applied
{{ notice.resolution }}
Feedback #{{ notice.id }} is saved and still open. Fix the YAML and submit again, or close it in the Feedback tab.
{% else %}
{{ ui.icon("feedback") }}
Feedback #{{ notice.id }} saved
It stays open until someone fixes it{% if ai_enabled and notice.artifact in ('sigma_rule','query','telemetry','attack_mapping') %} (for example with "Fix with AI" in the Feedback tab){% endif %} or closes it.
{% endif %}
{% endif %}
{% if p.field_mappings %}{% endif %}
{{ rule_filename(p) }} {{ ui.icon("external", "sm") }}Raw {{ ui.copy_btn() }}
{{ p.rule_yaml }}
{% if p.sigma_issues %}
{{ ui.icon("alert") }}
Validator notes
    {% for i in p.sigma_issues %}
  • {{ i }}
  • {% endfor %}
{% endif %} {% if p.history %}

{{ ui.icon("history", "sm") }} Previous versions: {% for h in p.history %}v{{ h.version }} ({{ h.replaced_at }}: {{ h.reason }}){% if not loop.last %}, {% endif %}{% endfor %}

{% endif %}
{% for q in p.queries %}{% set st = status[p.slug][q.target] if not q.client else 'not-tested' %} {% endfor %}
converted testedfailed
{% for q in p.queries %}{% set st = status[p.slug][q.target] if not q.client else 'not-tested' %}
{% if q.client %}{{ q.client }} · {% endif %}{{ q.label }} {{ ui.status(st) }} {% if q.method == "llm" %}AI-translated (unverified) {% elif q.method == "template" %}ti2dac template{% endif %} {% if q.query %}{{ ui.copy_btn() }}{% endif %}
{% if q.query %}
{{ q.query }}
{% elif st == "not-available" %}
{{ ui.icon("info") }}
Not available for this SIEM
{% set alts = p.queries|selectattr("language", "equalto", q.language)|selectattr("query")|selectattr("client", "equalto", q.client)|map(attribute="label")|list %}
This SIEM's data source does not record a field the rule needs.{% if alts %} Use instead: {{ alts|join(", ") }}.{% else %} No other {{ q.language }} target covers this rule.{% endif %}
{{ q.error }}
{% else %}
{{ ui.icon("x") }}
Conversion failed
{{ q.error }}
{% endif %}
{% if q.notes %}

{{ q.notes }}

{% endif %}
{% endfor %}
{% if p.field_mappings %}

How each Sigma field is named in each SIEM. Red cells are not supported by that backend.

{% for cl in p.field_mappings|map(attribute="client")|unique %} {% set tids = p.queries|selectattr("client", "equalto", cl)|rejectattr("method", "equalto", "llm")|map(attribute="target")|list %} {% if cl %}

Client {{ cl }} (its profile's field names)

{% endif %}
{% for t in tids %}{% endfor %}{% for fm in p.field_mappings if fm.client == cl %} {% for t in tids %}{% set v = fm.targets.get(t, "") %} {% if v.startswith('UNSUPPORTED') %}{% else %}{% endif %} {% endfor %}{% endfor %}
Sigma field{{ t }}
{{ fm.sigma_field }}unsupported{{ v }}
{% endfor %}
{% endif %}
{{ ui.icon("shield") }}
Run only in an isolated lab. ti2dac generates and lints these scripts; it never executes them.
{% if sim_readme.get(p.slug) %}
{{ sim_readme.get(p.slug, "")|md }}
{% endif %}
{{ ui.code(p.draft.simulation.simulate if not p.sim_blocked else "(blocked — see linter findings above)", "simulate", not p.sim_blocked) }} {{ ui.code(p.draft.simulation.cleanup if not p.sim_blocked else "(blocked)", "cleanup", not p.sim_blocked) }}
{% if ads.get(p.slug) %}
{{ ads.get(p.slug, "")|md }}
{% else %}{{ ui.empty("No triage guide", "The Alerting & Detection Strategy document was not generated for this rule.", "book") }}{% endif %}

Report a mistake or give feedback

Saved against v{{ p.version }}. Paste a corrected rule to create v{{ p.version + 1 }} now, or leave it open and fix it later{% if ai_enabled %} (by hand or with AI){% endif %}. When a fix is applied, your comment becomes a lesson for future rules with the same technique or log source. How feedback works

{{ ui.icon("chevron-right", "sm chev") }}Paste a corrected Sigma rule (optional, becomes v{{ p.version + 1 }} after validation)
{% if fbs %}
{% for f in fbs %}{% endfor %}
#StatusFeedbackActions
{{ f.id }} {{ ui.status(f.status) }}
{{ f.severity }}{{ f.artifact }} / {{ categories.get(f.category, f.category) }}{% if f.target %} · {{ f.target }}{% endif %}
{{ f.comment }}
{% if f.resolution %}
{{ ui.icon("check", "sm") }} {{ f.resolution }}
{% endif %}
{{ f.reviewer }} · {{ ui.short_date(f.created_at) }}
{% if f.status == 'open' %}
{% if ai_enabled and f.artifact in ('sigma_rule','query','telemetry','attack_mapping') %}
{% endif %}
{% endif %}
{% endif %}

Record test result / alert disposition

Lab runs of the simulation, negative tests on normal activity, or production alert outcomes.

{% if trs %}
{% for t in trs %}{% endfor %}
WhenVerTargetResultFPEvidenceBy
{{ ui.short_date(t.created_at) }}v{{ t.rule_version }}{{ t.target }} {{ ui.status(t.result) }}{{ t.fp_count }}{{ t.evidence }}{% if t.environment %}
{{ t.environment }}
{% endif %}
{{ t.tester }}
{% endif %}
Review
{% for s in review_states %}{% endfor %}
Approving needs the approver role and must be done by someone other than the rule's author.
{% endfor %} {% if r.chains %}

{{ ui.icon("layers") }}Multi-event chains

Rules above joined into one detection by ti2dac code (Sigma correlation plus fixed query templates). The AI never writes the join. Add one with ti2dac chain {{ r.run_id }} rule-001 rule-002 --within 10m --on host.

{% for c in r.chains %}
{{ ui.icon("chevron-right", "sm chev") }}{{ c.slug }} {{ c.name }}  · {{ c.steps|join(" → ") }}{% if not c.ordered %} (any order){% endif %} · same {{ c.join_on.replace("_", " ") }} · within {{ c.within }} · {{ c.queries|selectattr("query")|list|length }}/{{ c.queries|length }} queries · {{ "from the analysis" if c.source == "analysis" else "analyst" }} {% if c.evidence %}
{{ c.evidence }}
{% endif %} {% if c.warnings %}
    {% for w in c.warnings %}
  • {{ w }}
  • {% endfor %}
{% endif %} {% for q in c.queries %}
{% if q.client %}{{ q.client }} · {% endif %}{{ q.label }} {% if q.method == "template" %}ti2dac template{% endif %}{% if q.query %}{{ ui.copy_btn() }}{% endif %}
{% if q.query %}
{{ q.query }}
{% else %}

Not available: {{ q.error }}

{% endif %}
{% if q.notes and q.query %}

{{ q.notes }}

{% endif %} {% endfor %}
{% endfor %}
{% endif %}
{% endblock %}