Skip to content
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

[8.16] Shutdown Kibana on usages of PKCS12 truststore/keystore config (#192627) #200816

Closed

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

…ic#192627)

## Summary

Closes elastic#169741

PKCS12 truststores/keystores are not FIPS compliant and should not be
used when running if FIPS mode.

Users will be notified when they try to start KB in FIPS mode and are
using the flagged settings and KB will exit.

## Testing
You will need to generate a PKCS12 container (*.p12) file and have it
stored somewhere that your local KB can access.

To generate a PKCS12 to use:

- `openssl req -x509 -newkey rsa:4096 -keyout myPrivateKey.pem -out
myCertificate.crt`
- `openssl pkcs12 -export -out keyStore.p12 -inkey myPrivateKey.pem -in
myCertificate.crt`
  - Set password to `test`

Put the `.p12` file in your `config` directory (not required, but you
can copy and paste these commands easier)

Start an ES instance in a method of your choosing, but not using yarn es
snapshot. I like to use an 8.16.0-snapshot from the .es/cache directory
by running tar -xzvf elasticsearch-8.16.0-SNAPSHOT-darwin-aarch64.tar.gz
and cd into the new directory's bin folder to run ./elasticsearch

In a new terminal window, navigate to your the top level of your
elasticsearch folder and run:
`curl -X POST --cacert config/certs/http_ca.crt -u
elastic:YOUR_PASSWORD_HERE
"https://localhost:9200/_license/start_trial?acknowledge=true&pretty"`

This will enable the trial license for ES.

Ensure you have Docker running locally.

From any command line, run:
```
docker run --rm -it \
-v "$(pwd)"/config/keyStore.p12:/keyStore.p12:ro \
-e XPACK_SECURITY_FIPSMODE_ENABLED='true' \
-e ELASTICSEARCH_SSL_TRUSTSTORE_PATH='/keyStore.p12' \
-e ELASTICSEARCH_SSL_TRUSTSTORE_PASSWORD='test' \
-e ELASTICSEARCH_SSL_KEYSTORE_PATH='/keyStore.p12' \
-e ELASTICSEARCH_SSL_KEYSTORE_PASSWORD='test' \
-e SERVER_SSL_TRUSTSTORE_PATH='/keyStore.p12' \
-e SERVER_SSL_TRUSTSTORE_PASSWORD='test' \
-e SERVER_SSL_KEYSTORE_PATH='/keyStore.p12' \
-e SERVER_SSL_KEYSTORE_PASSWORD='test' \
-p 5601:5601/tcp docker.elastic.co/kibana-ci/kibana-ubi-fips:9.0.0-SNAPSHOT-92aeabf477867dc1768f9048b159f01f2ab1fcc3
```
This will start Kibana into Interactive Setup mode, copy and paste the
token from the ES startup logs.

In your logs, you will see an error letting users know that PKCS12
settings are not allowed in FIPS

It should look like:
<img width="1767" alt="Screenshot 2024-09-11 at 1 57 22 PM"
src="https://github.com/user-attachments/assets/c32c03b6-98b9-476d-8624-8cc1a535e23f">

## Release note
When running in FIPS mode, Kibana will forbid usage of PKCS12
configuration options

---------

Co-authored-by: Jean-Louis Leysens <[email protected]>
(cherry picked from commit a002a1b)
@kibanamachine kibanamachine force-pushed the backport/8.16/pr-192627 branch from d5ce941 to d4fdaa8 Compare November 19, 2024 20:51
auto-merge was automatically disabled November 19, 2024 20:51

Pull request was closed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @kc13greiner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants