Merge ~alextu/plainbox-provider-pc-sanity:cvescan_cat_information_to_submission_html into plainbox-provider-pc-sanity:master

Proposed by Alex Tu
Status: Merged
Merged at revision: 10091e8a8097df072190ccc64acb326a2a1feb63
Proposed branch: ~alextu/plainbox-provider-pc-sanity:cvescan_cat_information_to_submission_html
Merge into: plainbox-provider-pc-sanity:master
Diff against target: 18 lines (+3/-3)
1 file modified
bin/cvescan.sh (+3/-3)
Reviewer Review Type Date Requested Status
Yuan-Chen Cheng (community) Approve
Cyrus Lien Pending
Leon Liao Pending
jeremyszu Pending
Kai-Chuan Hsieh Pending
Review via email: mp+396409@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Tu (alextu) wrote :

to put the packages which needed a secure update to submission.html.

before this patch:
http://10.101.46.50:8080/job/sanity-3-testflinger-dell-bto-focal-fossa-201810-26535-staging/lastSuccessfulBuild/artifact/artifacts/submission.html#11-4-log

after this patch:
===========================[ Running Selected Jobs ]============================
--------------[ Running job 1 / 1. Estimated time left: unknown ]---------------
----------------------[ Scan if all CVEs are fixed well. ]----------------------
ID: com.canonical.certification::miscellanea/cvescan
Category: com.canonical.plainbox::miscellanea
Unable to create symlink s/var/tmp/checkbox-providers/plainbox-provider-pc-sanity/bin/check-turbostat-power-residency.sh -> /tmp/nest-rng64p9q.7efaeee37b98d807cf451d8f20f4d87ce4f6499235d9b9d43ac2f8bdb71613c0/check-turbostat-power-residency.sh: FileExistsError(17, 'File exists')
... 8< -------------------------------------------------------------------------
Cloning into 'sec-cvescan'...
/home/ubuntu/.local/bin/cvescan
⠋ Downloading Ubuntu vulnerability database..✅ Ubuntu vulnerability datbase successfully downloaded!
⠋ Scanning for vulnerable packages..✅ Scan complete!

/usr/bin/jq
[ERROR] You have some packages that need an update for CVE.
{
    "summary": {
        "ubuntu_release": "focal",
        "num_installed_packages": 1878,
        "num_cves": 1,
        "num_affected_packages": 2,
        "num_patchable_vulnerabilities": 2
    },
    "cves": {
        "CVE-2020-28374": {
            "url": "https://people.canonical.com/~ubuntu-security/cve/CVE-2020-28374",
            "packages": {
                "linux-libc-dev": {
                    "priority": "high",
                    "fixed_version": "5.4.0-62.70",
                    "repository": "Ubuntu Archive"
                },
                "linux-tools-common": {
                    "priority": "high",
                    "fixed_version": "5.4.0-62.70",
                    "repository": "Ubuntu Archive"
                }
            }
        }
    }
}
------------------------------------------------------------------------- >8 ---
Outcome: job failed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2021-01-16T17.13.24
==================================[ Results ]===================================
 ☒ : Scan if all CVEs are fixed well.

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

the patch and result look ok, however the extra "/usr/bin/jq" line is confusing.

Do you mind either change it to

> command -v jq > /dev/null || exit 1

or add

echo "Check if tool jq exists:"

before that line.

Let me know if you do mind.

review: Needs Fixing
Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/cvescan.sh b/bin/cvescan.sh
2index cd52cf9..5963d2d 100755
3--- a/bin/cvescan.sh
4+++ b/bin/cvescan.sh
5@@ -51,10 +51,10 @@ get_cvescan_json() {
6
7 parse_cvescan_json() {
8 [ -n "$1" ] || exit 1
9- command -v jq || exit 1
10+ command -v jq > /dev/null || exit 1
11 if [ "$(jq -r '.summary.num_cves' < "$1")" != "0" ]; then
12- echo "You have some packages that need an update for CVE."
13- echo "Please check $1 for details"
14+ echo "[ERROR] You have some packages that need an update for CVE."
15+ cat "$1"
16 exit 1
17 fi
18 }

Subscribers

People subscribed via source and target branches