Constructing Flow Graphs from Procedural Cybersecurity Texts

Kuntal Kumar Pal, Kazuaki Kashihara, Pratyay Banerjee, Swaroop Mishra, Ruoyu Wang, Chitta Baral

Abstract

Researchers at Arizona State University have developed LM-GNN, a framework that transforms unstructured cybersecurity "write-ups" into structured flow graphs. By integrating Large Language Models (LLMs) with Graph Neural Networks (GNNs), the system recovers the logical action paths of cyberattacks. Evaluated across cybersecurity, cooking, and maintenance domains, the model significantly outperforms traditional text-processing baselines, providing a foundation for automated vulnerability analysis.

Introduction: The Challenge of Unstructured Procedural Text

Procedural texts, such as technical manuals and recipes, provide step-by-step instructions to achieve specific goals. In the cybersecurity domain, these often appear as "write-ups" from Capture The Flag (CTF) competitions. These documents are inherently unstructured, mixing natural language with code snippets and irrelevant commentary, making it difficult for automated systems to track causal relationships or system states. Previous research often focused on fine-grained entity extraction, which requires massive amounts of domain-specific data. This paper shifts the focus to the sentence level, aiming to recover the high-level "flow" of instructions.

Example of an annotated CTF write-up showing different sentence types (Action, Information, Code, etc.) used to build flow graphs.

The LM-GNN Framework

The proposed LM-GNN framework treats flow graph construction as an edge-prediction task. The process involves several key stages:

  1. Preprocessing: Documents are split into sentences, and irrelevant "chatter" is filtered out using a classifier.
  2. Node Representation: Each sentence is converted into a vector embedding using pre-trained language models like BERT or RoBERTa.
  3. Graph Construction: To make the model "neighbor-aware," the authors use a Graph Convolutional Network (GCN) or a Graph Attention Network (GAT). This allows the model to learn structural relationships beyond simple linear sequences.
  4. Windowing: A sliding window ($W_N$) is used to limit comparisons to logically relevant preceding steps, reducing noise and computational overhead.
  5. Edge Prediction: The final layer predicts whether a directed edge exists between two sentences, signifying an information or action flow.

Datasets and Evaluation

The study utilizes three distinct procedural domains to prove generalizability:

  • CTFW (New): The Capture The Flag Write-up dataset, containing 3,154 documents annotated by experts for sentence types and flow structures.
  • COR (Cooking): Based on the Cooking Recipe Flow Corpus, aggregated to the sentence level.
  • MAM (Maintenance): Based on a dataset of maintenance manuals for industrial equipment.

Key Results and Performance Analysis

Experimental results indicate that the RoBERTa-GCN model is the top performer, achieving a PRAUC (Area Under Precision-Recall Curve) of 0.7221 on the CTFW dataset, significantly outperforming the BERT-Next Sentence Prediction baseline (0.5751).

AUC performance across datasets (CTFW, COR, MAM) and window sizes for various model architectures, showing the superiority of GCN-based models.

Key Insights:

  • Structure over Entities: Identifying high-level sentence connections is often sufficient to reconstruct a workflow and is easier to generalize across fields than complex entity recognition.
  • The GNN Advantage: Standard language models struggle with non-linear connections. Adding a GNN layer provides the "structural memory" needed to recognize when an observation in one sentence causes an action several steps later.
  • GCN vs. GAT: Interestingly, simpler GCNs generally outperformed more complex GATs. The authors hypothesize that graph attention may struggle to learn robust representations from sentence embeddings compared to the straightforward aggregation of GCNs.

Conclusion and Future Work

LM-GNN represents a significant advancement in automated procedural text understanding. While the model currently faces hurdles with noisy informal language and English-centric datasets, it provides a vital foundation. The ultimate goal is to leverage these flow graphs to build automated agents capable of autonomously performing vulnerability analysis or mitigation described in security write-ups.

Summary updated

BibTeX
@inproceedings{pal2021constructing,
  author = {Kuntal Kumar Pal and Kazuaki Kashihara and Pratyay Banerjee and Swaroop Mishra and Ruoyu Wang and Chitta Baral},
  title = {{Constructing Flow Graphs from Procedural Cybersecurity Texts}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.findings-acl.345},
}
Figure