cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1565
Views
4
Helpful
3
Replies

openVulnQuery launch failed

Hello,

I tried to launch openVulnQuery from GIT clone and I have following error:

(venv) root@kali:/opt/openVulnAPI/openVulnQuery/openVulnQuery# python main.py --config /opt/openVulnAPI/credentials.json --cvrf --all Traceback (most recent call last):

  File "main.py", line 4, in <module>

    main()

  File "/opt/openVulnAPI/openVulnQuery/openVulnQuery/_library/main.py", line 45, in main

    args = cli_api.process_command_line(string_list)

  File "/opt/openVulnAPI/openVulnQuery/openVulnQuery/_library/cli_api.py", line 304, in process_command_line

    parsed_config = json.load(open(args.json_config_path))

  File "/usr/lib/python2.7/json/__init__.py", line 291, in load

    **kw)

  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads

    return _default_decoder.decode(s)

  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode

    obj, end = self.scan_once(s, idx)

ValueError: Expecting property name: line 2 column 2 (char 3)

My credential file:

{

     CLIENT_ID='dflsdkfmsdfkmsdfksmfk'

     SECRET_ID='dsflmksdfmlskdfml'

}

From PIP, openVulnQuery does not include --config parameter.

Any idea ?

Regards

1 Accepted Solution

Accepted Solutions

Hi Andrei,

If you installed the client using pip, please enter your client credentials in the config.py file, as shown below:

STEP 1: Locate the installation directory using the pip show openVulnQuery command. as shown below:

$ pip show openVulnQuery

Name: OpenVulnQuery

Version: 1.25

Summary: A python-based module(s) to query the Cisco PSIRT openVuln API.

...

Location: /usr/local/lib/python2.7/dist-packages


STEP 2: Change to the installation directory. In the example below, the library was installed under /usr/local/lib/python2.7/dist-packages. The openVulnQuery sub-directory should reside there:

$ cd /usr/local/lib/python2.7/dist-packages/openVulnQuery/

STEP 3: Edit the config.py file with your favorite editor.

$ vi config.py

The contents of the config.py file should be:

CLIENT_ID = " <enter your client ID here> "

CLIENT_SECRET = "<enter your client secret here>"

REQUEST_TOKEN_URL = "https://cloudsso.cisco.com/as/token.oauth2"

API_URL = "https://api.cisco.com/security/advisories"


STEP 4: Save the config.py file. You should be able to make queries now.

Hope this helps...

- Omar

View solution in original post

3 Replies 3

Andrei Batyrov
Cisco Employee
Cisco Employee

Same question here. Did pip install openVulnQuery. Cannot figure out how to pass my credentials. As per https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery: "OpenVulnQuery --config PathToCredentialsFile" However I get: openVulnQuery: error: unrecognized arguments: --config...

When trying to run it without the --config argument, I get: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://cloudsso.cisco.com/as/token.oauth2?client_secret=&client_id=

Could anyone please look into this issue?

Hi Andrei,

If you installed the client using pip, please enter your client credentials in the config.py file, as shown below:

STEP 1: Locate the installation directory using the pip show openVulnQuery command. as shown below:

$ pip show openVulnQuery

Name: OpenVulnQuery

Version: 1.25

Summary: A python-based module(s) to query the Cisco PSIRT openVuln API.

...

Location: /usr/local/lib/python2.7/dist-packages


STEP 2: Change to the installation directory. In the example below, the library was installed under /usr/local/lib/python2.7/dist-packages. The openVulnQuery sub-directory should reside there:

$ cd /usr/local/lib/python2.7/dist-packages/openVulnQuery/

STEP 3: Edit the config.py file with your favorite editor.

$ vi config.py

The contents of the config.py file should be:

CLIENT_ID = " <enter your client ID here> "

CLIENT_SECRET = "<enter your client secret here>"

REQUEST_TOKEN_URL = "https://cloudsso.cisco.com/as/token.oauth2"

API_URL = "https://api.cisco.com/security/advisories"


STEP 4: Save the config.py file. You should be able to make queries now.

Hope this helps...

- Omar

Hi Omar,

Thank you very much!

Kind regards,

Andrei

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: