LogSHIELD: A Graph-based Real-time Anomaly Detection Framework using Frequency Analysis

Krishna Chandra Roy, Qian Chen · DOI

Abstract

Anomaly-based cyber threat detection using deep learning is on a constant growth in popularity for novel cyber-attack detection and forensics. A robust, efficient, and real-time threat detector in a large-scale operational enterprise network requires high accuracy, high fidelity, and a high throughput model to detect malicious activities. Traditional anomaly-based detection models, however, suffer from high computational overhead and low detection accuracy, making them unsuitable for real-time threat detection. In this work, we propose LogSHIELD, a highly effective graph-based anomaly detection model in host data. We present a real-time threat detection approach using frequency-domain analysis of provenance graphs. To demonstrate the significance of graph-based frequency analysis we proposed two approaches. Approach-I uses a Graph Neural Network (GNN) LogGNN and approach-II performs frequency domain analysis on graph node samples for graph embedding. Both approaches use a statistical clustering algorithm for anomaly detection. The proposed models are evaluated using a large host log dataset consisting of 774M benign logs and 375K malware logs. LogSHIELD explores the provenance graph to extract contextual and causal relationships among logs, exposing abnormal activities. It can detect stealthy and sophisticated attacks with over 98% average AUC and F1 scores. It significantly improves throughput, achieves an average detection latency of 0.13 seconds, and outperforms state-of-the-art models in detection time.

Introduction

Anomaly-based intrusion detection is crucial for catching zero-day attacks that traditional signature-based systems miss. Recently, researchers have turned to "provenance graphs"—which map out the causal and sequential relationships between system processes and logs—to spot stealthy malware. However, as these graphs grow, analyzing them with deep learning (like Graph Neural Networks) becomes incredibly computationally expensive. While achieving high accuracy, the processing latency often makes these models impossible to deploy for real-time threat detection on busy enterprise networks generating terabytes of logs.

LogSHIELD addresses this bottleneck by introducing a framework that maintains the rich contextual data of provenance graphs while processing them fast enough to stop attacks in progress. By leveraging lightweight Frequency Domain Analysis (FDA), the system achieves massive speedups, making graph-based anomaly detection viable for live enterprise environments.

The LogSHIELD framework architecture, encompassing data collection, graph construction, embedding, and threat detection.

Methodology

Graph Construction and Sampling

The framework begins by building a provenance graph from raw Windows host logs. Events are linked based on timestamps and parent-child process relationships, capturing the causal flow of system activities. To extract features, LogSHIELD uses a Random Walk with Restart (RWR) algorithm to sample a node's local neighborhood. An ablation study revealed that sampling a node's 3-hop neighborhood is the optimal "sweet spot"; extending the search further tends to aggregate noisy, unrelated context that degrades performance.

Provenance graph construction illustrating causal and sequential relationships between system events (E) across different processes (P).

Feature Extraction Approaches

The paper proposes two distinct paths for handling the sampled graph data:

  • Approach-I (LogGNN): A deep learning route that uses FastText/Word2Vec to encode log text and a Bidirectional LSTM (BiLSTM) to aggregate the embeddings of neighbor nodes.
  • Approach-II (FDA): A lightweight signal processing route. Instead of a neural network, it applies a Discrete Fourier Transform (DFT) to the sampled neighbor nodes, treating the sequence of log features as a signal to extract frequency domain features.

Finally, both approaches feed their extracted features into an unsupervised statistical clustering algorithm based on cosine similarity. If a new log sequence falls outside established "benign" clusters, it is flagged as a threat.

Datasets

LogSHIELD was evaluated using a massive, real-world host log dataset:

  • Benign Dataset: 774 million logs (1.6 TB) collected from 35 legitimate users on a Windows enterprise network over 90 days.
  • Malware Dataset: 375,000 logs generated by detonating 140 recent malware binaries across 6 families (Ransomware, Rootkits, Trojans, Adware, Backdoors, and Browser Hijackers) in a controlled testbed.

Key Results and Insights

The evaluation demonstrates that Frequency Analysis is a highly viable substitute for Deep Learning in this context. Applying a DFT to graph node samples captures enough semantic meaning to detect malware nearly as well as a complex BiLSTM network, but at a fraction of the cost.

  • Performance vs. Speed: Approach-I (LogGNN) achieved a 98% average AUC but with a latency of 1.67 seconds. In contrast, Approach-II (FDA) achieved a highly competitive 96% average AUC while slashing latency to just 0.13 seconds.
  • Throughput: The FDA approach boosted throughput to 5.1 Gbps, representing an 11.3x speedup over the GNN-based approach.

LogSHIELD significantly outperformed state-of-the-art baselines like Log2Vec and DeepLog in both speed and throughput while maintaining superior accuracy.

Conclusion

LogSHIELD demonstrates that real-time, graph-based anomaly detection is achievable in large-scale networks. While the current implementation is focused on Windows environments, future work will aim to adapt feature extraction for Linux and macOS and evaluate scalability across larger, heterogeneous enterprise networks. The trade-off is clear: for real-time defense, the FDA approach offers the best balance of high-fidelity detection and low-latency processing.

Summary updated

BibTeX
@misc{roy2024logshield,
  author = {Krishna Chandra Roy and Qian Chen},
  title = {{LogSHIELD: A Graph-based Real-time Anomaly Detection Framework using Frequency Analysis}},
  year = {2024},
  eprint = {2410.21936},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.21936},
}
Figure