HSMLog: Small Language Model-Assisted Hardware Security Module Log Anomaly Detection with Behavioral Analysis
Overview
Hardware security module logs record operations whose security meaning depends on their context: key histories, object states, sessions, and timing can distinguish a legitimate sequence from a suspicious one. Detecting anomalies from isolated log entries can miss these relationships. HSMLog uses a small language model to analyze behavior across structured log windows and relate candidate anomalies to operational policies.
The system has two stages. First, a policy-guided analysis of each window proposes suspicious events. A second review stage brings together retrieved policies, related logs, and historical records associated with suspicious keys to assess candidates conservatively and assemble incidents. Historical evidence is restricted to information available before the alert window, so the assessment does not benefit from future records.
Evaluation uses real industrial background logs augmented with anomaly scenarios developed with industry partners. In this setting, HSMLog reports 98.97% precision, 96.00% recall, and a 97.46% F1 score, with 98.66% event coverage. The results assess the combined role of contextual behavioral analysis and evidence-based candidate review in reducing missed events and false alerts.
Citation
Chia-Hsuan Wu, Dar-Hsin Dustin Wu, Rui Fang, Yi-Ting Lee, Chia-Chih Lin, and Ming-Syan Chen. (2026). "HSMLog: Small Language Model-Assisted Hardware Security Module Log Anomaly Detection with Behavioral Analysis." ISSRE 2026, Industry Track (accepted).