Skip to content

2.1 Getting started using python wrapper

vFeed, Inc edited this page Aug 27, 2021 · 1 revision

Before using the vFeed Pro & Enterprise services, you have to set up the API environment. It is a very easy process explained below. The process is divided into 3 steps:

  1. Downloading and installing the API and its requirements
  2. Subscribing and deploying the database package
  3. Setting up the database and export repositories

API installation

Requirements

  • Python 3.x
  • PyYAML (>4.2)
  • Boto3 (1.7.0)

Install

The newest API package is fully developed into Python 3.x as 2.7 EOL date is approaching 1 January 2020. The API can export vulnerability outputs into different formats such as JSON or YAML. Hence, PyYAML package is required

The database is as well deployed according to different licensed plans (Pro or Enterprise) in the Amazon S3. In order to automatically download the updates, the Amazon Boto3 is required.

You can install the requirements one by one or use the requirements.txt file.

pyyaml

sudo python3 -m pip install pyyaml

boto3

sudo python3 -m pip install boto3

using requirements.txt

sudo python3 -m pip install -r requirements.txt

pyvfeed

git clone https://github.com/vfeedio/pyvfeed.git

Database deployment

The vFeed database is a SQLite database that stores the whole mapping metadata. The database is a mandatory masterpiece of the vFeed Pro and Enterprise.

You have to subscribe to the license plan that suits you and receive your keys.

keys install

Once you have received the subscription email with the following license information:

  • Access key
  • Secret key
  • Subscription plan

You will need to edit the configuration file common/config.py and locate subscription tag to report your information as follow:

subscription = {"access_key": 'YOUR_ACCESS_KEY',
                "secret_key": 'YOUR_SECRET_KEY',
                "plan": 'YOUR_PLAN'}

Before initiating the database update, you need to set up the location.

Setting up database and export repositories

You will have the choice to deploy your database package (literally the sqlite vfeed.db) in any repository. The same rule applies regarding the export directory where the API stores JSON / YAML exported vulnerability metadata.

database repository

To proceed, you will need to edit the configuration file common/config.py and locate database tag

database = {"file": 'vfeed.db',
            "path": 'YOUR_DB_PATH',
            } 

Modify YOUR_DB_PATH to whatever suits you (example: /home/subscriptions/db/)

As a result, the directory /home/subscriptions/db/ will be then used to store the vfeed.db.

export repository

To proceed, you will need to edit the configuration file common/config.py and locate export tag

export = {"path": 'YOUR_EXPORT_PATH'}

Modify YOUR_EXPORT_PATH to whatever suits you (example: /home/subscriptions/db/export/)

As a result, all exported vulnerability JSON or YAML files will be stored into /home/subscriptions/db/export/.