rename to diagnostic and add docs

This commit is contained in:
Cooper Quintin
2026-02-05 14:29:46 -08:00
committed by Cooper Quintin
parent f7759721e3
commit 184f4bd7a2
6 changed files with 19 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ use pcap_file_tokio::pcapng::blocks::enhanced_packet::EnhancedPacketBlock;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
use crate::analysis::imsi_attach::ImsiAttachAnalyzer;
use crate::analysis::diagnostic::DiagnosticAnalyzer;
use crate::gsmtap::{GsmtapHeader, GsmtapMessage, GsmtapType};
use crate::util::RuntimeMetadata;
use crate::{diag::MessagesContainer, gsmtap_parser};
@@ -20,7 +20,7 @@ use super::{
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(default)]
pub struct AnalyzerConfig {
pub imsi_attach: bool,
pub diagnostic_analyzer: bool,
pub connection_redirect_2g_downgrade: bool,
pub lte_sib6_and_7_downgrade: bool,
pub null_cipher: bool,
@@ -34,13 +34,13 @@ impl Default for AnalyzerConfig {
fn default() -> Self {
AnalyzerConfig {
imsi_requested: true,
diagnostic_analyzer: true,
connection_redirect_2g_downgrade: true,
lte_sib6_and_7_downgrade: true,
null_cipher: true,
nas_null_cipher: true,
incomplete_sib: true,
test_analyzer: false,
imsi_attach: true,
}
}
}
@@ -349,8 +349,8 @@ impl Harness {
harness.add_analyzer(Box::new(TestAnalyzer {}))
}
if analyzer_config.imsi_attach {
harness.add_analyzer(Box::new(ImsiAttachAnalyzer {}));
if analyzer_config.diagnostic_analyzer {
harness.add_analyzer(Box::new(DiagnosticAnalyzer{}));
}
harness

View File

@@ -10,11 +10,11 @@ use pycrate_rs::nas::generated::emm::emm_service_reject::EMMCauseEMMCause as Ser
use pycrate_rs::nas::generated::emm::emm_tracking_area_update_reject::EMMCauseEMMCause as TAURejectEMMCause;
use std::borrow::Cow;
pub struct ImsiAttachAnalyzer;
pub struct DiagnosticAnalyzer;
impl ImsiAttachAnalyzer {
impl DiagnosticAnalyzer {
pub fn new() -> Self {
ImsiAttachAnalyzer
DiagnosticAnalyzer
}
fn is_imsi_exposing_nas(&self, nas_msg: &NASMessage) -> bool {
@@ -80,13 +80,13 @@ impl ImsiAttachAnalyzer {
}
}
impl Analyzer for ImsiAttachAnalyzer {
impl Analyzer for DiagnosticAnalyzer {
fn get_name(&self) -> Cow<'_, str> {
"Diagnostic detector for IMSI Exposure".into()
"Diagnostic detector for messages which might lead to IMSI exposure".into()
}
fn get_description(&self) -> Cow<'_, str> {
"Catches any messages that may expose IMSI. Can be quite noisy. \
"Catches any messages that may lead to IMSI Exposure. Can be quite noisy. \
Useful as a diagnostic for finding out why an IMSI was sent or what \
the reason for a reject message was. Not a useful indicator on its own \
but a helpful diagnostic for understanding why another indicator was \

View File

@@ -1,6 +1,6 @@
pub mod analyzer;
pub mod connection_redirect_downgrade;
pub mod imsi_attach;
pub mod diagnostic;
pub mod imsi_requested;
pub mod incomplete_sib;
pub mod information_element;