Behavior Query Discovery in System-Generated Temporal Graphs

Bo Zong, Xusheng Xiao, Zhichun Li, Zhenyu Wu, Zhiyun Qian, Xifeng Yan, Ambuj K. Singh, Guofei Jiang

Abstract

TGMiner automates the creation of complex security queries by mining discriminative patterns from system logs represented as temporal graphs. By leveraging the chronological order of system events, it bypasses the computational bottlenecks of traditional graph mining, achieving 97% precision and speeds up to 32x faster than existing methods.

Introduction: The Semantic Gap in System Monitoring

System administrators and security researchers face a daunting "semantic gap." On one hand, they have massive streams of low-level system call (syscall) logs—millions of events recording every file read, process fork, and network packet. On the other hand, they want to detect high-level behaviors like an "sshd-login" or a "file-compression-and-exfiltration" event.

Bridging the gap between raw syscall logs and high-level behavior queries via temporal graphs.

Manually writing queries to find these behaviors is nearly impossible because a single high-level action might involve hundreds of tedious, interleaved low-level syscalls. While temporal graphs (where nodes are entities and edges are timed interactions) provide a great way to model this data, searching them is computationally expensive. Traditional graph mining is plagued by the "subgraph isomorphism" problem—an NP-complete challenge that makes finding specific patterns in massive datasets agonizingly slow.

The TGMiner Framework

The authors introduce TGMiner, a framework that treats query formulation as a discriminative temporal graph pattern mining problem.

The end-to-end workflow of TGMiner, from behavior collection to query generation.
  1. Discriminative Mining: Instead of finding all patterns, TGMiner looks for patterns that appear frequently in a "positive" set (the behavior you want to find, like a login) and rarely in a "negative" set (background noise). These patterns become the "skeletons" for security queries.
  2. Consecutive Growth & T-Connectivity: TGMiner ensures that the patterns it discovers are "T-connected"—meaning the events are connected both logically and chronologically. It grows patterns one edge at a time in a specific temporal order, which prevents redundant work.
  3. The Temporal Advantage: In standard graphs, edges have no order, making matching very hard. In temporal graphs, edges are totally ordered by time. TGMiner exploits this by encoding graphs into sequences (Node Sequences and Edge Sequences).
  4. Pruning: The system uses "subgraph" and "supergraph" pruning to skip large sections of the search space that are mathematically guaranteed not to contain the most discriminative patterns.

Datasets and Evaluation

The researchers evaluated TGMiner using 13 datasets containing a total of 11,200 temporal graphs, comprising nearly 2 million nodes and 8 million edges.

  • Target Behaviors: 12 distinct behaviors were mined, including common utilities (bzip2, gcc), network activities (wget, ftp, scp), and critical security events (ssh-login, sshd-login).
  • Background Data: 10,000 temporal graphs sampled from 7 days of "normal" server activity to serve as the negative/noise set.
  • Synthetic Scalability Tests: They generated replicated datasets (up to 10x original size) to test how the algorithm handles "Big Data" scales.

Key Insights

  • Time as a Constraint, Not Just a Label: Most researchers treat timestamps as just another attribute on an edge. TGMiner realizes that time provides a total order that transforms a hard graph problem into a much easier sequence-matching problem.
  • The "Sshd" Paradox: Interestingly, the most discriminative pattern for an sshd-login often doesn't actually contain the string "sshd." Instead, it's the unique structural "footprint" of how the process interacts with specific libraries and sockets that makes it identifiable. This means TGMiner can find stealthy activities that simple keyword searches would miss.
  • Efficiency through Sequence Encoding: By converting a graph into an "enhanced node sequence," the authors reduced the overhead of graph isomorphism tests. This allowed them to perform millions of tests that would have crashed traditional miners.

Key Results

  • Accuracy: The queries discovered by TGMiner achieved an average precision of 97.4% and a recall of 91.1%. It significantly outperformed "NodeSet" (keyword-based) and "Ntemp" (non-temporal graph) baselines.
  • Speed: TGMiner was 6 to 32 times faster than baseline methods like PruneGI or LinearScan.
  • Scalability: The response time scales linearly with the amount of training data. It was able to mine patterns from 20 million nodes and 80 million edges in under 3 hours—a feat impossible for standard discriminative graph miners.

Limitations and Future Work

  • Concurrency: The current model assumes a "total order" of edges. In systems with high parallelism, two events might have the exact same timestamp. Sequentializing these events or using canonical labeling for concurrent subgraphs adds computational complexity.
  • Dynamic Environments: The patterns are mined from a "closed environment." In highly volatile, real-world production environments, the "background noise" might shift, potentially requiring the model to be re-trained or updated online.
  • Human-in-the-loop: While TGMiner finds the "skeletons," a domain expert is still recommended to rank the top patterns based on security implications before deploying them as final queries.

Summary updated

BibTeX
@article{zong2015behavior,
  author = {Bo Zong and Xusheng Xiao and Zhichun Li and Zhenyu Wu and Zhiyun Qian and Xifeng Yan and Ambuj K. Singh and Guofei Jiang},
  title = {{Behavior Query Discovery in System-Generated Temporal Graphs}},
  journal = {Proc. VLDB Endow.},
  year = {2015},
  doi = {10.14778/2856318.2856320},
}
Figure