Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.61 KB

README.md

File metadata and controls

47 lines (36 loc) · 1.61 KB

Vulnerability Database API

REST API for the Vulnerability Database.

Visit the API documentation page here.

For running the component locally, you need to have access to the vulnerability-db repo, as it's the one that contains the DB schema and migrations. For running the component locally, clone and run at the root of the repo the following:

go install ./...
cd ../vulnerability-db/db && source postgres-start.sh && cd -
cd ../vulnerability-db/db && source flyway-migrate.sh && cd -
vulnerability-db-api -c ../_resources/config/local.toml

Docker execute

Those are the variables you have to use:

Variable Description Sample
LOG_LEVEL error
PG_HOST Database host localhost
PG_NAME Database name vulnerabilitydb
PG_USER Database user vulnerabilitydb
PG_PASSWORD Database password vulnerabilitydb
PG_PORT Database port 5432
PG_SSLMODE One of these (disable,allow,prefer,require,verify-ca,verify-full) disable
PG_HOST_READ Read replica database host localhost
PG_NAME_READ Read replica Database name vulnerabilitydb
PG_USER_READ Read replica Database user vulnerabilitydb
PG_PASSWORD_READ Read replica Database password vulnerabilitydb
PG_PORT_READ Read replica Database port 5432
PG_SSLMODE_READ One of these (disable,allow,prefer,require,verify-ca,verify-full) disable
PG_CA_B64 A base64 encoded CA certificate
docker build . -t vdba

# Use the default config.toml customized with env variables.
docker run --env-file ./local.env vdba

# Use custom config.toml
docker run -v `pwd`/custom.toml:/app/config.toml vdba