Skip to content

Commit

Permalink
Create a product property for bootable containers
Browse files Browse the repository at this point in the history
Promote the variable `bootable_containers_supported` to a product
property. By default, bootable containers won't be supported.
The RHEL 9 and 10 products will support bootable containers.
This variable can be used at build time in many types of the
code.
  • Loading branch information
jan-cerny committed Dec 11, 2024
1 parent e59302b commit f0a6859
Show file tree
Hide file tree
Showing 34 changed files with 38 additions and 7 deletions.
1 change: 1 addition & 0 deletions products/rhel10/product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ init_system: "systemd"
# EFI and non-EFI configs are stored in same path, see https://fedoraproject.org/wiki/Changes/UnifyGrubConfig

sshd_distributed_config: "true"
bootable_containers_supported: "true"

dconf_gdm_dir: "distro.d"

Expand Down
1 change: 1 addition & 0 deletions products/rhel9/product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ groups:
name: ssh_keys

sshd_distributed_config: "true"
bootable_containers_supported: "true"

dconf_gdm_dir: "distro.d"

Expand Down
9 changes: 2 additions & 7 deletions shared/templates/grub2_bootloader_argument/oval.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
{{% set system_with_kernel_options_in_etc_default_grub_d = false -%}}
{{% set system_with_expanded_kernel_options_in_grub_cfg = false -%}}
{{% set system_with_bios_and_uefi_support = false -%}}
{{% set bootable_containers_supported = false %}}

{{% if product in ["fedora", "ol9", "rhel9", "rhel10"] -%}}
{{% set system_with_expanded_kernel_options_in_loader_entries = true %}}
Expand All @@ -34,10 +33,6 @@
{{% set system_with_bios_and_uefi_support = true %}}
{{%- endif -%}}

{{% if product in ["rhel9", "rhel10"] -%}}
{{% set bootable_containers_supported = true %}}
{{%- endif -%}}

<def-group>
<definition class="compliance" id="{{{ _RULE_ID }}}" version="2">
{{{ oval_metadata("Ensure " + ARG_NAME_VALUE + " is configured in the kernel line in /etc/default/grub.") }}}
Expand Down Expand Up @@ -114,7 +109,7 @@
</criteria>
{{%- endif %}}
</criteria>
{{% if bootable_containers_supported %}}
{{% if bootable_containers_supported == "true" %}}
<criteria operator="AND">
<extend_definition comment="The system is RHEL Image Mode" definition_ref="bootc" />
<criterion comment="The {{{ ARG_NAME_VALUE }}} is present in the /usr/lib/bootc/kargs.d/*.toml files" test_ref="test_grub2_{{{ SANITIZED_ARG_NAME }}}_usr_lib_bootc_kargs_d" />
Expand Down Expand Up @@ -319,7 +314,7 @@
<external_variable comment="Variable defining the value the argument should have" datatype="string" id="{{{ ARG_VARIABLE }}}" version="1" />
{{% endif %}}

{{% if bootable_containers_supported %}}
{{% if bootable_containers_supported == "true" %}}
<ind:textfilecontent54_test id="test_grub2_{{{ SANITIZED_ARG_NAME }}}_usr_lib_bootc_kargs_d"
comment="check kernel command line parameters for {{{ ARG_NAME_VALUE }}} for all boot entries."
check="at least one" check_existence="at_least_one_exists" version="1">
Expand Down
1 change: 1 addition & 0 deletions ssg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
DEFAULT_CHRONY_D_PATH = '/etc/chrony.d/'
DEFAULT_AUDISP_CONF_PATH = '/etc/audit'
DEFAULT_SYSCTL_REMEDIATE_DROP_IN_FILE = 'false'
DEFAULT_BOOTABLE_CONTAINERS_SUPPORTED = 'false'


