diff --git a/stages/vat/vat-run.sh b/stages/vat/vat-run.sh index 53c304751c4c2b2ec526eaafd9425bc6acf321b2..1c2383b4a4ed7c97731af287d21f912dc93abcec 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}/" diff --git a/stages/vat/vat_import.py b/stages/vat/vat_import.py index dd0f814f78d61fea5a11f07aca774c943267e5e1..d048f2cafc61ca6db3568860e3251fdf4241c117 100644 --- a/stages/vat/vat_import.py +++ b/stages/vat/vat_import.py @@ -49,9 +49,18 @@ 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("--debug", help="debug true changes log level", action="store_true") +parser.add_argument( + "-cl", + "--comp_link", + help="Link to openscap compliance reports directory", + required=True, +) + pandas.options.mode.chained_assignment = None @@ -215,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]) @@ -298,7 +308,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 +364,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