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

Regenerate self-provisioned ES TLS cert when it's outdated #1301

Merged
merged 1 commit into from
Nov 13, 2020
Merged

Regenerate self-provisioned ES TLS cert when it's outdated #1301

merged 1 commit into from
Nov 13, 2020

Conversation

kevinearls
Copy link
Contributor

@kevinearls kevinearls commented Nov 12, 2020

Force cert regeneration for self prov elasticsearch instances if SAN is invalid

Signed-off-by: Kevin Earls kearls@redhat.com

…is invalid

Signed-off-by: Kevin Earls <kearls@redhat.com>
@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #1301 (a6cde36) into master (b057274) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1301   +/-   ##
=======================================
  Coverage   87.37%   87.37%           
=======================================
  Files          89       89           
  Lines        4976     4976           
=======================================
  Hits         4348     4348           
  Misses        465      465           
  Partials      163      163           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b057274...a6cde36. Read the comment docs.

@jpkrohling jpkrohling changed the title Force cert regeneration for self prov elasticsearch instances if SAN … Regenerate self-provisioned ES TLS cert when it's outdated Nov 13, 2020
@@ -207,6 +207,12 @@ function generate_certs() {
local component=$1
local extensions=${2:-}

# For TRACING-1631 - if we can't find the namespace in the cert it's bad, regenerate everything
if [ $REGENERATE_NEEDED = 0 ] && [ "${component}" == "elasticsearch" ] && [ -f ${WORKING_DIR}/logging-es.crt ] ; then
openssl x509 -in ${WORKING_DIR}/logging-es.crt -text | grep -q "DNS:elasticsearch.${NAMESPACE}.svc"
Copy link
Contributor

Choose a reason for hiding this comment

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

We can merge without this change, but isn't there a command to extract only this field from the cert?

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

This can be merged right away if we need to, but wanted to clarify whether we can extract the SAN explicitly from the cert instead of getting the cert's text and using grep to find something that looks like a SAN field. This improvement can be done later, though.

@mergify mergify bot merged commit 462dabe into jaegertracing:master Nov 13, 2020
@kevinearls kevinearls deleted the force-cert-regeneration branch November 13, 2020 09:23
@kevinearls
Copy link
Contributor Author

@jpkrohling Agreed on the SAN. The problem here is that I could not explicitly extract the SAN with the version of OpenSSL I had on my Mac, even after update, as it did not have the -ext option.

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.

3 participants