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

Enable SSL in the Elastic Stack #789

Merged
merged 39 commits into from
Jun 28, 2022
Merged

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Apr 12, 2022

Enable SSL in the Elastic Stack to ensure that everything works with recommended security settings.

Tasks:

  • Create self-signed certificates
    • Use a common self-signed root CA?
    • Create a pair of key/cert per service
  • Enable SSL in elasticsearch
  • Enable SSL in package-registry
  • Enable SSL in kibana
  • Enable SSL in fleet-server
  • Reduce use of insecure flags by configuring clients with proper CAs
  • Ingestion to ES works (with hack)
  • Check that elastic-package test works
    • Check with oldest supported stack version (7.14).
  • Fix stack in 7.x
    • Templatize kibana config to use xpack.fleet.agents.elasticsearch.ca_sha256. This is not what I want to do, see comment.
  • Configure Kubernetes agent
  • Configure custom agent (introduced in Add config option to deploy custom elastic-agents as test services #786).
  • Additional testing:
  • Reorganize/reuse certpool builders
  • Investigate problems with unexpectedly re-generated profile (and certificates). Seems solved at least since 64693ec.
  • Integrate cert files better with the profile
  • Keep support for non-SSL deployments? No.
  • Print endpoints when elastic-package stack up completes. Print kibana and elasticsearch information on boot-up #861

Fixes #654

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 12, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-06-23T09:01:40.904+0000

  • Duration: 36 min 5 sec

Test stats 🧪

Test Results
Failed 0
Passed 747
Skipped 0
Total 747

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@jsoriano jsoriano force-pushed the stack-enable-ssl branch 3 times, most recently from c72dd7c to 7c912c1 Compare April 20, 2022 17:17
@jsoriano jsoriano force-pushed the stack-enable-ssl branch 2 times, most recently from 62be326 to 55021bd Compare April 21, 2022 19:30
@v1v
Copy link
Member

v1v commented Apr 26, 2022

/test

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 26, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (31/31) 💚
Files 66.372% (75/113) 👍 0.3
Classes 61.392% (97/158) 👍 0.246
Methods 49.686% (316/636) 👍 0.56
Lines 33.345% (2847/8538) 👍 0.289
Conditionals 100.0% (0/0) 💚

@jsoriano jsoriano marked this pull request as ready for review June 23, 2022 14:31
@jsoriano jsoriano requested a review from a team June 23, 2022 14:31
@jsoriano
Copy link
Member Author

Opening for review.

Additional testing on Windows would be nice, @ManojS-shetty has agreed to give it a try 🙂 Thanks!

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

internal/profile/certs.go Show resolved Hide resolved
internal/profile/files.go Show resolved Hide resolved
@mtojek mtojek self-requested a review June 24, 2022 10:46
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@ManojS-shetty
Copy link

Opening for review.

Additional testing on Windows would be nice, @ManojS-shetty has agreed to give it a try 🙂 Thanks!

@jsoriano Followed the below steps to test this on windows virtual machine:

  • Generated the binary for elastic-package from the PR.
  • Tried the command elastic-package stack up -d
  • After few minutes i was able to hit the URL (https://localhost:5601)
  • But i observed kibana container was going into unhealthy state.
  • Below is the screenshot from the windows virtual machine.

Screenshot 2022-06-24 at 5 34 45 PM

@jsoriano
Copy link
Member Author

But i observed kibana container was going into unhealthy state.

This looks like #856, let's confirm offline with logs.

@ManojS-shetty ManojS-shetty self-requested a review June 27, 2022 10:54
@jsoriano
Copy link
Member Author

After looking to Manoj's logs, I couldn't find a reason why it was failing, it didn't seem related to #856, more testing is going to be needed.

@jsoriano
Copy link
Member Author

I did some manual testing on Windows and I found issues related to CRLF, see #869. After following the instructions added in this PR, elastic-package stack worked well for me with SSL.

@ManojS-shetty
Copy link

ManojS-shetty commented Jun 28, 2022

After following the steps in #869 . Able to run the elastic-package stack without any difficulty in windows development platform.

LGTM!

Thank you @jsoriano

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

Successfully merging this pull request may close these issues.

Enable SSL mode in the Elastic stack
6 participants