-
Notifications
You must be signed in to change notification settings - Fork 230
USHIFT-6156: Enable fips support for release scenarios #5513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # {{- if env.Getenv "BREW_EC_RELEASE_VERSION" "" -}} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is checking if EC BREW RPMs exist, but we don't need this check because these RPMs are not needed to build this containerfile instead, we need to check if the parent image exist |
||
| # Note: This comment makes templating add a new line before the code | ||
| FROM localhost/rhel96-bootc-brew-ec-with-optional:latest | ||
|
|
||
| # Add fips=1 kernel argument | ||
| # See https://containers.github.io/bootc/building/kernel-arguments.html | ||
| RUN cat > /usr/lib/bootc/kargs.d/01-fips.toml <<'EOF' | ||
| kargs = ["fips=1"] | ||
| match-architectures = ["x86_64"] | ||
| EOF | ||
|
|
||
| # Enable the FIPS crypto policy | ||
| RUN dnf install -y crypto-policies-scripts && \ | ||
| update-crypto-policies --no-reload --set FIPS && \ | ||
| dnf clean all | ||
| # {{- end -}} | ||
|
kasturinarra marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # {{- if env.Getenv "BREW_RC_RELEASE_VERSION" "" -}} | ||
| # Note: This comment makes templating add a new line before the code | ||
| FROM localhost/rhel96-bootc-brew-rc-with-optional:latest | ||
|
|
||
| # Add fips=1 kernel argument | ||
| # See https://containers.github.io/bootc/building/kernel-arguments.html | ||
| RUN cat > /usr/lib/bootc/kargs.d/01-fips.toml <<'EOF' | ||
| kargs = ["fips=1"] | ||
| match-architectures = ["x86_64"] | ||
| EOF | ||
|
|
||
| # Enable the FIPS crypto policy | ||
| RUN dnf install -y crypto-policies-scripts && \ | ||
| update-crypto-policies --no-reload --set FIPS && \ | ||
| dnf clean all | ||
| # {{- end -}} |
|
kasturinarra marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # {{- if env.Getenv "BREW_Y0_RELEASE_VERSION" "" -}} | ||
| # Note: This comment makes templating add a new line before the code | ||
| FROM localhost/rhel96-bootc-brew-zstream-with-optional:latest | ||
|
|
||
| # Add fips=1 kernel argument | ||
| # See https://containers.github.io/bootc/building/kernel-arguments.html | ||
| RUN cat > /usr/lib/bootc/kargs.d/01-fips.toml <<'EOF' | ||
| kargs = ["fips=1"] | ||
| match-architectures = ["x86_64"] | ||
| EOF | ||
|
|
||
| # Enable the FIPS crypto policy | ||
| RUN dnf install -y crypto-policies-scripts && \ | ||
| update-crypto-policies --no-reload --set FIPS && \ | ||
| dnf clean all | ||
| # {{- end -}} |
|
kasturinarra marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| {{- if and (env.Getenv "BREW_EC_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need the BREW_Y1_RELEASE_VERSION check here because it's not used in this toml file |
||
| {{- /* | ||
|
|
||
| We wrap this template in a test so that the body of the output is | ||
| empty when there is no "current" version release. The output file | ||
| must end up completely empty, so we need to remove whitespace from | ||
| around the first and last template instructions. | ||
|
|
||
| */ -}} | ||
|
|
||
| name = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION}}-ec-fips" | ||
| description = "FIPS-enabled version of rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION}}-ec" | ||
| version = "0.0.1" | ||
| modules = [] | ||
| groups = [] | ||
| distro = "rhel-96" | ||
|
|
||
| # Use the base brewery blueprint as parent | ||
| parent = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION}}-ec" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to check if this parent exists in the first line of this file |
||
|
|
||
| # Add only FIPS-specific configuration | ||
| [[packages]] | ||
| name = "crypto-policies-scripts" | ||
| version = "*" | ||
|
|
||
| [customizations.kernel] | ||
| append = "fips=1" | ||
|
|
||
| [[customizations.files]] | ||
| path = "/etc/crypto-policies/config" | ||
| data = "FIPS" | ||
| {{- end -}} | ||
|
kasturinarra marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| {{- if and (env.Getenv "BREW_RC_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} | ||
| {{- /* | ||
|
|
||
| We wrap this template in a test so that the body of the output is | ||
| empty when there is no "current" version release. The output file | ||
| must end up completely empty, so we need to remove whitespace from | ||
| around the first and last template instructions. | ||
|
|
||
| */ -}} | ||
|
|
||
| name = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION}}-rc-fips" | ||
| description = "FIPS-enabled version of rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION}}-rc" | ||
| version = "0.0.1" | ||
| modules = [] | ||
| groups = [] | ||
| distro = "rhel-96" | ||
|
|
||
| # Use the base brewery blueprint as parent | ||
| parent = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION}}-rc" | ||
|
|
||
| # Add only FIPS-specific configuration | ||
| [[packages]] | ||
| name = "crypto-policies-scripts" | ||
| version = "*" | ||
|
|
||
| [customizations.kernel] | ||
| append = "fips=1" | ||
|
|
||
| [[customizations.files]] | ||
| path = "/etc/crypto-policies/config" | ||
| data = "FIPS" | ||
| {{- end -}} |
|
kasturinarra marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| {{- if and (env.Getenv "BREW_Y0_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} | ||
| {{- /* | ||
|
|
||
| We wrap this template in a test so that the body of the output is | ||
| empty when there is no "current" version release. The output file | ||
| must end up completely empty, so we need to remove whitespace from | ||
| around the first and last template instructions. | ||
|
|
||
| */ -}} | ||
|
|
||
| name = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION }}-zstream-fips" | ||
| description = "FIPS-enabled version of rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION }}-zstream" | ||
| version = "0.0.1" | ||
| modules = [] | ||
| groups = [] | ||
| distro = "rhel-96" | ||
|
|
||
| # Use the base brewery blueprint as parent | ||
| parent = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.MINOR_VERSION }}-zstream" | ||
|
|
||
| # Add only FIPS-specific configuration | ||
| [[packages]] | ||
| name = "crypto-policies-scripts" | ||
| version = "*" | ||
|
|
||
| [customizations.kernel] | ||
| append = "fips=1" | ||
|
|
||
| [[customizations.files]] | ||
| path = "/etc/crypto-policies/config" | ||
| data = "FIPS" | ||
| {{- end -}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional-fips" | ||
|
|
||
| check_platform() { | ||
| if [[ "${UNAME_M}" =~ aarch64 ]] ; then | ||
| record_junit "setup" "scenario_create_vms" "SKIPPED" | ||
| exit 0 | ||
| fi | ||
| } | ||
|
|
||
| scenario_create_vms() { | ||
| if ! does_commit_exist "${start_image}"; then | ||
| echo "Image '${start_image}' not found - skipping test" | ||
| return 0 | ||
| fi | ||
|
|
||
| check_platform | ||
|
|
||
| prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" | ||
| launch_vm --boot_blueprint rhel96-bootc --fips | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| check_platform | ||
|
kasturinarra marked this conversation as resolved.
|
||
|
|
||
| remove_vm host1 | ||
| } | ||
|
|
||
| scenario_run_tests() { | ||
| check_platform | ||
|
kasturinarra marked this conversation as resolved.
|
||
|
|
||
| run_tests host1 suites/fips/ | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}-fips" | ||
|
|
||
| check_platform() { | ||
| if [[ "${UNAME_M}" =~ aarch64 ]] ; then | ||
| record_junit "setup" "scenario_create_vms" "SKIPPED" | ||
| exit 0 | ||
| fi | ||
| } | ||
|
|
||
| scenario_create_vms() { | ||
| if ! does_commit_exist "${start_image}"; then | ||
| echo "Image '${start_image}' not found - skipping test" | ||
| return 0 | ||
| fi | ||
|
|
||
| check_platform | ||
|
|
||
| prepare_kickstart host1 kickstart.ks.template "${start_image}" | ||
| launch_vm --fips | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| check_platform | ||
|
kasturinarra marked this conversation as resolved.
|
||
|
|
||
| remove_vm host1 | ||
| } | ||
|
|
||
| scenario_run_tests() { | ||
| check_platform | ||
|
kasturinarra marked this conversation as resolved.
|
||
|
|
||
| run_tests host1 suites/fips/ | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.