From: DANIEL STOICA Date: Thu, 25 Jun 2020 11:14:48 +0000 (+0300) Subject: os: vuls: Add CentOS 8 support X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F3597%2F2;p=validation.git os: vuls: Add CentOS 8 support Add fetch command for oval database for CentOS 8 in validation/docker/os/Dockerfile Add a centos version verification and get the vuls result for desired os version in validation/tests/os/vuls/vuls.robot Signed-off-by: DANIEL STOICA Change-Id: I4431a471c6c978719cdb4a4c23099c0c9925c9df --- diff --git a/docker/os/Dockerfile b/docker/os/Dockerfile index 3f3fe95..13a9c26 100644 --- a/docker/os/Dockerfile +++ b/docker/os/Dockerfile @@ -93,7 +93,8 @@ RUN \ for i in $(seq 2002 "$(date +"%Y")"); do go-cve-dictionary fetchnvd -quiet -http-proxy=${HTTP_PROXY} -dbpath /opt/akraino/validation/tests/os/vuls/cve.sqlite3 -years "$i"; done && \ goval-dictionary fetch-ubuntu -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_ubuntu_16.sqlite3 16 && \ goval-dictionary fetch-ubuntu -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_ubuntu_18.sqlite3 18 && \ - goval-dictionary fetch-redhat -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_centos.sqlite3 7 && \ + goval-dictionary fetch-redhat -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_centos_7.sqlite3 7 && \ + goval-dictionary fetch-redhat -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_centos_8.sqlite3 8 && \ gost fetch redhat --http-proxy=${HTTP_PROXY} --dbpath=/opt/akraino/validation/tests/os/vuls/gost_centos.sqlite3 --threads=$(nproc) && \ cd /opt/akraino/validation/tests/os/vuls && \ tar cvzf db.tar.gz *.sqlite3 && \ diff --git a/tests/os/vuls/vuls.robot b/tests/os/vuls/vuls.robot index 0847322..9774be9 100644 --- a/tests/os/vuls/vuls.robot +++ b/tests/os/vuls/vuls.robot @@ -64,7 +64,9 @@ Run vuls for ubuntu Set Global Variable ${LOG} ${output} Run vuls for centos - ${rc} ${output} = Run And Return Rc And Output vuls report -config ${CURDIR}/config.toml -cvedb-sqlite3-path=${CURDIR}/cve.sqlite3 -ovaldb-sqlite3-path=${CURDIR}/oval_centos.sqlite3 -gostdb-sqlite3-path=${CURDIR}/gost_centos.sqlite3 + ${os_version} = SSHLibrary.Execute Command source /etc/os-release && echo $VERSION_ID | cut -d '.' -f1 + + ${rc} ${output} = Run And Return Rc And Output vuls report -config ${CURDIR}/config.toml -cvedb-sqlite3-path=${CURDIR}/cve.sqlite3 -ovaldb-sqlite3-path=${CURDIR}/oval_centos_${os_version}.sqlite3 -gostdb-sqlite3-path=${CURDIR}/gost_centos.sqlite3 Should Be Equal As Integers ${rc} 0 Append To File ${LOG_PATH}/vuls.log ${output}${\n} Set Global Variable ${LOG} ${output}