Skip to content

Send severity data along with vulnerability in bulk api#369

Merged
sbs2001 merged 13 commits intomainfrom
api-redesign
Mar 11, 2021
Merged

Send severity data along with vulnerability in bulk api#369
sbs2001 merged 13 commits intomainfrom
api-redesign

Conversation

@sbs2001
Copy link
Copy Markdown
Collaborator

@sbs2001 sbs2001 commented Mar 5, 2021

Fix #351
Signed-off-by: Shivam Sandbhor shivam.sandbhor@gmail.com

@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
Copy Markdown
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.

Comment thread vulnerabilities/api.py Outdated
Comment thread vulnerabilities/api.py Outdated
Comment thread vulnerabilities/api.py Outdated
Comment thread vulnerabilities/api.py Outdated
Comment thread vulnerabilities/tests/test_api.py Outdated
Comment thread vulnerabilities/tests/test_api.py Outdated
Comment thread vulnerabilities/tests/test_api.py Outdated
Comment thread vulnerabilities/tests/test_api.py
Comment thread vulnerabilities/tests/test_api.py Outdated
sbs2001 and others added 10 commits March 10, 2021 20:06
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
sbs2001 added 2 commits March 10, 2021 20:15
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
@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
Copy Markdown
Collaborator Author

sbs2001 commented Mar 11, 2021

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

{
            "purls": [
                "pkg:deb/debian/doesnotexist@0.9.7-10?distro=jessie",
                "pkg:maven/com.datadoghq/datadog-api-client@1.0.0-beta.7",
            ]
        }

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/datadog-api-client@1.0.0-beta.7",
                "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
Copy Markdown
Member

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

@sbs2001
Copy link
Copy Markdown
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