MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / UbuntuUSNImporter

Class UbuntuUSNImporter

vulnerabilities/importers/ubuntu_usn.py:21–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class UbuntuUSNImporter(Importer):
22 db_url = "https://usn.ubuntu.com/usn-db/database-all.json.bz2"
23 spdx_license_expression = "LicenseRef-scancode-other-permissive"
24 notice = """
25 From: Seth Arnold <seth.arnold@canonical.com>
26 Date: Wed, Jan 25, 2023 at 2:02 AM
27 Subject: Re: [ubuntu-hardened] Usage of Ubuntu Security Data in VulnerableCode
28 To: Tushar Goel <tushar.goel.dav@gmail.com>
29 Cc: <ubuntu-hardened@lists.ubuntu.com>, Philippe Ombredanne <pombredanne@nexb.com>, jmhoran@nexb.com <jmhoran@nexb.com>
30
31
32 On Wed, Jan 11, 2023 at 06:27:38PM +0530, Tushar Goel wrote:
33 > We would like to integrate the Ubuntu usn data[1][2] and
34 > Ubuntu security data (OVAL format)[3] in vulnerablecode[4]
35 > which is a FOSS db of FOSS vulnerability data. We were not
36 > able to know under which license this security data comes.
37 > We would be grateful to have your acknowledgement over usage of
38 > the ubuntu security data in vulnerablecode and have
39 > some kind of licensing declaration from your side.
40
41 Hello Tushar, we do not have an explicit license on this data.
42
43 We share our data with the intention that others will use it. Please
44 feel free to use it for the general furtherance of security.
45
46 Much of the data that&#x27;s contained within our databases is sourced from
47 third parties, who also shared their data with the intention that others
48 will use it. I&#x27;m not sure what it would look like to try to put a license
49 on data that is crowd-sourced from thousands of contributors. (If you were
50 to start such a project today, it&#x27;d probably be one of the first things to
51 formalize. But when CVE was started two decades ago, the primary goal was
52 sharing knowledge and simplifying the vulnerability remediation process,
53 and licensing the data was, as far as I can remember, not considered.
54 Sharing was the goal.)
55
56 I will ask that vulnerablecode 'be nice' to our infrastructure that
57 hosts the databases -- some automated uses of our infrastructure by
58 vulnerability scanner tools has lead to significant load and engineering
59 effort. In general, please prefer a small handful of systems updating
60 mirrors roughly twice a day rather than thousands of hosts pulling
61 data hourly.
62
63 Thanks
64 """
65 importer_name = "Ubuntu USN Importer"
66
67 def advisory_data(self):
68 usn_db = fetch(self.db_url)
69 yield from self.to_advisories(usn_db=usn_db)
70
71 def to_advisories(self, usn_db):
72 for usn in usn_db:
73 usn_data = usn_db[usn]
74 usn_reference = get_usn_reference(usn_data.get("id"))
75 usn_references = []
76 if usn_reference:
77 usn_references = [usn_reference]
78 for cve in usn_data.get("cves", []):

Callers 1

test_ubuntu_usnFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_ubuntu_usnFunction · 0.72