Add CVE and CWE roles (#11781)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Hugo van Kemenade
2024-10-05 20:44:14 +03:00
committed by GitHub
parent f7fa020cc2
commit 09ab6edde5
5 changed files with 196 additions and 0 deletions

View File

@@ -249,6 +249,34 @@ There is also an :rst:role:`index` role to generate index entries.
The following roles generate external links:
.. rst:role:: cve
A reference to a `Common Vulnerabilities and Exposures`_ record.
This generates appropriate index entries.
The text "CVE *number*\ " is generated;
with a link to an online copy of the specified CVE.
You can link to a specific section by using ``:cve:`number#anchor```.
.. _Common Vulnerabilities and Exposures: https://www.cve.org/
For example: :cve:`2020-10735`
.. versionadded:: 8.1
.. rst:role:: cwe
A reference to a `Common Weakness Enumeration`_.
This generates appropriate index entries.
The text "CWE *number*\ " is generated; in the HTML output,
with a link to an online copy of the specified CWE.
You can link to a specific section by using ``:cwe:`number#anchor```.
.. _Common Weakness Enumeration: https://cwe.mitre.org/
For example: :cwe:`787`
.. versionadded:: 8.1
.. rst:role:: pep
A reference to a Python Enhancement Proposal. This generates appropriate