arXiv:2512.06906cs.SEcs.CR2025-12中稿 · ICSE 2026被引 2

通过API模式推理可解释异常检测,有效区分噪声与真实异常。

MINES: Explainable Anomaly Detection through Web API Invariant Inference

  • 从API接口结构推断数据库约束,避免依赖原始日志
  • 在5个真实系统上实现高召回率且零误报
  • 适合安全团队用于构建可解释的异常检测系统

检测现代公司与政府依赖的网络应用异常至关重要。许多应用基于Web API(如RESTful、SOAP、WebSocket),其暴露可能引发有意攻击或非法访问,导致异常行为。然而,这些异常日志常与正常日志高度相似,且关键信息可能存在于数据库中,难以通过日志区分。此外,日志本身存在噪声,易使现有日志学习方法学到虚假关联,生成表面化模型。为此,我们提出MINES,从模式层面而非原始日志实例推断可解释的API不变量,实现(1)显著区分日志噪声以精准识别正常行为,(2)检测超出仪器化日志范围的异常。技术上,MINES(1)将API签名转化为表模式以增强原始数据库模式;(2)在增强后的数据库模式上推断潜在数据库约束,捕捉API与数据表间的潜在关系。采用大语言模型提取两个表结构间的潜在关系,并利用正常日志实例筛选和验证模型生成的不变量。最终,将推断出的约束转化为不变量,生成用于验证运行时日志的Python代码。我们在TrainTicket、NiceFish、Gitea、Mastodon和NextCloud等基准上评估了MINES,对比了LogRobust、LogFormer和WebNorm等基线方法。结果表明,MINES在保持几乎零误报的同时实现了高召回率,达到新基准水平。

原文摘要 · Abstract (English)

Detecting the anomalies of web applications, important infrastructures for running modern companies and governments, is crucial for providing reliable web services. Many modern web applications operate on web APIs (e.g., RESTful, SOAP, and WebSockets), their exposure invites intended attacks or unintended illegal visits, causing abnormal system behaviors. However, such anomalies can share very similar logs with normal logs, missing crucial information (which could be in database) for log discrimination. Further, log instances can be also noisy, which can further mislead the state-of-the-art log learning solutions to learn spurious correlation, resulting superficial models and rules for anomaly detection. In this work, we propose MINES which infers explainable API invariants for anomaly detection from the schema level instead of detailed raw log instances, which can (1) significantly discriminate noise in logs to identify precise normalities and (2) detect abnormal behaviors beyond the instrumented logs. Technically, MINES (1) converts API signatures into table schema to enhance the original database shema; and (2) infers the potential database constraints on the enhanced database schema to capture the potential relationships between APIs and database tables. MINES uses LLM for extracting potential relationship based on two given table structures; and use normal log instances to reject and accept LLM-generated invariants. Finally, MINES translates the inferred constraints into invariants to generate Python code for verifying the runtime logs. We extensively evaluate MINES on web-tamper attacks on the benchmarks of TrainTicket, NiceFish, Gitea, Mastodon, and NextCloud against baselines such as LogRobust, LogFormer, and WebNorm. The results show that MINES achieves high recall for the anomalies while introducing almost zero false positives, indicating a new state-of-the-art.

异常检测可解释性API分析安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。