# Constants for OVAL object model
Expand Down
4 changes: 4 additions & 0 deletions ssg/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
DEFAULT_AUDISP_CONF_PATH,
DEFAULT_FAILLOCK_PATH,
DEFAULT_SYSCTL_REMEDIATE_DROP_IN_FILE,
DEFAULT_BOOTABLE_CONTAINERS_SUPPORTED,
PKG_MANAGER_TO_SYSTEM,
PKG_MANAGER_TO_CONFIG_FILE,
XCCDF_PLATFORM_TO_PACKAGE,
Expand Down Expand Up @@ -115,6 +116,9 @@ def _get_implied_properties(existing_properties):
if "sysctl_remediate_drop_in_file" not in existing_properties:
result["sysctl_remediate_drop_in_file"] = DEFAULT_SYSCTL_REMEDIATE_DROP_IN_FILE

if "bootable_containers_supported" not in existing_properties:
result["bootable_containers_supported"] = DEFAULT_BOOTABLE_CONTAINERS_SUPPORTED

return result


Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/alinux2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: ALINUX-2
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/alinux3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: ALINUX-3
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/anolis23.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: ANOLIS-23
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/anolis8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: ANOLIS-8
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/chromium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: CHROMIUM
benchmark_root: ./guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/debian11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: DEBIAN-11
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/debian12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: DEBIAN-12
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony/chrony.conf
chrony_d_path: /etc/chrony/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: EKS
benchmark_root: ../../applications
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: EXAMPLE
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
components_root: ../../components
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: FEDORA
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
components_root: ../../components
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/firefox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: FIREFOX
benchmark_root: ./guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/macos1015.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: macOS-1015
benchmark_root: ../../apple_os/
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ocp4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: OCP-4
benchmark_root: ../../applications
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ol7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: OL-7
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ol8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: OL-8
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ol9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ auxiliary_key_fingerprint: 982231759C7467065D0CE9B2A7DD07088B4EFBE6
basic_properties_derived: true
benchmark_id: OL-9
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/openembedded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: OPENEMBEDDED
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/opensuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: OPENSUSE
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/rhcos4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: RHCOS-4
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/rhel8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ auxiliary_key_fingerprint: 6A6AA7C97C8890AEC6AEBFE2F76F66C3D4082792
basic_properties_derived: true
benchmark_id: RHEL-8
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
centos_major_version: '8'
centos_pkg_release: 5ccc5b19
centos_pkg_version: 8483c65d
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/rhel9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ auxiliary_key_fingerprint: 7E4624258C406535D56D6F135054E4A45A6340B3
basic_properties_derived: true
benchmark_id: RHEL-9
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'true'
centos_major_version: '9'
centos_pkg_release: 5ccc5b19
centos_pkg_version: 8483c65d
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/rhv4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ auxiliary_key_fingerprint: 6A6AA7C97C8890AEC6AEBFE2F76F66C3D4082792
basic_properties_derived: true
benchmark_id: RHV-4
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/sle12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: SLE-12
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/sle15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: SLE-15
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony.conf
chrony_d_path: /etc/chrony.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ubuntu1604.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: UBUNTU-XENIAL
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony/chrony.conf
chrony_d_path: /etc/chrony/conf.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ubuntu1804.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: UBUNTU-BIONIC
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony/chrony.conf
chrony_d_path: /etc/chrony/conf.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ubuntu2004.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: UBUNTU_20-04
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony/chrony.conf
chrony_d_path: /etc/chrony/conf.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ubuntu2204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: UBUNTU_22-04
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony/chrony.conf
chrony_d_path: /etc/chrony/conf.d/
cpes:
Expand Down
1 change: 1 addition & 0 deletions tests/data/product_stability/ubuntu2404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ auid: 1000
basic_properties_derived: true
benchmark_id: UBUNTU_24-04
benchmark_root: ../../linux_os/guide
bootable_containers_supported: 'false'
chrony_conf_path: /etc/chrony/chrony.conf
chrony_d_path: /etc/chrony/conf.d/
components_root: ../../components
Expand Down

0 comments on commit f0a6859

Please sign in to comment.