/*
   Odin by Brandefense - Monograph 68 YARA Suite
   4 filesize-bounded structural rules covering exposed ARTEX and ARL console bundles,
   privileged hostPath Kubernetes pod manifests, and exported Kubernetes SecretList dumps.
*/

rule ODIN_R68_ARTEX_Console_Bundle_and_Task_API
{
    meta:
        author = "Odin by Brandefense"
        monograph = "68"
        description = "Detects exposed ARTEX autonomous testing console bundles and task API definitions"
        date = "2026-11-25"
    strings:
        $a1 = "ARTEX - Autonomous Red-Team Expert" ascii
        $a2 = "/api/v1/tasks" ascii
        $a3 = "artex-swarm-root" ascii
    condition:
        filesize < 5MB and $a1 and ($a2 or $a3)
}

rule ODIN_R68_ARL_Recon_Lighthouse_Bundle
{
    meta:
        author = "Odin by Brandefense"
        monograph = "68"
        description = "Detects exposed Asset Reconnaissance Lighthouse (ARL) web console bundles and login routes"
        date = "2026-11-25"
    strings:
        $l1 = "Asset Reconnaissance Lighthouse" ascii
        $l2 = "/api/user/login" ascii
        $l3 = "arl_web" ascii
    condition:
        filesize < 5MB and $l1 and ($l2 or $l3)
}

rule ODIN_R68_Privileged_HostPath_Pod_Manifest
{
    meta:
        author = "Odin by Brandefense"
        monograph = "68"
        description = "Detects Kubernetes Pod YAML or JSON manifests combining hostPath or hostNetwork with privileged execution"
        date = "2026-11-25"
    strings:
        $k1 = "kind: Pod" ascii
        $k2 = "\"kind\":\"Pod\"" ascii
        $m1 = "hostPath" ascii
        $m2 = "hostNetwork: true" ascii
        $p1 = "privileged: true" ascii
        $p2 = "\"privileged\":true" ascii
    condition:
        filesize < 512KB and ($k1 or $k2) and ($m1 or $m2) and ($p1 or $p2)
}

rule ODIN_R68_Exported_K8s_Secret_List_Dump
{
    meta:
        author = "Odin by Brandefense"
        monograph = "68"
        description = "Detects exported Kubernetes SecretList YAML or JSON dumps containing ServiceAccount or registry tokens"
        date = "2026-11-25"
    strings:
        $s1 = "SecretList" ascii
        $v1 = "apiVersion: v1" ascii
        $v2 = "\"apiVersion\":\"v1\"" ascii
        $t1 = "kubernetes.io/service-account-token" ascii
        $t2 = "kubernetes.io/dockerconfigjson" ascii
    condition:
        filesize < 10MB and $s1 and ($v1 or $v2) and ($t1 or $t2)
}
