The Dataset Viewer has been disabled on this dataset.

secdata-raw

An open-source raw corpus for fine-tuning cybersecurity-focused language models.

secdata-raw is a collection of 4,051,139 raw security documents scraped from 50+ public sources — vulnerability databases, threat intelligence frameworks, detection rule corpora, kernel security commits, practitioner Q&A archives, and curated security-focused GitHub documentation. This is the raw collection (v1.0): the source material before LLM-based conversion into instruction-tuning examples. A converted instruction-tuning version (v2.0) is planned pending compute resources — see What's next.

Total documents 4,051,139
Unique sources 50+
Total size ~5.4 GB (JSONL, uncompressed)
License CC BY-SA 4.0
Format JSONL, multi-schema by source
Status Raw collection — pre-conversion, pre-deduplication

Topic breakdown

Documents are listed by primary topic. Note that the largest source — github_deep (3.47M documents, 86% of the corpus) — consists of markdown documentation from 10,000 curated security-focused GitHub repositories spanning all topics below; it is shown as a single broad-coverage bucket rather than allocated across topics.

Rank % Documents Topic
1 85.64% 3,469,231 Broad security documentation — curated GitHub repo content (spans all topics below)
2 7.91% 320,557 Vulnerability disclosure (CVE tracking) — NVD full CVE database
3 1.27% 51,256 Practitioner Q&A — Stack Exchange (security, RE, cryptography)
4 1.16% 47,021 Exploit code & writeups — ExploitDB
5 1.06% 43,063 Linux distribution security advisories — Red Hat Security
6 0.96% 38,771 Linux kernel security commits — security-relevant kernel git history
7 0.53% 21,458 Windows / Microsoft security advisories — MSRC Patch Tuesday entries
8 0.50% 20,226 Malware detection rules — YARA
9 0.39% 15,757 Package ecosystem vulnerabilities — GHSA (7 ecosystems)
10 0.18% 7,348 SIEM / log-based detection rules — Sigma
11 0.11% 4,569 Offensive frameworks — Metasploit modules
12 0.06% 2,354 Threat intelligence & attack modeling — MITRE ATT&CK techniques
13 0.05% 2,138 Detection validation test cases — Atomic Red Team
14 0.04% 1,653 Web/API/Mobile security testing guides — OWASP MASTG, API Security, WSTG
15 0.04% 1,500 Vulnerability & attack pattern taxonomy — CWE + CAPEC
16 0.02% 936 Pentest methodology & reports — PTES, pentest reports, secure coding, IR playbooks
17 0.02% 779 Network & protocol security — Nmap, Wireshark, PacketLife, wireless
18 0.01% 388 AI/ML security — ML-focused security guides and repositories
19 0.01% 372 Heap exploitation — How2Heap
20 0.01% 331 Forensics & incident response — DFIR tools, Windows artifacts, Linux forensics
21 0.01% 320 Ubuntu security advisories (partial — see Limitations)
22 0.01% 245 Kernel exploitation training — Nightmare CTF series
23 0.01% 243 Mobile application security — MASTG, hacktricks_mobile, mobile repos
24 0.01% 237 Living-off-the-land binaries — LOLBAS
25 <0.01% 149 Cloud & container security — Azure, GCP, Kubernetes, CloudGoat, FLAWS
26 <0.01% 128 Cryptography — Cryptopals, post-quantum, CryptoHack, Dan Boneh course
27 <0.01% 57 Reverse engineering training — Ghidra course
28 <0.01% 16 Academic security papers — arXiv (partial — see Limitations)
29 <0.01% 13 Miscellaneous code snippets — GitHub Gists

Topic coverage at a glance (excluding the broad GitHub bucket)

