Closed
Description
What did you do? (required. The issue will be closed when not provided.)
I would like to fix the architecture around the key of Redis so that the search results of RDB and Redis are the same.
Some definition in OVAL does not have <cve></cve>
(⇔ Advisory.Cves
= []).
To explain briefly, RDB and Redis retrieve OVALJSON from package names as shown below.
In Redis, the OVALJSON of Advisory.Cves
= [] will not appear in the search results.
- Redis: PackageName → CVEID → OVALJSON
- RDB: PackageName → DifinitionID → OVALJSON
What did you expect to happen?
The same response is obtained by GetByPackName in RDB and Redis.
What happened instead?
The response of GetByPackName in RDB and Redis may be different.
Steps to reproduce the behaviour
$ goval-dictionary fetch oracle
$ docker run --rm --name goval-test -d -p 127.0.0.1:6379:6379 redis
$ goval-dictionary fetch oracle --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
$ goval-dictionary server --port 1324
$ goval-dictionary server --port 1325 --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
$ curl http://127.0.0.1:1324/packs/oracle/5/nspr/x86_64 | jq . > sqlite3.json
$ curl http://127.0.0.1:1325/packs/oracle/5/nspr/x86_64 | jq . > redis.json
$ diff <(grep "DefinitionID" sqlite3.json | sort) <(grep "DefinitionID" redis.json | sort)
8d7
< "DefinitionID": "oval:com.oracle.elsa:def:20111282",
10d8
< "DefinitionID": "oval:com.oracle.elsa:def:20130214",
Configuration (MUST fill this out):
-
Go version (
go version
):
1.16.2 -
Go environment (
go env
): -
goval-dictionary environment:
Hash : ____
To check the commit hash of HEAD
$ goval-dictionary -v
goval-dictionary v0.3.5 c70b5d8