Skip to content

Commit db12893

Browse files
Enhance human link support (#2031)
Support more complex human-friendly upstream bug URLs by allowing templating rather than simple appending of the the bug ID to a URL. This allows AlmaLinux and Curl human-friendly links to be added to the frontend UI in addition the what's already there. Also add an FAQ about data fixes, which can be referenced from the bug template
1 parent 3a4727b commit db12893

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

docs/faq.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Vulnerability databases can also benefit from easier interchange and vulnerabili
8080

8181
Yes!
8282

83-
The database in available in a GCS bucket maintained by OSV: [gs://osv-vulnerabilities](https://osv-vulnerabilities.storage.googleapis.com/) (also [publicly browseable via the Google Cloud Console](https://console.cloud.google.com/storage/browser/osv-vulnerabilities) with a login)
83+
The database in available in a GCS bucket maintained by OSV: [gs://osv-vulnerabilities](https://storage.googleapis.com/osv-vulnerabilities/index.html) (also [publicly browseable via the Google Cloud Console](https://console.cloud.google.com/storage/browser/osv-vulnerabilities) with a login)
8484

8585
More information about how to download the database is available [here](data.md#data-dumps).
8686

@@ -111,3 +111,23 @@ If you work on a project (like a Linux distribution) and would like to contribut
111111
## Is the API rate limited?
112112

113113
No. Currently there is not a limit on the API.
114+
115+
## I've found something wrong with the data
116+
117+
Data quality is very important to us. Please remember that OSV.dev is an
118+
aggregator of OSV records from a [variety of
119+
sources](https://github.com/google/osv.dev/blob/master/source.yaml) and the most
120+
appropriate place to correct the data is at the source.
121+
122+
We prefer to avoid needing to act as a broker between downstream consumers of
123+
the data and upstream sources, as this adds limited value, and only adds delays.
124+
125+
Where available, a human-friendly link to the authoritative record source is
126+
available as the `Source` field on the individual vulnerability page. You should
127+
follow the source-specific process for updating the data.
128+
129+
For sources that are a Git repository, the `Import Source` field points to the
130+
authoritative source of the data, and you may be able to create a pull/merge
131+
request or file an issue against the repository.
132+
133+
If you are not able to get satisfaction after dealing directly with the source of the data, please [file an issue](https://github.com/google/osv.dev/issues?q=is%3Aissue+is%3Aopen+label%3A%22data+quality%22) tagged with `data quality`.

gcp/appengine/frontend_handlers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from flask import Blueprint
2424
from flask import make_response
2525
from flask import redirect
26-
from flask import render_template
26+
from flask import render_template, render_template_string
2727
from flask import request
2828
from flask import url_for
2929
from flask import send_from_directory
@@ -300,7 +300,10 @@ def add_source_info(bug, response):
300300
response['source'] = source_repo.link + source_path
301301
response['source_link'] = response['source']
302302
if source_repo.human_link:
303-
response['human_source_link'] = source_repo.human_link + bug.id()
303+
ecosystems = bug.ecosystem
304+
bug_id = bug.id()
305+
response['human_source_link'] = render_template_string(
306+
source_repo.human_link, ECOSYSTEMS=ecosystems, BUG_ID=bug_id)
304307

305308

306309
def _commit_to_link(repo_url, commit):

source.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
bucket: debian-osv
9595
db_prefix: DLA-
9696
ignore_git: True
97+
human_link: 'https://security-tracker.debian.org/tracker/'
9798
link: https://storage.googleapis.com/debian-osv/
9899
editable: False
99100

@@ -119,6 +120,7 @@
119120
bucket: debian-osv
120121
db_prefix: DTSA-
121122
ignore_git: True
123+
human_link: 'https://security-tracker.debian.org/tracker/'
122124
link: https://storage.googleapis.com/debian-osv/
123125
editable: False
124126

source_test.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
extension: '.json'
1010
db_prefix: 'ALBA-'
1111
ignore_git: False
12+
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
1213
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
1314
editable: False
1415

@@ -22,6 +23,7 @@
2223
extension: '.json'
2324
db_prefix: 'ALEA-'
2425
ignore_git: False
26+
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
2527
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
2628
editable: False
2729

@@ -35,6 +37,7 @@
3537
extension: '.json'
3638
db_prefix: 'ALSA-'
3739
ignore_git: False
40+
human_link: 'https://errata.almalinux.org/{{ ECOSYSTEMS[1].split(":")[1] }}/{{ BUG_ID | replace(":", "-", 1) }}.html'
3841
link: 'https://github.com/AlmaLinux/osv-database/blob/master/'
3942
editable: False
4043

@@ -71,6 +74,7 @@
7174
extension: '.json'
7275
db_prefix: 'CURL-'
7376
ignore_git: True
77+
human_link: 'https://curl.se/docs/{{ BUG_ID | replace("CURL-", "") }}.html'
7478
link: 'https://curl.se/docs/'
7579
editable: False
7680

@@ -83,7 +87,7 @@
8387
bucket: 'osv-test-cve-osv-conversion'
8488
db_prefix: 'CVE-'
8589
ignore_git: False
86-
human_link: 'https://nvd.nist.gov/vuln/detail/'
90+
human_link: 'https://nvd.nist.gov/vuln/detail/{{ BUG_ID }}'
8791
link: 'https://storage.googleapis.com/osv-test-cve-osv-conversion/'
8892
editable: False
8993

@@ -96,6 +100,7 @@
96100
bucket: 'osv-test-debian-osv'
97101
db_prefix: 'DLA-'
98102
ignore_git: True
103+
human_link: 'https://security-tracker.debian.org/tracker/{{ BUG_ID }}'
99104
link: 'https://storage.googleapis.com/debian-osv/'
100105
editable: False
101106

@@ -108,7 +113,7 @@
108113
bucket: 'osv-test-debian-osv'
109114
db_prefix: 'DSA-'
110115
ignore_git: True
111-
human_link: 'https://security-tracker.debian.org/tracker/'
116+
human_link: 'https://security-tracker.debian.org/tracker/{{ BUG_ID }}'
112117
link: 'https://storage.googleapis.com/debian-osv/'
113118
editable: False
114119

@@ -121,6 +126,7 @@
121126
bucket: 'osv-test-debian-osv'
122127
db_prefix: 'DTSA-'
123128
ignore_git: True
129+
human_link: 'https://security-tracker.debian.org/tracker/{{ BUG_ID }}'
124130
link: 'https://storage.googleapis.com/debian-osv/'
125131
editable: False
126132

@@ -133,7 +139,7 @@
133139
extension: '.json'
134140
db_prefix: 'GHSA-'
135141
ignore_git: True
136-
human_link: 'https://github.com/advisories/'
142+
human_link: 'https://github.com/advisories/{{ BUG_ID }}'
137143
link: 'https://github.com/github/advisory-database/blob/main/'
138144
editable: False
139145

@@ -147,7 +153,7 @@
147153
bucket: 'go-vulndb'
148154
db_prefix: 'GO-'
149155
ignore_git: True
150-
human_link: 'https://pkg.go.dev/vuln/'
156+
human_link: 'https://pkg.go.dev/vuln/{{ BUG_ID }}'
151157
link: 'https://vuln.go.dev/'
152158
editable: False
153159

@@ -236,7 +242,7 @@
236242
extension: '.json'
237243
db_prefix: 'RUSTSEC-'
238244
ignore_git: False
239-
human_link: 'https://rustsec.org/advisories/'
245+
human_link: 'https://rustsec.org/advisories/{{ BUG_ID }}'
240246
link: 'https://github.com/rustsec/advisory-db/blob/osv/'
241247
editable: False
242248
repo_username: 'git'
@@ -277,5 +283,4 @@
277283
link: 'https://github.com/cloudsecurityalliance/gsd-database/blob/main/'
278284
editable: False
279285
key_path: 'OSV'
280-
repo_username: 'git'
281-
286+
repo_username: 'git'

0 commit comments

Comments
 (0)