Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send severity data along with vulnerability in bulk api #369

Merged
merged 13 commits into from
Mar 11, 2021
Merged

Conversation

sbs2001
Copy link
Collaborator

@sbs2001 sbs2001 commented Mar 5, 2021

Fix #351
Signed-off-by: Shivam Sandbhor [email protected]

@sbs2001 sbs2001 changed the title [WIP]Send severity data along with vulnerability Send severity data along with vulnerability Mar 6, 2021
@sbs2001 sbs2001 requested a review from pombredanne March 8, 2021 13:02
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
See the proposed changes below for your consideration.

vulnerabilities/api.py Outdated Show resolved Hide resolved
vulnerabilities/api.py Outdated Show resolved Hide resolved
vulnerabilities/api.py Outdated Show resolved Hide resolved
vulnerabilities/api.py Outdated Show resolved Hide resolved
vulnerabilities/tests/test_api.py Outdated Show resolved Hide resolved
vulnerabilities/tests/test_api.py Outdated Show resolved Hide resolved
vulnerabilities/tests/test_api.py Outdated Show resolved Hide resolved
vulnerabilities/tests/test_api.py Show resolved Hide resolved
vulnerabilities/tests/test_api.py Outdated Show resolved Hide resolved
sbs2001 and others added 10 commits March 10, 2021 20:06
Signed-off-by: Shivam Sandbhor <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
Signed-off-by: Shivam Sandbhor <[email protected]>
@sbs2001 sbs2001 merged commit a34b183 into main Mar 11, 2021
@sbs2001 sbs2001 changed the title Send severity data along with vulnerability Send severity data along with vulnerability in bulk api Mar 11, 2021
@sbs2001
Copy link
Collaborator Author

sbs2001 commented Mar 11, 2021

For the POST request to /api/packages/bulk_search with the body as

{
            "purls": [
                "pkg:deb/debian/[email protected]?distro=jessie",
                "pkg:maven/com.datadoghq/[email protected]",
            ]
        }

The response looks like :

[
            {
                "name": "doesnotexist",
                "namespace": "debian",
                "qualifiers": {"distro": "jessie"},
                "resolved_vulnerabilities": [],
                "subpath": None,
                "type": "deb",
                "unresolved_vulnerabilities": [],
                "version": "0.9.7-10",
            },
            {
                "name": "datadog-api-client",
                "namespace": "com.datadoghq",
                "purl": "pkg:maven/com.datadoghq/[email protected]",
                "qualifiers": {},
                "resolved_vulnerabilities": [],
                "subpath": "",
                "type": "maven",
                "version": "1.0.0-beta.7",
                "url": "http://testserver/api/packages/3467",
                "unresolved_vulnerabilities": [
                    {
                        "references": [
                            {
                                "reference_id": "",
                                "scores": [],
                                "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-21331",
                            },
                            {
                                "reference_id": "GHSA-2cxf-6567-7pp6",
                                "scores": [{"scoring_system": "cvssv3.1_qr", "value": "LOW"}],
                                "url": "https://github.com/DataDog/datadog-api-client-java/security/advisories/GHSA-2cxf-6567-7pp6",
                            },
                            {
                                "reference_id": "GHSA-2cxf-6567-7pp6",
                                "scores": [],
                                "url": "https://github.com/advisories/GHSA-2cxf-6567-7pp6",
                            },
                        ],
                        "url": "http://testserver/api/vulnerabilities/60",
                        "vulnerability_id": "CVE-2021-21331",
                    }
                ],

            },
        ]

@pombredanne pombredanne deleted the api-redesign branch March 11, 2021 19:32
@pombredanne
Copy link
Member

@sbs2001 can we add the comment above to the doc?

@sbs2001
Copy link
Collaborator Author

sbs2001 commented Mar 12, 2021

@pombredanne that's already done via d8ce30e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change API to adapt to new models.
2 participants