Skip to main content
QUICK REVIEW

[Paper Review] CyNER: A Python Library for Cybersecurity Named Entity Recognition

Md Tanvirul Alam, Dipkamal Bhusal|arXiv (Cornell University)|Apr 8, 2022
Network Security and Intrusion DetectionComputer Science24 citations
TL;DR

CyNER is an open-source Python library that combines transformer-based NER models trained on cybersecurity data with heuristic indicators and generic NLP models to extract cybersecurity threat intelligence entities, with configurable prediction merging.

ABSTRACT

Open Cyber threat intelligence (OpenCTI) information is available in an unstructured format from heterogeneous sources on the Internet. We present CyNER, an open-source python library for cybersecurity named entity recognition (NER). CyNER combines transformer-based models for extracting cybersecurity-related entities, heuristics for extracting different indicators of compromise, and publicly available NER models for generic entity types. We provide models trained on a diverse corpus that users can readily use. Events are described as classes in previous research - MALOnt2.0 (Christian et al., 2021) and MALOnt (Rastogi et al., 2020) and together extract a wide range of malware attack details from a threat intelligence corpus. The user can combine predictions from multiple different approaches to suit their needs. The library is made publicly available.

Motivation & Objective

  • Motivate the need for structured extraction of open cyber threat intelligence (openCTI) from unstructured reports.
  • Provide a labeled cybersecurity NER dataset annotated on diverse incidents.
  • Deliver CyNER as a modular library that combines transformer-based NER, heuristic indicators, and generic NER models.

Proposed method

  • Train transformer models on a curated cybersecurity corpus covering five entity classes (malware, indicator, system, organization, vulnerability) using the tner library.
  • Provide heuristic rules for indicators of compromise via regular expressions for entities like URL, IP, hash, CVE, etc.
  • Integrate generic NER models from Flair and spaCy to capture non-cybersecurity entities.
  • Allow finetuning of transformer models with Huggingface’s transformers and standard training hyperparameters.
  • Offer a modular prediction fusion mechanism with configurable priority (HTFS by default) to merge outputs from multiple models.

Experimental results

Research questions

  • RQ1How well do transformer models pretrained on cybersecurity data perform on the annotated threat intelligence corpus?
  • RQ2Does combining transformer-based NER, heuristic indicators, and generic NER improve overall extraction accuracy?
  • RQ3Can CyNER be fine-tuned on user-provided annotated datasets to adapt to new threat intelligence domains?

Key findings

  • XLM-RoBERTa-large achieves the best average F1 score of 76.66% on the test set among evaluated transformers.
  • Table 3 shows precision/recall/F1 across models: BERT-base-uncased (69.77 F1), BERT-large-uncased (73.07 F1), RoBERTa-base (39.69 F1), RoBERTa-large (38.91 F1), XLM-RoBERTa-base (75.88 F1), XLM-RoBERTa-large (76.66 F1).
  • Class-wise results with XLM-RoBERTa-large indicate Malware 77.39 F1, Indicator 82.27 F1, System 74.84 F1, Organization 64.98 F1, Vulnerability 88.89 F1.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.