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

Dashboard TLS Configuration Details Bug #23726

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

zofskeez
Copy link
Contributor

@zofskeez zofskeez commented Oct 18, 2023

The TLS field of the configuration details section on the dashboard was not displaying accurately based on the configuration settings. Since the tls_disable default value is false, it doesn't need to be defined and could be missing from the configuration. In addition, when using TLS the tls_cert_file and tls_key_file values are required. I updated to check that tls_disable is either undefined or false and both file properties have value to determine if TLS is enabled.

The screen shot below is after the changes with the following config:

api_addr = "https://127.0.0.1:8200"
disable_mlock = true

listener "tcp" {
  address = "127.0.0.1:8200"
  tls_cert_file = "./certs/vault-cert.pem"
  tls_key_file = "./certs/vault-key.pem"
}

storage "inmem" {}

image

I also noticed when running a dev server that it was incorrectly reporting that TLS was Enabled which is now showing Disabled as expected.

image

Closes #23371

@zofskeez zofskeez added ui bug Used to indicate a potential bug backport/1.15.x labels Oct 18, 2023
@zofskeez zofskeez added this to the 1.15.1 milestone Oct 18, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Oct 18, 2023
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

// consider tls enabled if tls_disable is undefined or false AND both tls_cert_file and tls_key_file are defined
const tlsListener = this.args.vaultConfiguration?.listeners.find((listener) => {
const { tls_disable, tls_cert_file, tls_key_file } = listener.config || {};
return (tls_disable === undefined || tls_disable === false) && tls_cert_file && tls_key_file;
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to know that the vault listener config gets returned with tls_cert_file and tls_key_file as an option.

Could we do !tls_disable && tls_cert_file && tls_key_file instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes good catch! I believe that 0 and 1 are accepted in the config as well which this would not account for.

@@ -19,7 +19,7 @@
</B.Tr>
<B.Tr>
<B.Td>TLS</B.Td>
<B.Td data-test-vault-config-details="tls_disable">{{this.tlsDisabled}}</B.Td>
<B.Td data-test-vault-config-details="tls">{{this.tls}}</B.Td>
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Copy link
Contributor

@kiannaquach kiannaquach left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this Jordan 🎉

@zofskeez zofskeez merged commit a31b029 into main Oct 18, 2023
@zofskeez zofskeez deleted the ui/VAULT-20758/dashboard-tls branch October 18, 2023 21:47
zofskeez added a commit that referenced this pull request Oct 19, 2023
* fixes issues displaying accurate tls state in dashboard configuration details

* adds changelog entry

* updates tls getter to look for falsy in configuration details card
zofskeez added a commit that referenced this pull request Oct 19, 2023
* fixes issues displaying accurate tls state in dashboard configuration details

* adds changelog entry

* updates tls getter to look for falsy in configuration details card
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.15.0] Configuration details tile returns TLS Disabled, when it's enabled
2 participants