#[non_exhaustive]pub enum DetectorKind {
BeaconCv,
BeaconRita,
PortScanTrw,
Dga,
DnsTunnel,
NewlyObservedDomain,
ConnectionFlood,
DataExfil,
Other(&'static str),
Unknown,
}Expand description
Which detector produced an anomaly.
Built-in variants cover every detector shipped in
crate::detect::patterns. Downstream crates register their
own kinds via Self::Other.
#[non_exhaustive] — future detectors will add variants;
matching on this enum should always include a wildcard arm.
Serializes as its as_str slug — a plain JSON
string (e.g. "BeaconCv"), not a tagged object — so the
kind field in emitted anomalies matches the pre-0.21
Cow<'static, str> wire shape byte-for-byte. Deserializes a
slug back via from_slug: built-in slugs
round-trip to their variant; an unrecognised slug (including a
downstream Other label) deserializes to
Unknown — it cannot rebuild the
&'static str an Other needs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BeaconCv
Coefficient-of-variation beacon detector
(crate::detect::patterns::BeaconDetector).
BeaconRita
RITA-style robust beacon detector (Bowley skewness + MADM;
crate::detect::patterns::RitaBeaconDetector).
PortScanTrw
Threshold Random Walk port-scan detector
(crate::detect::patterns::PortScanDetector).
Dga
DGA domain scorer
(crate::detect::patterns::DgaScorer).
DnsTunnel
DNS tunneling detector — distinct-subdomain cardinality
(DnsTunnelDetector, issue #132).
NewlyObservedDomain
Newly-observed-domain detector — bounded first-seen set
(NewlyObservedDomainDetector, issue #132).
ConnectionFlood
Per-source connection-rate flood detector
(ConnectionFloodDetector, issue #132).
DataExfil
EWMA-variance outbound-volume exfiltration detector
(DataExfilDetector, issue #132).
Other(&'static str)
Downstream-registered detector kind. The &'static str
label should be a unique stable slug — typical convention
is "crate-name/detector" (e.g. "zensight/sigma").
Unknown
Detector identity unknown — the deserialization fallback
for unrecognised slugs (an Other can’t be
rebuilt from a runtime string). Also the Default.
Implementations§
Source§impl DetectorKind
impl DetectorKind
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Stable slug — same vocabulary the 0.20-and-earlier
OwnedAnomaly::kind string carried. Use for metric labels
and JSON emission (EVE anomaly.event, NDJSON kind).
Each built-in variant maps to the slug its detector
historically emitted (BeaconCv → "BeaconCv",
PortScanTrw → "PortScanTRW", Dga → "DgaScorer", …);
the full mapping is regression-pinned by
slug_vocabulary_locked. Self::Other yields its wrapped
caller-supplied slug; Self::Unknown yields "unknown".
from_slug is the inverse.
Sourcepub fn from_slug(s: &str) -> DetectorKind
pub fn from_slug(s: &str) -> DetectorKind
Sourcepub fn attack_technique(&self) -> Option<&'static str>
pub fn attack_technique(&self) -> Option<&'static str>
MITRE ATT&CK technique ID for the behaviour this detector
flags, in the stable Txxxx / Txxxx.yyy form, or None
when no single technique applies (Other /
Unknown).
Mapping rationale:
- Beaconing → T1071 Application Layer Protocol (the C2 channel protocol is unknown at detection time, so the parent technique — not a sub-technique — applies).
- Port scan → T1046 Network Service Discovery.
- DGA → T1568.002 Dynamic Resolution: Domain Generation Algorithms.
- DNS tunnel → T1071.004 Application Layer Protocol: DNS.
- Newly-observed domain → T1568 Dynamic Resolution (NOD is the defender-observable signal of dynamic resolution infrastructure; T1583.001 covers adversary acquisition, which passive capture can’t see).
- Connection flood → T1498 Network Denial of Service
(rate-shaped; scan-shaped fan-out is
PortScanTrw’s T1046). - Data exfil → T1048 Exfiltration Over Alternative Protocol (the RITA / AC-Hunter N-sigma outbound-volume precedent; T1030 Data Transfer Size Limits is the adversary’s evasion of exactly this detector — wrong axis).
Trait Implementations§
Source§impl Clone for DetectorKind
impl Clone for DetectorKind
impl Copy for DetectorKind
Source§impl Debug for DetectorKind
impl Debug for DetectorKind
Source§impl Default for DetectorKind
impl Default for DetectorKind
Source§impl<'de> Deserialize<'de> for DetectorKind
Available on crate feature serde only.
impl<'de> Deserialize<'de> for DetectorKind
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for DetectorKind
impl Display for DetectorKind
impl Eq for DetectorKind
Source§impl Hash for DetectorKind
impl Hash for DetectorKind
Source§impl PartialEq for DetectorKind
impl PartialEq for DetectorKind
Source§impl Serialize for DetectorKind
Available on crate feature serde only.
impl Serialize for DetectorKind
serde only.impl StructuralPartialEq for DetectorKind
Auto Trait Implementations§
impl Freeze for DetectorKind
impl RefUnwindSafe for DetectorKind
impl Send for DetectorKind
impl Sync for DetectorKind
impl Unpin for DetectorKind
impl UnsafeUnpin for DetectorKind
impl UnwindSafe for DetectorKind
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.