Anonymous_User Absent Member.
Absent Member.
1715 views

API to fetch info about Rpms for given CVE from SUSE website

I wanted to fetch rpm information for a given CVE from Suse website and list those rpms in an excel using a script. Wanted to know if Suse provides any APIs to do this?

What I wanted to do exactly was that:
- I have a CVE specified.
- For that CVE, I wanted to get all the rpm details & "product names" mentioned in the website & populate this data into an Excel.

For eg: Given "CVE-2016-0264", I wanted to write a script which would populate the associated rpms & product names available in the website and populate that data in an excel sheet.

So for CVE-2016-0264, I want to populate data available in the following link into an excel : https://www.suse.com/security/cve/CVE-2016-0264.html

Specifically, I want to fetch info from "Product(s)" and "Fixed package version(s)" columns.

Are any APIs made available from SUSE to allow me to fetch rpm details and product names, given that I have the CVE number?

If any other method to populate the rpm data (given I have the CVE no.) into an Excel is recommended, I would be happy to learn about it.
Any info on the matter would be helpful!

Thanks guys!
Labels (1)
0 Likes
6 Replies
Knowledge Partner
Knowledge Partner

Re: API to fetch info about Rpms for given CVE from SUSE website

On 05/01/17 09:36, shreyank13 wrote:

> I wanted to fetch rpm information for a given CVE from Suse website and
> list those rpms in an excel using a script. Wanted to know if Suse
> provides any APIs to do this?
>
> What I wanted to do exactly was that:
> - I have a CVE specified.
> - For that CVE, I wanted to get all the rpm details & "product names"
> mentioned in the website & populate this data into an Excel.
>
> For eg: Given "CVE-2016-0264", I wanted to write a script which would
> populate the associated rpms & product names available in the website
> and populate that data in an excel sheet.
>
> So for CVE-2016-0264, I want to populate data available in the following
> link into an excel :
> https://www.suse.com/security/cve/CVE-2016-0264.html
>
> Specifically, I want to fetch info from "Product(s)" and "Fixed package
> version(s)" columns.
>
> Are any APIs made available from SUSE to allow me to fetch rpm details
> and product names, given that I have the CVE number?
>
> If any other method to populate the rpm data (given I have the CVE no.)
> into an Excel is recommended, I would be happy to learn about it.
> Any info on the matter would be helpful!


Whilst I suspect SUSE's CVE web pages may be created from information in
a database I don't believe that's publicly accessible (hence the web
pages). What I think you'll have to do is write a script which reads (or
fetches then processes) the web page pulling out the information you
want and creates a file you can use with Excel, possibly in CSV format.

HTH.
--
Simon
Micro Focus Knowledge Partner

------------------------------------------------------------------------
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below. Thanks.
------------------------------------------------------------------------
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: API to fetch info about Rpms for given CVE from SUSE web

Essentially web scraping right? Only reason I was a little cynical to go in that direction was that I'd need to change my script with updated element IDs every time SUSE refreshes their web page.
But thank you for your response Simon. Needed to evaluate if the API way is even possible. Maybe I'll have to resort to web-scraping afterall.

Shreyank
0 Likes
Knowledge Partner
Knowledge Partner

Re: API to fetch info about Rpms for given CVE from SUSE website

On 05/01/17 12:16, shreyank13 wrote:

> Essentially web scraping right? Only reason I was a little cynical to go
> in that direction was that I'd need to change my script with updated
> element IDs every time SUSE refreshes their web page.
> But thank you for your response Simon. Needed to evaluate if the API way
> is even possible. Maybe I'll have to resort to web-scraping afterall.


Yes essentially you're web scraping - the easy part is grabbing the web
page with the processing a bit more work. For my own curiosity I have
written a very rough Perl script that can fetch the page for a
particular CVE ID then output a CSV file of products and fixed package
versions - happy to share if it will help.

HTH.
--
Simon
Micro Focus Knowledge Partner

------------------------------------------------------------------------
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below. Thanks.
------------------------------------------------------------------------
Anonymous_User Absent Member.
Absent Member.

Re: API to fetch info about Rpms for given CVE from SUSE web

That would be really helpful Simon. Seeing how you're doing it would help get me started.
Thanks for taking the time for this.

Shreyank
0 Likes
Knowledge Partner
Knowledge Partner

Re: API to fetch info about Rpms for given CVE from SUSE web

smflood;2448076 wrote:
I have written a very rough Perl script that can fetch the page for a particular CVE ID then output a CSV file of products and fixed package versions - happy to share if it will help.

This sounds like something that others may be interested in.

Would you consider posting it to this forum?
_____
Kevin Boyle - Knowledge Partner - Calgary, Alberta, Canada
Who are the Knowledge Partners?
If you appreciate my comments, please click the Like button.
If I have resolved your issue, please click the Accept as Solution button.
0 Likes
Knowledge Partner
Knowledge Partner

Re: API to fetch info about Rpms for given CVE from SUSE website


On Mon 09 Jan 2017 03:46:03 PM CST, KBOYLE wrote:

smflood;2448076 Wrote:
> I have written a very rough Perl script that can fetch the page for a
> particular CVE ID then output a CSV file of products and fixed package
> versions - happy to share if it will help.

This sounds like something that others may be interested in.

Would you consider posting it to this forum?




Hi
Here is one I wrote for an openSUSE forum user a few years ago to get
data and put it into an excel spreadsheet... I'm sure it can be tweaked
to get the table data..

http://paste.opensuse.org/b27ef832

You do need to add a few additional perl modules from the
devel:languages:perl repo.

--
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.36-44-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!

--
Cheers Malcolm °¿° SUSE Knowledge Partner
SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
If you appreciate what I've posted, click the LIKE button below. If this
solves your problem, please click the ACCEPT AS SOLUTION button.
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.