diff --git a/shared/checks/oval/oscap_bootc_env_var.xml b/shared/checks/oval/oscap_bootc_env_var.xml new file mode 100644 index 00000000000..3d085292f71 --- /dev/null +++ b/shared/checks/oval/oscap_bootc_env_var.xml @@ -0,0 +1,33 @@ + + + + Check if the environment is execution of the oscap-bootc build tool in the podman build environment + + multi_platform_all + + Check the value of environment variable OSCAP_BOOTC_BUILD. + + + + + + + + + + + + + + + OSCAP_BOOTC_BUILD + + + + YES + + diff --git a/shared/templates/sysctl/bash.template b/shared/templates/sysctl/bash.template index b3aafbc2757..424afde0167 100644 --- a/shared/templates/sysctl/bash.template +++ b/shared/templates/sysctl/bash.template @@ -38,10 +38,12 @@ SYSCONFIG_FILE="/etc/sysctl.conf" {{%- if SYSCTLVAL == "" or SYSCTLVAL is not string %}} {{{ bash_instantiate_variables("sysctl_" ~ SYSCTLID ~ "_value") }}} +if [[ "$OSCAP_BOOTC_BUILD" != "YES" ]] ; then # # Set runtime for {{{ SYSCTLVAR }}} # /sbin/sysctl -q -n -w {{{ SYSCTLVAR }}}="$sysctl_{{{ SYSCTLID }}}_value" +fi # # If {{{ SYSCTLVAR }}} present in /etc/sysctl.conf, change value to appropriate value @@ -54,10 +56,12 @@ sed -i "/^$SYSCONFIG_VAR/d" /etc/sysctl.conf {{%- else %}} +if [[ "$OSCAP_BOOTC_BUILD" != "YES" ]] ; then # # Set runtime for {{{ SYSCTLVAR }}} # /sbin/sysctl -q -n -w {{{ SYSCTLVAR }}}="{{{ SYSCTLVAL }}}" +fi # # If {{{ SYSCTLVAR }}} present in /etc/sysctl.conf, change value to "{{{ SYSCTLVAL }}}" diff --git a/shared/templates/sysctl/oval.template b/shared/templates/sysctl/oval.template index 35a7e94d39e..35a702455d2 100644 --- a/shared/templates/sysctl/oval.template +++ b/shared/templates/sysctl/oval.template @@ -29,8 +29,12 @@ {{% if CHECK_RUNTIME == "true" %}} - + + + + {{%- endif %}} @@ -53,8 +57,12 @@ {{% if CHECK_RUNTIME == "true" %}} - + + + + {{%- endif %}}