Among the ~582K structured documents — the 14% that isn't broad GitHub markdown — the corpus emphasizes:

  • Vulnerability disclosure & tracking (NVD + GHSA + vendor advisories): ~401K docs, ~69% of structured content
  • Practitioner Q&A (Stack Exchange): 51K docs, ~9%
  • Exploit & offensive technique documentation (ExploitDB + Metasploit + How2Heap + Nightmare + LOLBAS + Atomic Red Team): ~54K docs, ~9%
  • Linux kernel security: 39K docs, ~7%
  • Detection engineering (YARA + Sigma): 28K docs, ~5%
  • Threat modeling & taxonomy (ATT&CK + CWE + CAPEC): ~3.9K docs
  • Everything else (cloud, mobile, crypto, forensics, network, AI/ML, web): ~3K docs combined

This shape — heavy on vulnerability disclosure plus broad practitioner content, lighter on specific defensive subfields — reflects what's openly available at scale in cybersecurity. Sparser topics (cryptography, mobile security, cloud security) are documented but represent priority areas for v1.x expansion.

What's in it

Vulnerability databases (448K documents)

  • NVD (CVE database): 320,557 entries — full NIST National Vulnerability Database from 2002 to present, including descriptions, CVSS scores, CWE mappings, and references
  • ExploitDB: 47,021 exploits with descriptions and metadata
  • Red Hat Security: 43,063 advisories with CVE mappings and affected packages
  • MSRC (Microsoft Security Response Center): 21,458 monthly advisory entries
  • GHSA (GitHub Security Advisories): 15,757 advisories across 7 ecosystems (pip, Maven, RubyGems, Go, Rust, Composer, NuGet)
  • Ubuntu Security Notices: 320 (partial — see Limitations)

Threat intelligence & taxonomy (~6K documents)

  • MITRE ATT&CK: 2,354 techniques, tactics, and procedures
  • Atomic Red Team: 2,138 test definitions
  • CWE: 944 weakness classifications
  • CAPEC: 556 attack patterns
  • LOLBAS: 237 living-off-the-land binaries

Detection & rule corpora (~32K documents)

  • YARA rules: 20,226 from multiple public repos
  • Sigma rules: 7,348 SIEM detection rules
  • Metasploit Framework: 4,569 modules with documentation

Linux kernel security (39K documents)

  • Kernel commits: 38,771 security-relevant commits filtered from the full Linux kernel git history (CVE references, "security fix", "use-after-free", buffer overflow, and other security keywords)

Practitioner Q&A (51K documents)

  • Stack Exchange archives: Security.SE, Reverse Engineering.SE, Crypto.SE — full archive dumps under CC BY-SA 4.0 (the upstream license requirement is the reason this dataset itself is CC BY-SA 4.0)

GitHub documentation (3.47M documents)

  • github_deep: Markdown documentation extracted from the 10,000 highest-starred security-related GitHub repositories matching 108 security-focused search queries. Includes READMEs, in-repo documentation, methodology notes, technique writeups, and tool documentation. 96% unique content; median document length ~1,500 characters.

Specialty sources

OWASP MASTG, OWASP API Security, OWASP WSTG, How2Heap, Nightmare, Nmap docs, Wireshark docs, PacketLife, OWASP Mobile (HackTricks), Azure Security, GCP Security, Kubernetes Container Security, post-quantum cryptography, Cryptopals, CryptoHack, Forensic Tools docs, Windows Artifact Guide, Ghidra Course, IR Playbooks, SIEM Implementation, Secure Coding guides, Mobile Security Repos, CloudGoat, PTES, Pentest Reports, Dan Boneh's Cryptography course, FLAWS.cloud, AI/ML Security guides.

A complete machine-readable source breakdown is included as sources_manifest.json in this dataset.

Schema

secdata-raw is a multi-schema dataset. Documents from different sources have different fields because the underlying data is genuinely heterogeneous. All documents share these fields:

Field Type Description
source string Source identifier (e.g., nvd, kernel_commits, github_deep)
text string The primary content of the document
url string The original URL or canonical reference

