Skip to content

Commit 18225fa

Browse files
authored
Merge pull request github#4997 from github/shati-patel/cwe-coverage-docs
Docs: Add outline for CWE coverage page
2 parents 66d0bf6 + 6a46be2 commit 18225fa

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

.github/workflows/generate-query-help-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: ammaraskar/sphinx-action@8b4f60114d7fd1faeba1a712269168508d4750d2 # v0.4
5151
with:
5252
docs-folder: "query-help/"
53-
pre-build-command: "python -m pip install --upgrade recommonmark"
53+
pre-build-command: "python -m pip install --upgrade recommonmark && python -m pip install --upgrade sphinx-markdown-tables"
5454
build-command: "sphinx-build -b dirhtml . _build"
5555
- name: Upload HTML artifacts
5656
uses: actions/upload-artifact@v2
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CodeQL CWE coverage
2+
3+
An overview of the coverage of MITRE's Common Weakness Enumeration (CWE) for the latest release of CodeQL.
4+
5+
## About CWEs
6+
7+
The CWE categorization contains several types of entity, collectively known as CWEs. The CWEs that we consider in this report are only those of the types:
8+
9+
- Weakness Class
10+
- Weakness Base
11+
- Weakness Variant
12+
- Compound Element
13+
14+
Other types of CWE do not correspond directly to weaknesses, so are omitted.
15+
16+
The CWE categorization includes relationships between entities, in particular a parent-child relationship.
17+
These relationships are associated with Views (another kind of CWE entity). For the purposes of coverage claims, we use the "[Research View](https://cwe.mitre.org/data/definitions/1000.html)."
18+
19+
Every security query is associated with one or more CWEs, which are the most precise CWEs that are covered by that query.
20+
Overall coverage is claimed for the most-precise CWEs, as well as for any of their ancestors in the View.
21+
22+
## Overview
23+
24+
<!-- autogenerated CWE coverage table will be added below -->
25+

docs/codeql/query-help/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
project = u'CodeQL query help'
2424

2525
# Add md parser to process query help markdown files
26-
extensions =['recommonmark']
26+
extensions = [
27+
'recommonmark',
28+
'sphinx_markdown_tables',
29+
]
2730

2831
source_suffix = {
2932
'.rst': 'restructuredtext',

docs/codeql/query-help/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ View the query help for the queries included in the ``code-scanning``, ``securit
2020
- A link to the query in the `CodeQL repository <https://github.com/github/codeql>`__.
2121
- A description of the potential vulnerability that the query identifies and a recommendation for how to avoid introducing the problem to your code.
2222

23+
24+
For a full list of the CWEs covered by these queries, see ":doc:`CodeQL CWE coverage <codeql-cwe-coverage>`."
25+
2326
.. toctree::
2427
:hidden:
2528
:titlesonly:
@@ -30,4 +33,5 @@ View the query help for the queries included in the ``code-scanning``, ``securit
3033
java
3134
javascript
3235
python
36+
codeql-cwe-coverage
3337

0 commit comments

Comments
 (0)