forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Add Docker images with FIPS (elastic#175946)
## Summary Closes elastic/kibana-operations/issues/24 This adds a second flavor of UBI image (`kibana-ubi-fips`) which has a FIPS compliant version of OpenSSL compiled and linked to Node. Using the label `ci:build-docker-fips` will create the image in CI and push to the registry. The FIPS image start the Kibana NodeJS process using the FIPS compliant OpenSSL version. Kibana will start in this state but crash during runtime because there are many code changes required for it to be FIPS compliant, including `node_module` usage. I attempted numerous ways to load other OpenSSL providers alongside the FIPS provider, but it always led to Kibana crashing on invalid algorithm usage. --------- Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
558d1f6
commit e448334
Showing
21 changed files
with
220 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
steps: | ||
- command: .buildkite/scripts/steps/fips/build.sh | ||
label: 'Build FIPS Image' | ||
agents: | ||
queue: n2-2-spot | ||
depends_on: | ||
- build | ||
- quick_checks | ||
timeout_in_minutes: 60 | ||
soft_fail: true | ||
retry: | ||
automatic: | ||
- exit_status: '-1' | ||
limit: 3 |
This file contains 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 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 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 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 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 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,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
.buildkite/scripts/bootstrap.sh | ||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/artifacts/env.sh | ||
|
||
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co | ||
mkdir -p target | ||
download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" | ||
|
||
echo "--- Build FIPS image" | ||
node scripts/build \ | ||
--skip-initialize \ | ||
--skip-generic-folders \ | ||
--skip-platform-folders \ | ||
--skip-cdn-assets \ | ||
--skip-archives \ | ||
--docker-images \ | ||
--docker-namespace="kibana-ci" \ | ||
--docker-tag-qualifier="$BUILDKITE_COMMIT" \ | ||
--docker-push \ | ||
--skip-docker-ubi \ | ||
--skip-docker-ubuntu \ | ||
--skip-docker-cloud \ | ||
--skip-docker-serverless \ | ||
--skip-docker-contexts | ||
|
||
docker logout docker.elastic.co | ||
|
||
# Moving to `target/` first will keep `buildkite-agent` from including directories in the artifact name | ||
cd "$KIBANA_DIR/target" | ||
buildkite-agent artifact upload "./*docker-image*.tar.gz" |
This file contains 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 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 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 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 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 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 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 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
28 changes: 28 additions & 0 deletions
28
src/dev/build/tasks/os_packages/docker_generator/resources/fips/openssl/nodejs.cnf
This file contains 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,28 @@ | ||
########################################################################## | ||
## ## | ||
## This OpenSSL config is only loaded when running Kibana in FIPS mode. ## | ||
## ## | ||
## See: ## | ||
## https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md ## | ||
## https://www.openssl.org/docs/man3.0/man7/fips_module.html ## | ||
## ## | ||
########################################################################## | ||
|
||
nodejs_conf = nodejs_init | ||
.include /usr/local/ssl/fipsmodule.cnf | ||
|
||
[nodejs_init] | ||
providers = provider_sect | ||
alg_section = algorithm_sect | ||
|
||
[provider_sect] | ||
default = default_sect | ||
# The fips section name should match the section name inside the | ||
# included fipsmodule.cnf. | ||
fips = fips_sect | ||
|
||
[default_sect] | ||
activate = 1 | ||
|
||
[algorithm_sect] | ||
default_properties = fips=yes |
This file contains 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 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
Oops, something went wrong.