diff --git a/tests/utils/autotailor_integration_test.sh b/tests/utils/autotailor_integration_test.sh index e0681783e7..77db1ab6c1 100755 --- a/tests/utils/autotailor_integration_test.sh +++ b/tests/utils/autotailor_integration_test.sh @@ -21,6 +21,7 @@ assert_exists 1 '/Benchmark/TestResult/rule-result[@idref="xccdf_com.example.www assert_exists 1 '/Benchmark/TestResult/rule-result[@idref="xccdf_com.example.www_rule_R2"]/result[text()="pass"]' assert_exists 1 '/Benchmark/TestResult/rule-result[@idref="xccdf_com.example.www_rule_R3"]/result[text()="pass"]' assert_exists 1 '/Benchmark/TestResult/rule-result[@idref="xccdf_com.example.www_rule_R4"]/result[text()="notselected"]' +grep "xccdf-1.2:" $tailoring # select additional rules R3, R4 python3 $autotailor --id-namespace "com.example.www" --select R3 --select R4 $ds $original_profile > $tailoring diff --git a/utils/autotailor b/utils/autotailor index 4bd751dd37..96b4e2442c 100755 --- a/utils/autotailor +++ b/utils/autotailor @@ -29,6 +29,7 @@ import json NS = "http://checklists.nist.gov/xccdf/1.2" +NS_PREFIX = "xccdf-1.2" DEFAULT_PROFILE_SUFFIX = "_customized" DEFAULT_REVERSE_DNS = "org.ssgproject.content" ROLES = ["full", "unscored", "unchecked"] @@ -408,6 +409,8 @@ if __name__ == "__main__": parser = get_parser() args = parser.parse_args() + ET.register_namespace(NS_PREFIX, NS) + if not args.profile and not args.json_tailoring: parser.error("one of the following arguments has to be provided: " "BASE_PROFILE_ID or --json-tailoring JSON_TAILORING_FILENAME")