generated from Ostorlab/template_agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from Ostorlab/fix/dna_include_cve
Include CVEs in the dna
- Loading branch information
Showing
2 changed files
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ def testAgentOSV_whenAnalysisRunsWithoutPathWithContent_processMessage( | |
) | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2022-1941" | ||
) | ||
assert agent_mock[0].data["risk_rating"] == "HIGH" | ||
|
||
|
@@ -244,12 +244,12 @@ def testAgentOSV_whenFingerprintMessage_processMessage( | |
|
||
assert ( | ||
agent_mock[0].data["title"] | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2018-3721, CVE-2018-16487, CVE-2019-1010266, CVE-2019-10744, CVE-2020-8203, CVE-2020-28500, CVE-2021-23337" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2021-23337, CVE-2020-8203, CVE-2020-28500, CVE-2019-10744, CVE-2019-1010266, CVE-2018-3721, CVE-2018-16487" | ||
) | ||
assert agent_mock[0].data["risk_rating"] == "CRITICAL" | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2021-23337,CVE-2020-8203,CVE-2020-28500,CVE-2019-10744,CVE-2019-1010266,CVE-2018-3721,CVE-2018-16487" | ||
) | ||
|
||
|
||
|
@@ -273,11 +273,11 @@ def testAgentOSV_whenRiskLowerCase_doesNotCrash( | |
|
||
assert ( | ||
agent_mock[0].data["title"] | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2018-3721, CVE-2018-16487, CVE-2019-1010266, CVE-2019-10744, CVE-2020-8203, CVE-2020-28500, CVE-2021-23337" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2021-23337, CVE-2020-8203, CVE-2020-28500, CVE-2019-10744, CVE-2019-1010266, CVE-2018-3721, CVE-2018-16487" | ||
) | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2021-23337,CVE-2020-8203,CVE-2020-28500,CVE-2019-10744,CVE-2019-1010266,CVE-2018-3721,CVE-2018-16487" | ||
) | ||
|
||
assert agent_mock[0].data["risk_rating"] == "CRITICAL" | ||
|
@@ -299,7 +299,7 @@ def testAgentOSV_whenRiskLowerCase_doesNotCrash( | |
assert agent_mock[0].data["short_description"] == "Prototype Pollution in lodash" | ||
assert agent_mock[0].data["description"] == ( | ||
"""Dependency `lodash` with version `4.7.11` has a security issue. | ||
The issue is identified by CVEs: `CVE-2018-3721, CVE-2018-16487, CVE-2019-1010266, CVE-2019-10744, CVE-2020-8203, CVE-2020-28500, CVE-2021-23337`.""" | ||
The issue is identified by CVEs: `CVE-2021-23337, CVE-2020-8203, CVE-2020-28500, CVE-2019-10744, CVE-2019-1010266, CVE-2018-3721, CVE-2018-16487`.""" | ||
) | ||
|
||
|
||
|
@@ -334,11 +334,11 @@ def __init__(self, cve_id: str, api_key: str | None = None): | |
|
||
assert ( | ||
agent_mock[0].data["title"] | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2018-3721, CVE-2018-16487, CVE-2019-1010266, CVE-2019-10744, CVE-2020-8203, CVE-2020-28500, CVE-2021-23337" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2021-23337, CVE-2020-8203, CVE-2020-28500, CVE-2019-10744, CVE-2019-1010266, CVE-2018-3721, CVE-2018-16487" | ||
) | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2021-23337,CVE-2020-8203,CVE-2020-28500,CVE-2019-10744,CVE-2019-1010266,CVE-2018-3721,CVE-2018-16487" | ||
) | ||
assert agent_mock[0].data["risk_rating"] == "CRITICAL" | ||
assert ( | ||
|
@@ -374,7 +374,7 @@ def testAgentOSV_always_emitVulnWithValidTechnicalDetail( | |
) | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2019-10061" | ||
) | ||
assert agent_mock[0].data["risk_rating"] == "CRITICAL" | ||
assert ( | ||
|
@@ -470,7 +470,7 @@ def testAgentOSV_whenPathInMessage_technicalDetailShouldIncludeIt( | |
) | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: CVE-2019-10061" | ||
) | ||
assert agent_mock[0].data["risk_rating"] == "CRITICAL" | ||
assert agent_mock[0].data["technical_detail"] == ( | ||
|
@@ -511,7 +511,7 @@ def testAgentOSV_whenElfLibraryFingerprintMessage_shouldExcludeNpmEcosystemVulnz | |
) | ||
assert ( | ||
agent_mock[0].data["dna"] | ||
== "Use of Outdated Vulnerable Component: [email protected]" | ||
== "Use of Outdated Vulnerable Component: [email protected]: " | ||
) | ||
assert agent_mock[0].data["risk_rating"] == "POTENTIALLY" | ||
assert agent_mock[0].data["technical_detail"] == ( | ||
|