On exhibit · LinkML schema
Common Attack Pattern Enumeration and Classification (CAPEC)
A LinkML model of the CAPEC catalogue. It keeps the keys and listed values of the catalogue's XML Schema, so the catalogue validates as MITRE spells it once scripts/capec_to_json.py has turned it into data.
- 28classes
- 16enumerations
- 88slots
- 26types
CapecAlternateTermAnother name by which an attack pattern is known.CapecAttackPatternA catalogued way that adversaries go about an attack, with what it takes and how to resist …CapecAttackPatternCatalogOne release of the whole catalogue, with its entries and the references they share.CapecAttackStepOne step of the way an adversary typically carries out an attack.CapecCategoryA group of attack patterns that share an effect or intent, and not itself a pattern of …CapecConsequenceOne thing that can happen if an attack succeeds.
capec#
Common Attack Pattern Enumeration and Classification (CAPEC) 3.9 (LinkML)
Only want to ask? Install
ktl-docentinto any agent you use, by a route from the install page, and ask it about this project. It answers from the bundle and says how far each answer has been checked.Agents: if
.lokf/knowledge/index.mdexists, read it first.llms.txtsays how to weigh it.
Documentation Website#
https://lmodel.github.io/capec
What it models#
The schema renders CAPEC, the catalogue of attack patterns that The MITRE Corporation publishes, at version 3.9 of 24 January 2023 under its XML Schema (XSD) version 3.5. It keeps the XSD’s keys and listed values, so the whole catalogue validates as MITRE spells it once scripts/capec_to_json.py has turned the XML into data. That is MITRE’s latest catalogue, and its latest news item is from March 2023. No page says CAPEC has stopped, so a weekly workflow goes on asking.
upstream/ holds the XSD and the catalogue, pinned by hash, and tests/test_coverage.py holds the schema to the XSD in both directions. docs/index.md says how to validate a catalogue, and what the model leaves out.
Mappings#
The schema is the one home for mappings, and tests/test_mappings.py holds each to a pinned term list or a released copy.
- lmodel/stix:
close_mappingsfor an attack pattern, an external reference and alternate terms, andrelated_mappingsfrom mitigations to a course of action. - lmodel/attack:
related_mappingsfrom an attack pattern to a technique. - lmodel/cwe:
related_mappingsfrom the link to a weakness and its number, andclose_mappingson an external reference.tests/test_catalogue.pyholds the 1212 pairs both catalogues name. - SEPSES CAPEC ontology:
close_mappingsfor attack patterns and the records and fields they hold. - SKOS:
close_mappingsfor a pattern, a category, the catalogue, a taxonomy mapping and its fit, and for the parent and child natures. - Dublin Core and schema.org:
close_mappingsfor names, dates, descriptions and reference fields, andbroad_mappingsfor the identifiers. - Wikidata:
related_mappingson the catalogue to Q2986817, which is the catalogue in general and not one release, andexact_mappingson a weakness’s number to the property P3624.
Repository Structure#
- docs/: the website’s own pages
- project/: generated project files (do not edit them)
- scripts/: the XML converter, the upstream watch and the mapping term extractor
- src/capec/schema/: the LinkML schema,
capec.yaml,capec_entries.yamlandcapec_core.yaml(edit these) - src/capec/datamodel/: the generated Python datamodel
- tests/: Python tests, with example data in data/, the term list in upstream/ and the neighbours’ adapt copies in neighbours/
- upstream/: MITRE’s XSD and catalogue at the pinned version, unchanged
- website/: the Hugo site built from the README,
docs/, the schema’s pages and the knowledge bundle
Developer Tools#
Run just to list the project’s just recipes.
Knowledge Trust Ladder (KTL)#
.lokf/ holds this project’s KTL knowledge bundle. Its domain schema, .lokf/schema/capec.yaml, is the copy just lokf-adapt writes from src/capec/schema/capec.yaml, and just lokf-adapt-check says when it is stale. Edit the source, never the copy. A release carries the copy as schema-<tag>-capec.yaml, on the terms CONTRIBUTING.md gives.
The copy roots CapecEntry and CapecExternalReference on Concept. In Obsidian, add the types a concept may name to the Known LOKF types setting of the KTL Registrar and KTL Curator plugins:
CapecAttackPattern, CapecCategory, CapecView, CapecExternalReference
The pen of KTL v0.61.0 compares a frontmatter key with no regard to case, so it takes Status, which the first three types require, for LOKF’s status and refuses it. lokf validate accepts such a concept, so write one of those three by hand until the pen changes.
LOKF’s id takes the place of ID and Reference_ID. Name and Title fold into LOKF’s title, and Description, Summary and Objective fold into its description. The smaller records stay values inside an entry. No key is another released copy’s, since the XSD’s keys open with a capital; tests/test_schema_rules.py fails on a new overlap.
lmodel/cwe’s copy shares 66 keys with this one, such as Status. A host importing both validates each class against its own lists, while the shared keys project under one prefix, cwe:, until lokf adapt can rename what a neighbour copy defines (lokf #169).
License#
The schema and the code are under the Apache License 2.0 (LICENSE), and the knowledge bundle in .lokf/knowledge/ is under CC BY 4.0.
MITRE’s XSD and catalogue come under the CAPEC Terms of Use, which allow a copy that reproduces MITRE’s designation and licence: see NOTICE. This is not a project of MITRE, and its use implies no endorsement by MITRE. CAPEC is a trademark of The MITRE Corporation.
Contributing and security#
CONTRIBUTING.md is the checklist for pull requests and releases, AI_COVENANT.md sets the rules for AI-assisted work, SECURITY.md says how to report a vulnerability, and CHANGELOG.md records the changes.
Credits#
Built from the linkml-project-copier template (doi:10.5281/zenodo.15163584).