From 26def770521f067b9b3cc0f797207390d526cd6d Mon Sep 17 00:00:00 2001 From: Fred Melendez Date: Thu, 17 Dec 2020 01:09:50 +0000 Subject: [PATCH 1/4] New OSCAP link parms --- stages/vat/vat_import.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stages/vat/vat_import.py b/stages/vat/vat_import.py index dd0f814f..c9eea8cf 100644 --- a/stages/vat/vat_import.py +++ b/stages/vat/vat_import.py @@ -49,9 +49,12 @@ parser.add_argument( help="Parent Version from VENDOR/PRODUCT/CONTAINER/VERSION format", ) parser.add_argument( - "-l", "--link", help="S3 Link to openscap reports directory", required=True + "-sl", "--sec_link", help="Link to openscap security reports directory", required=True +) +parser.add_argument( + "-cl", "--comp_link", help="Link to openscap compliance reports directory", required=True ) -parser.add_argument("--debug", help="debug true changes log level", action="store_true") + pandas.options.mode.chained_assignment = None @@ -298,7 +301,7 @@ def parse_oscap_security(ov_path): @return dataframe with standarized columns for OSCAP security scan """ - report_link = os.path.join(args.link, "report-cve.html") + report_link = os.path.join(args.sec_link, "report-cve.html") severity_dict = { "Critical": "critical", "Important": "high", @@ -354,7 +357,8 @@ def parse_oscap_compliance(os_path): """ @return dataframe with standarized columns for OSCAP compliance scan """ - report_link = os.path.join(args.link, "report.html") + + report_link = os.path.join(args.comp_link, "report.html") d_f = pandas.read_csv(os_path) # This keeps the rows where the result is fail or notchecked or error -- GitLab From c4ea134fbfffcc68567b3a49fe15264df4f3b827 Mon Sep 17 00:00:00 2001 From: Fred Melendez Date: Thu, 17 Dec 2020 01:19:02 +0000 Subject: [PATCH 2/4] Update OpenSCAP links --- stages/vat/vat-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stages/vat/vat-run.sh b/stages/vat/vat-run.sh index 53c30475..123f2912 100755 --- a/stages/vat/vat-run.sh +++ b/stages/vat/vat-run.sh @@ -32,5 +32,5 @@ python3 "${PIPELINE_REPO_DIR}/stages/vat/vat_import.py" \ --password "${vat_db_connection_pass}" \ --parent_version "${BASE_TAG:-}" \ --scan_date "$(date +%FT%T)" \ - --link "${OPENSCAP}/" \ - --debug + --sec_link "${OSCAP_CVE_URL`}/" \ + --comp_link "${OSCAP_COMPLIANCE_URL}/" -- GitLab From 1128ffbef85fddf3c186d1f173cd2ce66b3fa4a1 Mon Sep 17 00:00:00 2001 From: Fred Melendez Date: Fri, 18 Dec 2020 23:02:58 +0000 Subject: [PATCH 3/4] Fix sec_link --- stages/vat/vat-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stages/vat/vat-run.sh b/stages/vat/vat-run.sh index 123f2912..1c2383b4 100755 --- a/stages/vat/vat-run.sh +++ b/stages/vat/vat-run.sh @@ -32,5 +32,5 @@ python3 "${PIPELINE_REPO_DIR}/stages/vat/vat_import.py" \ --password "${vat_db_connection_pass}" \ --parent_version "${BASE_TAG:-}" \ --scan_date "$(date +%FT%T)" \ - --sec_link "${OSCAP_CVE_URL`}/" \ + --sec_link "${OSCAP_CVE_URL}/" \ --comp_link "${OSCAP_COMPLIANCE_URL}/" -- GitLab From f93858aca77341c55ac34527b866edbc7902cc09 Mon Sep 17 00:00:00 2001 From: Fred Melendez Date: Fri, 18 Dec 2020 23:06:35 +0000 Subject: [PATCH 4/4] Black format --- stages/vat/vat_import.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stages/vat/vat_import.py b/stages/vat/vat_import.py index c9eea8cf..d048f2ca 100644 --- a/stages/vat/vat_import.py +++ b/stages/vat/vat_import.py @@ -49,10 +49,16 @@ parser.add_argument( help="Parent Version from VENDOR/PRODUCT/CONTAINER/VERSION format", ) parser.add_argument( - "-sl", "--sec_link", help="Link to openscap security reports directory", required=True + "-sl", + "--sec_link", + help="Link to openscap security reports directory", + required=True, ) parser.add_argument( - "-cl", "--comp_link", help="Link to openscap compliance reports directory", required=True + "-cl", + "--comp_link", + help="Link to openscap compliance reports directory", + required=True, ) @@ -218,6 +224,7 @@ def parse_anchore_compliance(ac_path): "inherited", ] d_f = pandas.read_csv(ac_path, names=columns) + # Drop bad header row d_f = d_f.drop(d_f.index[0]) -- GitLab