Skip to content

Commit 7b45a7e

Browse files
authored
Merge pull request #2081 from evgenyz/fix-blueprint-template
Fix Blueprint template to be self-contained
2 parents c9a1049 + 0933cfe commit 7b45a7e

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/XCCDF_POLICY/xccdf_policy_remediate.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -1143,10 +1143,15 @@ static int _write_script_header_to_fd(struct xccdf_policy *policy, struct xccdf_
11431143
} else if (oscap_streq(sys, "urn:redhat:osbuild:blueprint")) {
11441144
char *blueprint_fix_header = oscap_sprintf(
11451145
"%s"
1146-
"name = \"%s\"\n"
1146+
"name = \"hardened_%s\"\n"
11471147
"description = \"%s\"\n"
1148-
"version = \"%s\"\n",
1149-
fix_header, profile_id, profile_title, benchmark_version_info);
1148+
"version = \"%s\"\n\n"
1149+
"[customizations.openscap]\n"
1150+
"profile_id = \"%s\"\n"
1151+
"# If your hardening data stream is not part of the 'scap-security-guide' package\n"
1152+
"# provide the absolute path to it (from the root of the image filesystem).\n"
1153+
"# datastream = \"/usr/share/xml/scap/ssg/content/ssg-xxxxx-ds.xml\"\n\n",
1154+
fix_header, profile_id, profile_title, benchmark_version_info, profile_id);
11501155
free(fix_header);
11511156
free(profile_title);
11521157
return _write_text_to_fd_and_free(output_fd, blueprint_fix_header);

tests/API/XCCDF/unittests/test_remediation_blueprint.toml

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@
1919
#
2020
###############################################################################
2121

22-
name = "xccdf_moc.elpmaxe.www_profile_common"
22+
name = "hardened_xccdf_moc.elpmaxe.www_profile_common"
2323
description = "Profile title on one line"
2424
version = "1.0"
25+
26+
[customizations.openscap]
27+
profile_id = "xccdf_moc.elpmaxe.www_profile_common"
28+
# If your hardening data stream is not part of the 'scap-security-guide' package
29+
# provide the absolute path to it (from the root of the image filesystem).
30+
# datastream = "/usr/share/xml/scap/ssg/content/ssg-xxxxx-ds.xml"
31+
2532
distro = rhel-80
2633

2734
[[packages]]

0 commit comments

Comments
 (0)