Source-specific fields commonly include id, cve_id, severity, cvss_score, published, repo, file, subject, date, technique_id, attack_ids, and others. See sources_manifest.json and the scraper code for per-source schemas.

The HuggingFace dataset viewer is disabled because the multi-schema structure cannot be cleanly cast to a single Arrow schema. Load the data directly:

import json

docs = []
for chunk_idx in range(8):  # adjust to actual chunk count in this dataset
    with open(f'raw_docs_chunk_{chunk_idx:03d}.jsonl') as f:
        for line in f:
            docs.append(json.loads(line))

# Or filter by source:
nvd_docs = [d for d in docs if d.get('source') == 'nvd']
kernel_docs = [d for d in docs if d.get('source') == 'kernel_commits']

For streaming use (recommended for the full dataset):

from huggingface_hub import hf_hub_download
import json

for i in range(8):  # adjust to actual chunk count
    path = hf_hub_download(
        repo_id="deardaniel/secdata-raw",
        filename=f"raw_docs_chunk_{i:03d}.jsonl",
        repo_type="dataset",
    )
    with open(path) as f:
        for line in f:
            doc = json.loads(line)
            # process doc

Safety methodology

secdata-raw is the raw collection only. Safety filtering and content review are applied in the conversion phase (v2.0, not included in this release).

The conversion pipeline implements a three-layer safety architecture documented in the pipeline repository (see SAFETY.md):

  1. Converter system prompt — The LLM converting raw documents into instruction-response pairs is prompted with explicit framing rules: offensive techniques must connect to defensive applications, attack content must be contextualized in authorized environments (CTF, pentest, research), and pure operational attack instructions are refused.

  2. Post-conversion regex validatorsafety_validator.py checks each LLM-generated example against patterns for operational attack content (instructions targeting named real systems, step-by-step attacks on specific victims, doxxing patterns, ransom-note templates). Matches are rejected unless they show offsetting indicators of authorized/educational/defensive framing.

  3. Quality filter — General quality filtering catches additional safety issues as a side effect of filtering vague, poorly-framed, or instruction-violating outputs.

This methodology is one of the first openly-documented attempts to operationalize dual-use safety considerations in cybersecurity training data. Users fine-tuning on secdata-raw directly (without applying the pipeline) take on responsibility for their own safety filtering. The full converted dataset (secdata v2.0) will include the safety-filtered output.

License

This dataset is released under CC BY-SA 4.0 (Creative Commons Attribution-ShareAlike 4.0 International).

Why share-alike?

The Stack Exchange data dumps (Security.SE, Reverse Engineering.SE, Crypto.SE — 51,256 documents) are themselves licensed under CC BY-SA 4.0. Stack Exchange's terms require derivative works to be released under a compatible share-alike license, so the entire dataset adopts CC BY-SA 4.0.

Upstream source licenses

All sources were scraped under their existing licenses with attribution preserved. Notable upstream licensing:

  • NVD, CWE, CAPEC, MITRE ATT&CK: U.S. government public domain or Apache 2.0
  • GitHub Security Advisories: CC0
  • ExploitDB: GPL-2.0
  • Stack Exchange dumps: CC BY-SA 4.0
  • Most GitHub repository content: MIT/Apache/GPL per individual repo (URL preserved in each document for attribution)
  • Vendor advisories: each vendor's published terms
  • YARA / Sigma rules: predominantly MIT/Apache/GPL

A full sources manifest is in sources_manifest.json.

Attribution requirements

When using this dataset, please cite:

  • This dataset (secdata-raw)
  • The original upstream sources where applicable (per-document url field provides direct references)

How to cite

