Issue 1435 software to cpe (#1488)

* WIP

* WIP

* Make path optional and fix tests

* Add first generate

* Move to nvd package

* remove replace

* Re-add replace

* It's path, not file name

* Change how db path is set and use etag

* Fix typos

* Make db generation faster

* Remove quotes

* Doesn't like comments

* Samitize etag and save to file

* Refactor some things and improve writing of etagenv

* Compress file and truncate amount of items for faster testing

* Remove quotes

* Try to improve performance

* Ignore truncate error if not exists

* Minor cleanup and make sqlite have cpe prefix

* Simplify code and test sync

* Add VCR for sync test

* Check for nvdRelease nil

* Add test for the actual translation

* Address review comments

* Rename generate command because we'll have a cve one too

* Move to its own dir

* Address review comments
This commit is contained in:
Tomas Touceda
2021-07-29 13:10:34 -03:00
committed by GitHub
parent 1d6572488b
commit 46b0b7765b
22 changed files with 1122 additions and 358 deletions
+5 -2
View File
@@ -18,8 +18,10 @@ require (
github.com/cenkalti/backoff/v4 v4.0.0
github.com/davecgh/go-spew v1.1.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dnaeon/go-vcr/v2 v2.0.1
github.com/e-dard/netbug v0.0.0-20151029172837-e64d308a0b20
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/facebookincubator/nvdtools v0.1.4
github.com/fatih/color v1.10.0 // indirect
github.com/fleetdm/goose v0.0.0-20210209032905-c3c01484bacb
github.com/ghodss/yaml v1.0.0
@@ -27,12 +29,12 @@ require (
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-sql-driver/mysql v1.5.0
github.com/gomodule/redigo v1.8.4
github.com/google/go-cmp v0.5.5
github.com/google/go-cmp v0.5.6
github.com/google/go-github/v37 v37.0.0
github.com/google/uuid v1.1.2
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.4.2
github.com/gosuri/uilive v0.0.4
github.com/groob/mockimpl v0.0.0-20170306012045-dfa944a2a940 // indirect
github.com/igm/sockjs-go/v3 v3.0.0
github.com/jmoiron/sqlx v1.2.0
github.com/jonboulle/clockwork v0.2.2 // indirect
@@ -42,6 +44,7 @@ require (
github.com/kolide/osquery-go v0.0.0-20190904034940-a74aa860032d
github.com/kr/text v0.2.0 // indirect
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e
github.com/mattn/go-sqlite3 v1.14.8
github.com/mna/redisc v1.2.1
github.com/olekukonko/tablewriter v0.0.5
github.com/open-policy-agent/opa v0.24.0