-
Notifications
You must be signed in to change notification settings - Fork 2.1k
WIP: ci-operator/step-registry/openshift/e2e/fips: Add FIPS steps #10478
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| approvers: | ||
| - abhinavdahiya | ||
| - sallyom | ||
| - wking |
7 changes: 7 additions & 0 deletions
7
ci-operator/step-registry/ipi/conf/fips/ipi-conf-fips-commands.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o nounset | ||
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| echo 'fips: true' > "${SHARED_DIR}/install-config.yaml" |
10 changes: 10 additions & 0 deletions
10
ci-operator/step-registry/ipi/conf/fips/ipi-conf-fips-ref.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ref: | ||
| as: ipi-conf-fips | ||
| from: upi-installer | ||
| commands: ipi-conf-fips-commands.sh | ||
| resources: | ||
| requests: | ||
| cpu: 10m | ||
| memory: 100Mi | ||
| documentation: >- | ||
| This step enables FIPS in an install-config.yaml file. An existing install-config.yaml file should already exist in the shared directory. The resulting file remains in the shared directory for future consumption. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../../ipi/conf/fips/OWNERS |
1 change: 1 addition & 0 deletions
1
ci-operator/step-registry/openshift/e2e/aws/fips/default/OWNERS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../OWNERS |
12 changes: 12 additions & 0 deletions
12
...step-registry/openshift/e2e/aws/fips/default/openshift-e2e-aws-fips-default-workflow.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| workflow: | ||
| as: openshift-e2e-aws-fips-default | ||
| steps: | ||
| pre: | ||
| - chain: ipi-aws-pre | ||
| test: | ||
| - ref: openshift-e2e-fips | ||
| - ref: openshift-e2e-test | ||
| post: | ||
| - chain: ipi-aws-post | ||
| documentation: |- | ||
| The Openshift E2E AWS workflow executes the common end-to-end test suite and FIPS check on AWS with a default cluster configuration, where FIPS is disabled. |
14 changes: 14 additions & 0 deletions
14
ci-operator/step-registry/openshift/e2e/aws/fips/openshift-e2e-aws-fips-workflow.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| workflow: | ||
| as: openshift-e2e-aws-fips | ||
| steps: | ||
| pre: | ||
| - chain: ipi-conf-aws | ||
| - chain: ipi-conf-fips | ||
| - chain: ipi-install | ||
| test: | ||
| - ref: openshift-e2e-fips | ||
| - ref: openshift-e2e-test | ||
| post: | ||
| - chain: ipi-aws-post | ||
| documentation: |- | ||
| The Openshift E2E AWS workflow executes the common end-to-end test suite and FIPS check on AWS with a FIPS cluster configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../ipi/conf/fips/OWNERS |
45 changes: 45 additions & 0 deletions
45
ci-operator/step-registry/openshift/e2e/fips/openshift-e2e-fips-commands.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o nounset | ||
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM | ||
|
|
||
| oc --request-timeout=60s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > "${TMPDIR}/node-names" & | ||
| wait "$!" | ||
|
|
||
| cat "${TMPDIR}/node-names" | sort | while read -r NODE_NAME | ||
| do | ||
| echo "Checking FIPS for node ${NODE_NAME}" | ||
| attempt=0 | ||
| while true; do | ||
| out=$(oc --request-timeout=60s -n default debug "node/${NODE_NAME}" -- cat /proc/sys/crypto/fips_enabled || true) & | ||
| wait "$!" | ||
| if [[ ! -z "${out}" ]]; then | ||
| break | ||
| fi | ||
| attempt=$(( attempt + 1 )) | ||
| if [[ $attempt -gt 3 ]]; then | ||
| break | ||
| fi | ||
| echo "command failed, $(( 4 - $attempt )) retries left" | ||
| sleep 5 | ||
| done | ||
|
|
||
| if [[ -z "${out}" ]]; then | ||
| echo "oc debug node/${NODE_NAME} failed" >&2 | ||
| exit 1 | ||
| fi | ||
| if [[ "${FIPS_ENABLED}" = 'true' ]]; then | ||
| if [[ "${out}" -ne 1 ]]; then | ||
| echo "FIPS not enabled on node ${NODE_NAME} but should be, exiting" >&2 | ||
| exit 1 | ||
| fi | ||
| else | ||
| if [[ "${out}" -ne 0 ]]; then | ||
| echo "FIPS is enabled on node ${NODE_NAME} but should not be, exiting" >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
| done | ||
17 changes: 17 additions & 0 deletions
17
ci-operator/step-registry/openshift/e2e/fips/openshift-e2e-fips-ref.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ref: | ||
| as: openshift-e2e-fips | ||
| from: cli | ||
| commands: openshift-e2e-fips-commands.sh | ||
| env: | ||
| - name: TMPDIR | ||
| default: /tmp | ||
| documentation: A pathname of a directory made available for programs that need a place to create temporary files. | ||
| - name: FIPS_EXPECTED | ||
|
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. hmm.. this env is not used ..
Member
Author
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. Oops, I need to set it in the workflow that enables FIPS... |
||
| default: false | ||
| documentation: Set to 'true' when you expect FIPS to be enabled on all nodes. By default, the expectation is that FIPS is disabled on all nodes. | ||
| resources: | ||
| requests: | ||
| cpu: 300m | ||
| memory: 300Mi | ||
| documentation: >- | ||
| This step ensures FIPS is enabled or disabled as expected (depending on FIPS_EXPECTED). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this not a test in openshift-test binary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with that too. There should be some way to figure out what the configured value should be for a node? But I guess that wouldn't cover "installer ignores
fipssetting in the install-config". Do we care about covering that portion? We could probably cover it increate manifestsintegration testing in the installer.