Skip to content

Commit

Permalink
test/configs: xml oscap tailoring
Browse files Browse the repository at this point in the history
Add test cases for xml tailoring
  • Loading branch information
kingsleyzissou committed Jul 11, 2024
1 parent 677c1d0 commit ae19156
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/config-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@
"ami"
]
},
"./configs/oscap-rhel8-with-xml-tailoring.json": {
"distros": [
"rhel-8.10"
],
"image-types": [
"ami"
]
},
"./configs/oscap-rhel9.json": {
"distros": [
"rhel-9.4"
Expand All @@ -204,6 +212,14 @@
"ami"
]
},
"./configs/oscap-rhel9-with-xml-tailoring.json": {
"distros": [
"rhel-9.4"
],
"image-types": [
"ami"
]
},
"./configs/ostree.json": {
"image-types": [
"edge-commit",
Expand Down
32 changes: 32 additions & 0 deletions test/configs/oscap-rhel8-with-xml-tailoring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "oscap-rhel8-with-xml-tailoring",
"blueprint": {
"packages": [
{
"name": "xmlstarlet"
},
{
"name": "openscap-utils"
},
{
"name": "jq"
}
],
"customizations": {
"files": [
{
"path": "/oscap_data/tailoring.xml",
"data": "<?xml version='1.0' ?>\n<ns0:Tailoring xmlns:ns0='http://checklists.nist.gov/xccdf/1.2' id='xccdf_auto_tailoring_default'>\n\t<ns0:benchmark href='file:///usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml'/>\n\t<ns0:version time='2024-07-03T13:13:48.909893'>1</ns0:version>\n\t<ns0:Profile id='xccdf_org.ssgproject.content_profile_cis_osbuild_tailoring' extends='xccdf_org.ssgproject.content_profile_cis'>\n\t\t<ns0:title override='true'>cis_osbuild_tailoring</ns0:title>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_grub2_password' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_grub2_uefi_password' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_partition_for_dev_shm' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_mount_option_dev_shm_nosuid' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_mount_option_dev_shm_noexec' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_mount_option_dev_shm_nodev' selected='false'/>\n\t</ns0:Profile>\n</ns0:Tailoring>"
}
],
"openscap": {
"profile_id": "xccdf_org.ssgproject.content_profile_cis",
"datastream": "/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml",
"xml_tailoring": {
"profile_id": "xccdf_org.ssgproject.content_profile_cis_osbuild_tailoring",
"filepath": "/oscap_data/tailoring.xml"
}
}
}
}
}
32 changes: 32 additions & 0 deletions test/configs/oscap-rhel9-with-xml-tailoring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "oscap-rhel9-with-xml-tailoring",
"blueprint": {
"packages": [
{
"name": "xmlstarlet"
},
{
"name": "openscap-utils"
},
{
"name": "jq"
}
],
"customizations": {
"files": [
{
"path": "/oscap_data/tailoring.xml",
"data": "<?xml version='1.0' ?>\n<ns0:Tailoring xmlns:ns0='http://checklists.nist.gov/xccdf/1.2' id='xccdf_auto_tailoring_default'>\n\t<ns0:benchmark href='file:///usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml'/>\n\t<ns0:version time='2024-07-03T13:13:48.909893'>1</ns0:version>\n\t<ns0:Profile id='xccdf_org.ssgproject.content_profile_cis_osbuild_tailoring' extends='xccdf_org.ssgproject.content_profile_cis'>\n\t\t<ns0:title override='true'>cis_osbuild_tailoring</ns0:title>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_grub2_password' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_grub2_uefi_password' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_partition_for_dev_shm' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_mount_option_dev_shm_nosuid' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_mount_option_dev_shm_noexec' selected='false'/>\n\t\t<ns0:select idref='xccdf_org.ssgproject.content_rule_mount_option_dev_shm_nodev' selected='false'/>\n\t</ns0:Profile>\n</ns0:Tailoring>"
}
],
"openscap": {
"profile_id": "xccdf_org.ssgproject.content_profile_cis",
"datastream": "/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml",
"xml_tailoring": {
"profile_id": "xccdf_org.ssgproject.content_profile_cis_osbuild_tailoring",
"filepath": "/oscap_data/tailoring.xml"
}
}
}
}
}

0 comments on commit ae19156

Please sign in to comment.