Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 50 additions & 178 deletions gcp/workers/importer/importer.py

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions gcp/workers/importer/importer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,45 +119,6 @@ def test_nop(self, mock_publish: mock.MagicMock):

mock_publish.assert_not_called()

@mock.patch('google.cloud.pubsub_v1.PublisherClient.publish')
def test_scheduled_updates_already_done(self, mock_publish): # pylint: disable=unused-argument
"""Scheduled updates already done."""
# TODO(michaelkedar): This test doesn't check anything
self.skipTest("Not Implemented")
source_repo = osv.SourceRepository.get_by_id('oss-fuzz')
source_repo.last_update_date = importer.utcnow()
source_repo.put()

self.mock_repo.add_file('proj/OSV-2021-1337.yaml', _MIN_VALID_VULNERABILITY)
self.mock_repo.commit('OSV', 'infra@osv.dev')
osv.Bug(
db_id='OSV-2021-1337',
project=['proj'],
fixed='',
status=1,
source_id='oss-fuzz:123',
source_of_truth=osv.SourceOfTruth.SOURCE_REPO,
timestamp=datetime.datetime(
2020, 1, 1, 0, 0, 0, 0, tzinfo=datetime.UTC)).put()

imp = importer.Importer('fake_public_key', 'fake_private_key', self.tmp_dir,
importer.DEFAULT_PUBLIC_LOGGING_BUCKET, 'bucket',
True, False)
imp.run()

@mock.patch('google.cloud.pubsub_v1.PublisherClient.publish')
def test_no_updates(self, mock_publish): # pylint: disable=unused-argument
"""Test no update marker."""
# TODO(michaelkedar): This test doesn't check anything
self.skipTest("Not Implemented")
self.mock_repo.add_file('2021-111.yaml', _MIN_VALID_VULNERABILITY)
self.mock_repo.commit('User', 'user@email', 'message. OSV-NO-UPDATE')

imp = importer.Importer('fake_public_key', 'fake_private_key', self.tmp_dir,
importer.DEFAULT_PUBLIC_LOGGING_BUCKET, 'bucket',
True, False)
imp.run()

@mock.patch('google.cloud.pubsub_v1.PublisherClient.publish')
def test_ignore(self, mock_publish): # pylint: disable=unused-argument
"""Test ignoring."""
Expand Down
254 changes: 0 additions & 254 deletions gcp/workers/mock_test/rest_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3384,259 +3384,5 @@
}
],
"details": "When doing HTTP(S) transfers, libcurl might erroneously use the read callback\n(`CURLOPT_READFUNCTION`) to ask for data to send, even when the\n`CURLOPT_POSTFIELDS` option has been set, if the same handle previously was\nused to issue a `PUT` request which used that callback.\n\nThis flaw may surprise the application and cause it to misbehave and either\nsend off the wrong data or use memory after free or similar in the subsequent\n`POST` request.\n\nThe problem exists in the logic for a reused handle when it is changed from a\nPUT to a POST."
},
{
"schema_version": "1.6.7",
"id": "RHSA-2018:3140",
"related": [
"CVE-2015-9381",
"CVE-2015-9382",
"CVE-2017-2862",
"CVE-2017-18267",
"CVE-2018-4121",
"CVE-2018-4200",
"CVE-2018-4204",
"CVE-2018-10733",
"CVE-2018-10767",
"CVE-2018-10768",
"CVE-2018-11712",
"CVE-2018-11713",
"CVE-2018-12910",
"CVE-2018-13988",
"CVE-2018-14036"
],
"published": "2024-09-16T01:35:05Z",
"modified": "2024-09-16T01:35:05Z",
"summary": "Red Hat Security Advisory: GNOME security, bug fix, and enhancement update",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
}
],
"affected": [
{
"package": {
"name": "PackageKit",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-command-not-found",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-command-not-found"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-cron",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-cron"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-debuginfo",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-debuginfo"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-glib",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-glib"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-glib-devel",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-glib-devel"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-gstreamer-plugin",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-gstreamer-plugin"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-gtk3-module",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-gtk3-module"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-yum",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-yum"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"name": "PackageKit-yum-plugin",
"ecosystem": "Red Hat:enterprise_linux:7::client",
"purl": "pkg:rpm/redhat/PackageKit-yum-plugin"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0:1.1.10-1.el7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-13988"
},
{
"type": "REPORT",
"url": "https://access.redhat.com/security/cve/CVE-2018-14036"
},
{
"type": "REPORT",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1601019"
},
{
"type": "ADVISORY",
"url": "https://www.cve.org/CVERecord?id=CVE-2018-14036"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-14036"
}
]
}
]
1 change: 0 additions & 1 deletion gcp/workers/oss_fuzz_worker/testdata

This file was deleted.

Loading
Loading