@dataset{yourdeardaniel_secdata_raw_2026,
  author       = {yourdeardaniel},
  title        = {secdata-raw: A multi-source raw corpus for cybersecurity language models},
  year         = {2026},
  publisher    = {Hugging Face},
  version      = {1.0.0},
  url          = {https://huggingface.co/datasets/deardaniel/secdata-raw},
  note         = {Raw collection from 50+ public security sources, CC BY-SA 4.0}
}

What's next

secdata-raw is version 1.0 — the raw scraped collection. The roadmap:

  • v1.x — bug fixes and additional sources. Several documented scraper bugs prevent recovery of additional sources (Project Zero migration, Ubuntu 504 retry, OSV bulk download, CTFtime parsing). See the scraper repository's TODO. PRs welcome.
  • v2.0 — secdata (converted). An LLM-based pipeline converts raw documents into ~500K–1M instruction-response training pairs, applies the three-layer safety filtering described above, deduplicates, and quality-filters. This is the version intended for fine-tuning. Release pending compute resources.
  • v2.x — reference fine-tune and evaluation. A reference model fine-tuned on secdata v2.0 plus an evaluation suite for measuring downstream model quality.

Known limitations

Honest about what didn't work and what's incomplete:

  • Coverage is uneven by topic. GitHub repo markdown dominates (86%). Domains like cryptography, mobile security, and cloud security are represented but thinly. Future versions will rebalance via filtering or targeted re-scraping.
  • arXiv full-text papers (~16 documents) is far below the intended ~15K-25K. The arxiv.org API rate-limited the scraper IP and a fix is documented but not deployed; this source should be re-run from a different IP in a future version.
  • Ubuntu Security Notices (~320 documents) is partial. Ubuntu's API returned an HTTP 504 Gateway Timeout mid-scrape and the scraper does not currently retry. Fix documented in the scraper repository.
  • Some sources returned zero documents: OSV (wrong API endpoint usage — the bulk download approach is needed instead), CTFtime (CSS selectors no longer match), HackerOne (now requires authentication), Project Zero (migrated to issues.chromium.org). All documented in scraper TODO.
  • No deduplication has been applied to the raw collection. Near-duplicates exist within and across sources (e.g., a CVE referenced in NVD, GHSA, vendor advisories, and Stack Exchange answers). Deduplication is part of the v2.0 pipeline.
  • No content safety filtering has been applied to the raw collection. This is the raw scrape. Safety filtering is in the v2.0 conversion pipeline. Use raw v1.0 at your own discretion.
  • PII scrubbing was attempted at collection but not exhaustively verified. Documents include a _had_credentials_scrubbed field indicating whether the scraper detected and redacted credential-like patterns; however, no systematic PII audit has been performed.

Intended use

secdata-raw is intended for:

  • Research on security-aware language models
  • Building security-fine-tuned models for defensive applications (incident response, vulnerability triage, detection rule synthesis, security education)
  • Methodology research on dual-use dataset construction
  • Replication and extension of the conversion pipeline

secdata-raw is not intended for:

  • Training models with the goal of producing operational attack assistance
  • Applications that lack their own content filtering and safety review

This is publicly available, openly licensed security knowledge. It is dual-use by nature. Downstream users are responsible for applying appropriate safety measures when fine-tuning and deploying models.

Source repositories

The exact scraper version that produced this dataset is tagged as v1.0.0 on GitHub.

Contact & contributions

For technical questions, bug reports, or contributions:

If you identify specific documents that should be removed for safety or licensing reasons, please open an issue with the document content (or its URL/hash) and a description of the concern. Examples that are genuinely harmful or improperly licensed will be removed from future dataset versions.

Acknowledgments

This dataset would not exist without the open-source security community. Every source listed above represents work by researchers, engineers, and practitioners who chose to publish their knowledge openly. The 50+ sources in this dataset are themselves the product of thousands of contributors. Particular thanks to the maintainers of NVD, MITRE ATT&CK, the Linux kernel, the Sigma and YARA rule projects, OWASP, the Stack Exchange security communities, and the maintainers of every GitHub repository whose documentation appears in this corpus.


Released May 2026. Built independently. Comments and contributions welcome.

Downloads last month
37