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

Retire rest-nvd #445

Closed
henrikplate opened this issue Oct 10, 2020 · 5 comments
Closed

Retire rest-nvd #445

henrikplate opened this issue Oct 10, 2020 · 5 comments

Comments

@henrikplate
Copy link
Contributor

The NVD offers a REST API to consume CVE information, e.g., https://services.nvd.nist.gov/rest/json/cve/1.0/CVE-2015-5611. This makes Steady's Python service rest-nvd obsolete, and its removal from the repository and the Docker compose file would simplify both the repository and the runtime.

Describe the solution you'd like

  • Change callers of rest-nvd to consume the NVD service
  • Remove rest-nvd from the repository
@copernico
Copy link
Contributor

Keep in mind that while the data structure of the json returned by the service at https://services.nvd.nist.gov/rest/json/cve/1.0/
is identical to rest-nvd, the data returned by the former is nested in a structure of which one would need to discart a couple of levels, in order to remain compatible with the current code.

BTW: I've just copy-pasted-adapted the rest-nvd code to use it in Prospector where I have done the opposite move (drop the dependency on services.nvd.nist.gov in favor of the self-contained solution)

@henrikplate
Copy link
Contributor Author

henrikplate commented Apr 15, 2021

What was your motivation to move from https://services.nvd.nist.gov/rest/json/cve/1.0/ to rest-nvd?

@copernico
Copy link
Contributor

copernico commented Apr 15, 2021

Avoid maintaining a component that is redundant since the service is offered for free from NVD.

In project-kb the opposite move makes sense instead, because there we need to download all the feeds anyway (e.g., to train ML models on the whole dataset from the NVD), so serving those feeds from local is no-brainer. Also, the rest-nvd code is a single file that blends nicely (one extra .py file) with the other endpoints of Prospector: https://github.com/SAP/project-kb/tree/prospector-assuremoss/prospector/api/routers

@henrikplate
Copy link
Contributor Author

I see, it seems you even added some user management when adapting the code for Prospector.

In fact, the switch to https://services.nvd.nist.gov/rest/json/cve/1.0/ is as easy as setting vulas.shared.cve.serviceUrl="https://services.nvd.nist.gov/rest/json/cve/1.0/<ID> and changing a few lines in class CveReader2 to account the above-mentioned nesting.

@copernico
Copy link
Contributor

I see, it seems you even added some user management when adapting the code for Prospector.

Yes, fastAPI, the python framework I use there, make it dead easy, so why not :-)

In fact, the switch to https://services.nvd.nist.gov/rest/json/cve/1.0/ is as easy as setting vulas.shared.cve.serviceUrl="https://services.nvd.nist.gov/rest/json/cve/1.0/<ID> and changing a few lines in class CveReader2 to account the above-mentioned nesting.

Yes, that's what I expected, in project-kb I will actually change the json returned by my code to be nested in the same way as the NVD service, so that the two are actually fully interchangable.

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

No branches or pull requests

2 participants