cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
684
Views
5
Helpful
2
Replies

Cisco OpenVuln API customization

William Giannattasio
Cisco Employee
Cisco Employee

Being relatively new to scripting, I was wondering if it possible to change the column order when downloading in CSV formation using the API?

1 Accepted Solution

Accepted Solutions

Omar Santos
Cisco Employee
Cisco Employee

Hi William,

You bring an excellent point. The column order does not come from the API, but the openVulnQuery client. You will need to change that "post export".

You are correct. In my example below I do the same query twice and export the output to two CSV files (example_1.csv and example_2.csv). In the second example, I change the order of the "filter" (fields).


bash-3.2$ openVulnQuery --cvrf --latest 2 -f advisory_id sir cves --csv example_1.csv
bash-3.2$
bash-3.2$ cat example_1.csv
advisory_id,sir,cves
cisco-sa-20170419-cimc,High,CVE-2017-6619
cisco-sa-20170419-cimc3,Critical,CVE-2017-6616
bash-3.2$
bash-3.2$
bash-3.2$
bash-3.2$ openVulnQuery --cvrf --latest 2 -f advisory_id cves sir --csv example_2.csv
bash-3.2$ cat example_2.csv
advisory_id,sir,cves
cisco-sa-20170419-cimc,High,CVE-2017-6619
cisco-sa-20170419-cimc3,Critical,CVE-2017-6616

As you can see, the columns stayed the same.

The openVulnQuery client is a community supported client. I have added an enhancement request at GitHub:

https://github.com/CiscoPSIRT/openVulnAPI/issues/39

Thanks again!

Omar

View solution in original post

2 Replies 2

Omar Santos
Cisco Employee
Cisco Employee

Hi William,

You bring an excellent point. The column order does not come from the API, but the openVulnQuery client. You will need to change that "post export".

You are correct. In my example below I do the same query twice and export the output to two CSV files (example_1.csv and example_2.csv). In the second example, I change the order of the "filter" (fields).


bash-3.2$ openVulnQuery --cvrf --latest 2 -f advisory_id sir cves --csv example_1.csv
bash-3.2$
bash-3.2$ cat example_1.csv
advisory_id,sir,cves
cisco-sa-20170419-cimc,High,CVE-2017-6619
cisco-sa-20170419-cimc3,Critical,CVE-2017-6616
bash-3.2$
bash-3.2$
bash-3.2$
bash-3.2$ openVulnQuery --cvrf --latest 2 -f advisory_id cves sir --csv example_2.csv
bash-3.2$ cat example_2.csv
advisory_id,sir,cves
cisco-sa-20170419-cimc,High,CVE-2017-6619
cisco-sa-20170419-cimc3,Critical,CVE-2017-6616

As you can see, the columns stayed the same.

The openVulnQuery client is a community supported client. I have added an enhancement request at GitHub:

https://github.com/CiscoPSIRT/openVulnAPI/issues/39

Thanks again!

Omar

Omar,

Huge thanks on the reply!!!

That would be a nice have since I use the API for one of our customers which we have weekly meetings on the vulnerabilities and we order the columns a certain way which currently I need to manually move them around.

I just want to add that the API has saved me a ton of time over the way I used to have to put together the doc for the customer.

Best,