/*
   Odin by Brandefense - Monograph 20 / 30 YARA Artifact Suite
   Scope: Sanitized configuration and orchestration manifests for DeepAudit,
          AutoCVE, Cairn/AutoHunter, and Strix/RedAmon/XingRin stacks.
   Classification: TLP:CLEAR
*/

rule ODIN_DeepAudit_MultiAgent_AST_Config
{
    meta:
        author = "Odin by Brandefense"
        monograph = "20 / 30"
        classification = "TLP:CLEAR"
        usage = "dual-use policy review"
        description = "Matches DeepAudit multi-agent AST sink-to-source configuration manifests"
    strings:
        $id1 = "DEEPAUDIT_" ascii
        $id2 = "deepaudit_backend" ascii nocase
        $ast1 = "sink_to_source" ascii nocase
        $ast2 = "tree_sitter_languages" ascii nocase
        $api1 = "/api/v1/audit" ascii
    condition:
        filesize < 512KB and ($id1 or $id2) and ($ast1 or $ast2) and $api1
}

rule ODIN_AutoCVE_PatchDiff_Synthesizer_Manifest
{
    meta:
        author = "Odin by Brandefense"
        monograph = "20 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt and analyst review"
        description = "Matches AutoCVE advisory ingestion and patch-diff worker orchestration configs"
    strings:
        $ac1 = "AUTOCVE_ENGINE" ascii
        $ac2 = "autocve_task" ascii nocase
        $df1 = "patch_diff_prompt" ascii nocase
        $df2 = "nvd_feed_sync" ascii nocase
        $vr1 = "template_status" ascii nocase
    condition:
        filesize < 512KB and ($ac1 or $ac2) and ($df1 or $df2) and $vr1
}

rule ODIN_Cairn_AutoHunter_Recon_Queue_Config
{
    meta:
        author = "Odin by Brandefense"
        monograph = "20 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt and analyst review"
        description = "Matches Cairn (:8000/:8010) and AutoHunter (:18800) autonomous surface discovery configs"
    strings:
        $c1 = "X-Cairn-Worker" ascii
        $c2 = "/api/v1/cairn/" ascii
        $a1 = "/api/autohunter/" ascii
        $a2 = "18800" ascii
        $q1 = "target_scope" ascii nocase
    condition:
        filesize < 512KB and (($c1 and $c2) or ($a1 and $a2)) and $q1
}

rule ODIN_Strix_RedAmon_XingRin_Swarm_Compose
{
    meta:
        author = "Odin by Brandefense"
        monograph = "20 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt and analyst review"
        description = "Matches containerized Strix, RedAmon, or XingRin validation swarm manifests"
    strings:
        $s1 = "/api/strix/containers" ascii
        $s2 = "sandbox_port" ascii
        $r1 = "RedAmon-Agent/" ascii
        $r2 = "/api/redamon/" ascii
        $x1 = "/api/xingrin/node" ascii
        $x2 = "X-XingRin-Token" ascii
    condition:
        filesize < 512KB and (($s1 and $s2) or ($r1 and $r2) or ($x1 and $x2))
}
