Skip to content

Commit 6fb98b7

Browse files
committed
Add link for pip-audit & example input variant
1 parent 2d2b85c commit 6fb98b7

File tree

1 file changed

+58
-4
lines changed

1 file changed

+58
-4
lines changed

doc/design.rst

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,68 @@ _________________
196196
security-issues
197197
^^^^^^^^^^^^^^^
198198
The `security-issues/action.yml` creates GitHub Issues for known vulnerabilities
199-
for `maven` and `pip-audit`.
199+
for `maven` and `pip-audit <https://pypi.org/project/pip-audit/>`_.
200200
The following steps are taken:
201201

202202
1. Convert a JSON of known vulnerabilities into a common format (`class Issue`)
203203
2. Filter out vulnerabilities which already have an existing GitHub Issue via CVE
204204
3. Create new GitHub Issues
205205
4. Return a JSON of the newly created GitHub Issues
206206

207+
Input variants
208+
~~~~~~~~~~~~~~
209+
An input variant would be passed in as a string-encoded JSON.
210+
211+
`maven` (via `mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate`)
212+
213+
.. code-block:: json
214+
215+
{
216+
"vulnerable": {
217+
"<package_name>@<package_version>:compile": {
218+
"coordinates": "<package_name>@<package_version>",
219+
"description": "<package_description>",
220+
"reference": "<oss_url_for_vuln>",
221+
"vulnerabilities": [
222+
{
223+
"id": "<vuln_id>",
224+
"displayName": "<vuln_name>",
225+
"title": "<vuln_title>",
226+
"description": "<vuln_description>",
227+
"cvssScore": 7.5,
228+
"cvssVector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
229+
"cwe": "<cwe_vuln_id>",
230+
"cve": "<cve_vuln_id>",
231+
"reference": "<oss_url_for_vuln>",
232+
"externalReferences": ["<vuln_reference_url>"],
233+
}
234+
],
235+
},
236+
}
237+
}
238+
239+
`pip-audit` (via `nox -s dependency:audit`)
240+
241+
.. code-block:: json
242+
243+
{
244+
"dependencies": [
245+
{
246+
"name": "<package_name>",
247+
"version": "<package_version>",
248+
"vulns":
249+
[
250+
{
251+
"id": "<vuln_id>",
252+
"fix_versions": ["<fix_version>"],
253+
"aliases": ["<vuln_id2>"],
254+
"description": "<vuln_description>"
255+
}
256+
]
257+
}
258+
]
259+
}
260+
207261
Known Issues
208262
~~~~~~~~~~~~~
209263
The `security-issues/action.yml` assumes that eventually every known vulnerability will
@@ -216,9 +270,9 @@ be associated with a singular CVE.
216270
* Additionally, reporting tools like `pip-audit` must link a vulnerability with the
217271
different vulnerability IDs from different reporting services. Typically, this is done
218272
by selecting 1 of the vulnerability IDs as the unique identifier of the vulnerability.
219-
This, as is the case for `pip-audit`, is not the CVE, so it is possible if the linked
220-
vulnerability IDs were to change (i.e. wrongly linked CVE) that we could end up with
221-
multiple GitHub Issues for the same underlying vulnerability.
273+
This, as is the case for `pip-audit`, may not be the CVE, so it is possible if the
274+
linked vulnerability IDs were to change (i.e. wrongly linked CVE) that we could end
275+
up with multiple GitHub Issues for the same underlying vulnerability.
222276

223277

224278
Known Issues

0 commit comments

Comments
 (0)