Skip to content

Commit

Permalink
Test nginx advisory collection step
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Sep 13, 2024
1 parent c889c35 commit df17977
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

from vulnerabilities import models
from vulnerabilities import severity_systems

# from vulnerabilities.import_runner import ImportRunner
from vulnerabilities.importer import AdvisoryData
from vulnerabilities.importer import Reference
from vulnerabilities.importer import VulnerabilitySeverity
Expand Down Expand Up @@ -153,7 +151,7 @@ def test_collect_advisories(self):
util_tests.check_results_against_json(results, expected_file)

@pytest.mark.django_db(transaction=True)
def test_NginxImporter(self):
def test_NginxImporterPipeline_collect_and_store_advisories(self):
test_file = self.get_test_loc("security_advisories.html")
with open(test_file) as tf:
test_text = tf.read()
Expand All @@ -166,14 +164,12 @@ def test_NginxImporter(self):
)

test_pipeline.collect_and_store_advisories()
test_pipeline.import_new_advisories()

results = list(models.Advisory.objects.all().values(*ADVISORY_FIELDS_TO_TEST))
util_tests.check_results_against_json(results, expected_file)

# run again as there should be no duplicates
test_pipeline.collect_and_store_advisories()
test_pipeline.import_new_advisories()

results = list(models.Advisory.objects.all().values(*ADVISORY_FIELDS_TO_TEST))
util_tests.check_results_against_json(results, expected_file)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"unique_content_id": "335a9c1c00513d109d5437afcc1d48c1",
"unique_content_id": "e06ef4fb12b1b0817736222cc219c5be",
"aliases": [
"CORE-2010-0121"
],
Expand Down Expand Up @@ -36,7 +36,7 @@
"weaknesses": []
},
{
"unique_content_id": "403205c78453abb1a8562d7885adec25",
"unique_content_id": "dab2e1aa4777dbcd579905643982aab1",
"aliases": [
"CVE-2009-3896"
],
Expand Down Expand Up @@ -115,7 +115,7 @@
"weaknesses": []
},
{
"unique_content_id": "96a152603880c03608ed3160e5733267",
"unique_content_id": "91c6638b38a1e6e2ff4997eeefef8cf8",
"aliases": [
"CVE-2009-3898"
],
Expand Down Expand Up @@ -158,7 +158,7 @@
"weaknesses": []
},
{
"unique_content_id": "080bad63555f37591e5c2a51781de2ca",
"unique_content_id": "31675b37fe392d1e36b77f7198b1d008",
"aliases": [
"CVE-2009-4487"
],
Expand Down Expand Up @@ -189,7 +189,7 @@
"weaknesses": []
},
{
"unique_content_id": "3ca06ea9a54809cefa6656b38704b2ab",
"unique_content_id": "ef00adb6af6c2a00e81c8ec8de71eed6",
"aliases": [
"CVE-2010-2263"
],
Expand Down Expand Up @@ -232,7 +232,7 @@
"weaknesses": []
},
{
"unique_content_id": "b1f5ee46c793bc822dacec39d80d542d",
"unique_content_id": "eb41c9a738129f7f76c5ff813d190621",
"aliases": [
"CVE-2010-2266"
],
Expand Down Expand Up @@ -275,7 +275,7 @@
"weaknesses": []
},
{
"unique_content_id": "2cdace68cd16430e631ad7219d545825",
"unique_content_id": "d403898b9315a9ec88d9a401af5352fb",
"aliases": [
"CVE-2011-4315"
],
Expand Down Expand Up @@ -318,7 +318,7 @@
"weaknesses": []
},
{
"unique_content_id": "91b8c592fdc630329d793fa1d44a8d74",
"unique_content_id": "96c2ffdeacca4901942abd83d54f33f5",
"aliases": [
"CVE-2011-4963"
],
Expand Down Expand Up @@ -373,7 +373,7 @@
"weaknesses": []
},
{
"unique_content_id": "9a75aa5a89cbbae37ca7538c369c0cc6",
"unique_content_id": "ca72fb146fcd014ee284ef66f7fc1c08",
"aliases": [
"CVE-2012-1180"
],
Expand Down Expand Up @@ -434,7 +434,7 @@
"weaknesses": []
},
{
"unique_content_id": "5422572f0def3a030c6c840dfbd7845a",
"unique_content_id": "901e1dc04473ff40c6e503baec5e9bf6",
"aliases": [
"CVE-2012-2089"
],
Expand Down Expand Up @@ -495,7 +495,7 @@
"weaknesses": []
},
{
"unique_content_id": "7674897db3c7bef60d4bb82ab799b021",
"unique_content_id": "e74396e2dc204fb095c802fe54d4d176",
"aliases": [
"CVE-2013-2028"
],
Expand Down Expand Up @@ -556,7 +556,7 @@
"weaknesses": []
},
{
"unique_content_id": "5b6107b2a1ff968251c02fe3e1c1eb0d",
"unique_content_id": "13592aaee15657bff9afca8c98edf8bf",
"aliases": [
"CVE-2013-2070"
],
Expand Down Expand Up @@ -647,7 +647,7 @@
"weaknesses": []
},
{
"unique_content_id": "a838eb72eb823421cd94013f304bdb48",
"unique_content_id": "0f21f4e3d88f4af06f0c46d096e90320",
"aliases": [
"CVE-2013-4547"
],
Expand Down Expand Up @@ -714,7 +714,7 @@
"weaknesses": []
},
{
"unique_content_id": "efb0e82dd288eb9903dede418b07858f",
"unique_content_id": "3430956de63de2b1188c3d1e50c3b0cd",
"aliases": [
"CVE-2014-0088"
],
Expand Down Expand Up @@ -763,7 +763,7 @@
"weaknesses": []
},
{
"unique_content_id": "8bb0e5c0fe7b13c7d53359f3f24d5c34",
"unique_content_id": "db01da77157a7a773285dc98169416ec",
"aliases": [
"CVE-2014-0133"
],
Expand Down Expand Up @@ -824,7 +824,7 @@
"weaknesses": []
},
{
"unique_content_id": "d13aedf582d6b74b3932b8abd3e1ca12",
"unique_content_id": "83d5fba07f12acd2e4947e68d233fbe5",
"aliases": [
"CVE-2014-3556"
],
Expand Down Expand Up @@ -891,7 +891,7 @@
"weaknesses": []
},
{
"unique_content_id": "f84fa2467d4df52694234db6bf4c2b76",
"unique_content_id": "ce87032bced3f187b1c0fbacc52b8c16",
"aliases": [
"CVE-2014-3616"
],
Expand Down Expand Up @@ -946,7 +946,7 @@
"weaknesses": []
},
{
"unique_content_id": "8617c237a937fa7ce6cfa99727325a0c",
"unique_content_id": "71c918b8f82b4de8cfa23fc96fa0d7a7",
"aliases": [
"CVE-2016-0742"
],
Expand Down Expand Up @@ -1001,7 +1001,7 @@
"weaknesses": []
},
{
"unique_content_id": "dea85d9db96803b6f30ba88882bac004",
"unique_content_id": "2ec9de991e2cb7a5a0ba79bed8556a41",
"aliases": [
"CVE-2016-0746"
],
Expand Down Expand Up @@ -1056,7 +1056,7 @@
"weaknesses": []
},
{
"unique_content_id": "d13a7fd387ef7873abceecfe5b8e06fd",
"unique_content_id": "925abc90d30273fe8cb404b7f3c8dfd3",
"aliases": [
"CVE-2016-0747"
],
Expand Down Expand Up @@ -1111,7 +1111,7 @@
"weaknesses": []
},
{
"unique_content_id": "49c94274f8f7e56a9123477bd112e433",
"unique_content_id": "04f5bc12ff49a95a29c459222379abe4",
"aliases": [
"CVE-2016-4450"
],
Expand Down Expand Up @@ -1190,7 +1190,7 @@
"weaknesses": []
},
{
"unique_content_id": "2aaefb239df5abb3994785bd40ab71f0",
"unique_content_id": "b3192a372fdac00b2cdf462b562cf73b",
"aliases": [
"CVE-2017-7529"
],
Expand Down Expand Up @@ -1257,7 +1257,7 @@
"weaknesses": []
},
{
"unique_content_id": "0ee0797566ee9e12eb6ca17f8baee5e2",
"unique_content_id": "cb70875e6e02b2d41dd8876b4729bf84",
"aliases": [
"CVE-2018-16843"
],
Expand Down Expand Up @@ -1312,7 +1312,7 @@
"weaknesses": []
},
{
"unique_content_id": "6bb892f5f33e2cff305023723bd1e5a6",
"unique_content_id": "cf47abf58659080601c4cd87a119a769",
"aliases": [
"CVE-2018-16844"
],
Expand Down Expand Up @@ -1367,7 +1367,7 @@
"weaknesses": []
},
{
"unique_content_id": "3c0e6f8b57cec78c5fb2b3eb5d1d75a5",
"unique_content_id": "33d08a513ea5fef861e924f2601f7ac6",
"aliases": [
"CVE-2018-16845"
],
Expand Down Expand Up @@ -1434,7 +1434,7 @@
"weaknesses": []
},
{
"unique_content_id": "bdd084d7f43d425835f08d7ca6c98133",
"unique_content_id": "8ca47577347bd9f2027e09e32bc74866",
"aliases": [
"CVE-2019-9511"
],
Expand Down Expand Up @@ -1489,7 +1489,7 @@
"weaknesses": []
},
{
"unique_content_id": "df932a83ee1d6bd94395b599994807b5",
"unique_content_id": "74ec3c647d544d6e6935492b7dceb572",
"aliases": [
"CVE-2019-9513"
],
Expand Down Expand Up @@ -1544,7 +1544,7 @@
"weaknesses": []
},
{
"unique_content_id": "248fa20c4eb9cf8d32724ac84c6a761d",
"unique_content_id": "2537fa6a9e8e84a3c06bb122fcbf468d",
"aliases": [
"CVE-2019-9516"
],
Expand Down Expand Up @@ -1599,7 +1599,7 @@
"weaknesses": []
},
{
"unique_content_id": "0e4ece79727c13b9656b3bc760bd328d",
"unique_content_id": "27612bc7cab82114b1549552f5ad48ff",
"aliases": [
"CVE-2021-23017"
],
Expand Down Expand Up @@ -1666,7 +1666,7 @@
"weaknesses": []
},
{
"unique_content_id": "81545b256a26a3cccdb05e67b4f3ba9f",
"unique_content_id": "dad2ebc242641f6a276b00769ef57efa",
"aliases": [
"CVE-2022-41741"
],
Expand Down Expand Up @@ -1733,7 +1733,7 @@
"weaknesses": []
},
{
"unique_content_id": "c2e9b6ad436eb4c814337f903f5ec9cf",
"unique_content_id": "e17dde538a78c978602298541bcd29f0",
"aliases": [
"CVE-2022-41742"
],
Expand Down Expand Up @@ -1800,7 +1800,7 @@
"weaknesses": []
},
{
"unique_content_id": "a9abcfac0befee9468fee011889a6a6b",
"unique_content_id": "e4c6a0358264fb7523f6ee40f844854f",
"aliases": [
"CVE-2024-24989"
],
Expand Down Expand Up @@ -1837,7 +1837,7 @@
"weaknesses": []
},
{
"unique_content_id": "8c31279d13d8300df1b3ab830e513911",
"unique_content_id": "f87492771be35866bf4dce017ea54dc8",
"aliases": [
"CVE-2024-24990"
],
Expand Down Expand Up @@ -1874,7 +1874,7 @@
"weaknesses": []
},
{
"unique_content_id": "59f5ec3eeb5b6b9e129ec45f9e386a77",
"unique_content_id": "79d9b38e6e89e3f3fc5ca4b2e64d0faa",
"aliases": [
"CVE-2024-31079"
],
Expand Down Expand Up @@ -1929,7 +1929,7 @@
"weaknesses": []
},
{
"unique_content_id": "86ef110ce63893b73d619a7dc1cc3ac6",
"unique_content_id": "b3d7627b206f561242cdd2eae0e3bbeb",
"aliases": [
"CVE-2024-32760"
],
Expand Down Expand Up @@ -1984,7 +1984,7 @@
"weaknesses": []
},
{
"unique_content_id": "1553b9978e538bf5afdedaf10435783b",
"unique_content_id": "43c2f41bb851164d3495f3c204a57f20",
"aliases": [
"CVE-2024-34161"
],
Expand Down Expand Up @@ -2039,7 +2039,7 @@
"weaknesses": []
},
{
"unique_content_id": "cb2e6f47e81c679c781d1ffa4bbb5b68",
"unique_content_id": "b72c609cd1be7c77f4432e1bc8c365f3",
"aliases": [
"CVE-2024-35200"
],
Expand Down Expand Up @@ -2094,7 +2094,7 @@
"weaknesses": []
},
{
"unique_content_id": "2e3ec84059d55863d2b80db5eeb90b1d",
"unique_content_id": "686399b9012be40d39b5366ec1695768",
"aliases": [
"VU#120541",
"CVE-2009-3555"
Expand Down Expand Up @@ -2150,7 +2150,7 @@
"weaknesses": []
},
{
"unique_content_id": "d5a14ef4e648d1a19b8f5ce8404490bc",
"unique_content_id": "c616b60f7fd802e88ca29fce6222654e",
"aliases": [
"VU#180065",
"CVE-2009-2629"
Expand Down

0 comments on commit df17977

Please sign in to comment.