|
|
475544 |
From 4c54b1cfb05961bde8248e03d27cabeca967e211 Mon Sep 17 00:00:00 2001
|
|
|
475544 |
From: Watson Sato <wsato@redhat.com>
|
|
|
475544 |
Date: Mon, 17 Aug 2020 10:59:15 +0200
|
|
|
475544 |
Subject: [PATCH] Remove SCAP-1.3 SCAPVAL workarounds
|
|
|
475544 |
|
|
|
475544 |
These changes to the DS cause SRC-330 to fail in SCAPVAL-1.3.5.
|
|
|
475544 |
In SCAPVAL-1.3.5 was fixed and these false positive workarounds are not
|
|
|
475544 |
necessary anymore.
|
|
|
475544 |
---
|
|
|
475544 |
tests/run_scapval.py | 26 --------------------------
|
|
|
475544 |
1 file changed, 26 deletions(-)
|
|
|
475544 |
|
|
|
475544 |
diff --git a/tests/run_scapval.py b/tests/run_scapval.py
|
|
|
475544 |
index e1dd806ca1..bc2655b9fd 100755
|
|
|
475544 |
--- a/tests/run_scapval.py
|
|
|
475544 |
+++ b/tests/run_scapval.py
|
|
|
475544 |
@@ -46,35 +46,9 @@ def process_results(result_path):
|
|
|
475544 |
return ret_val
|
|
|
475544 |
|
|
|
475544 |
|
|
|
475544 |
-def workaround_datastream(datastream_path):
|
|
|
475544 |
- tree = ET.parse(datastream_path)
|
|
|
475544 |
- root = tree.getroot()
|
|
|
475544 |
- # group_id and user_id cannot be zero
|
|
|
475544 |
- # tracked at https://github.com/OVAL-Community/OVAL/issues/23
|
|
|
475544 |
- for group_id_element in root.findall(".//{%s}group_id" % oval_unix_ns):
|
|
|
475544 |
- if group_id_element.text is not None:
|
|
|
475544 |
- group_id_element.text = "-1"
|
|
|
475544 |
- for user_id_element in root.findall(".//{%s}user_id" % oval_unix_ns):
|
|
|
475544 |
- if user_id_element.text is not None:
|
|
|
475544 |
- user_id_element.text = "-1"
|
|
|
475544 |
- # OCIL checks for security_patches_up_to_date is causing fail
|
|
|
475544 |
- # of SRC-377, when requirement is about OVAL checks.
|
|
|
475544 |
- rule_id = "xccdf_org.ssgproject.content_rule_security_patches_up_to_date"
|
|
|
475544 |
- for rule in root.findall(".//{%s}Rule[@id=\"%s\"]" % (xccdf_ns, rule_id)):
|
|
|
475544 |
- for check in rule.findall("{%s}check" % xccdf_ns):
|
|
|
475544 |
- system = check.get("system")
|
|
|
475544 |
- if system == "http://scap.nist.gov/schema/ocil/2":
|
|
|
475544 |
- rule.remove(check)
|
|
|
475544 |
- output_path = datastream_path + ".workaround.xml"
|
|
|
475544 |
- tree.write(output_path)
|
|
|
475544 |
- return output_path
|
|
|
475544 |
-
|
|
|
475544 |
-
|
|
|
475544 |
def test_datastream(datastream_path, scapval_path, scap_version):
|
|
|
475544 |
result_path = datastream_path + ".result.xml"
|
|
|
475544 |
report_path = datastream_path + ".report.html"
|
|
|
475544 |
- if scap_version == "1.3":
|
|
|
475544 |
- datastream_path = workaround_datastream(datastream_path)
|
|
|
475544 |
scapval_command = [
|
|
|
475544 |
"java",
|
|
|
475544 |
"-Xmx1024m",
|