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

[Uptime] [Synthetics Integration] fall back to checking verification mode to determine if tls is enabled #117181

Conversation

dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented Nov 2, 2021

Summary

Fixes #115009

The Elastic Synthetics integration must provide backwards compatibility for integration policies created in earlier versions, because Fleet will not ship with auto upgrading package policies for the Elastic Synthetics integration until 8.1.0.

To support this backwards compatibility, #114914 was added to ensure that older policies are able to be upgraded to the most recent package version when editing. This resolves 99% of the compatibility issues.

However, we also changed the way we handle determining whether or not TLS is enabled during the package policy edit flow. This PR resolves those issues.

In 7.16, we added new logic to put a key onto the integration policy to determine if TLS had been enabled. This new key is used exclusively by the UI, not heartbeat, in order to render the TLS toggle as checked in the edit integration flow. That key is __ui.is_tls_enabled and __ui.is_zip_url_tls_enabled for normal http/tcp tls and for Zip URL tls, respectively.

However, policies created earlier than than 7.16 will not have this key. In order to support backwards compatibility, we check if ssl.verification_mode has been added the policy as a back up.

In reality, adding these new __ui keys for tls was not necessary and were added prematurely. The truth presence of ssl.verification_mode is sufficient way to check if tls has been abled for that policy, because ssl.verification_mode is always defined on every policy that has ssl enabled.

I don't feel comfortable removing the new __ui.is_tls_enabled and __ui.is_zip_url_tls_enabled after feature freeze, as it's working as expected for new policies. However, we should consider removing this in 8.0.0, as it's extra, unnecessary logic.

Testing

  1. Pull down this branch
  2. Change your Kibana port to 5602
  3. Start Kibana
  4. Run elastic-package stack up --version 8.0.0-SNAPSHOT -v
  5. Once elastic-package is up, run curl -u elastic:changeme -X POST "http://localhost:9200/_security/user/kibana_system/_password?pretty" -H 'Content-Type: application/json' -d' { "password" : "changeme" } '
  6. Login to localhost:5602
  7. Navigate directly to the synthetics integration on an old, pre-7.16 policy version by visiting http://localhost:5602/axi/app/integrations/detail/synthetics-0.3.0/overview
  8. Create an HTTP monitor and enable TLS
  9. Go to edit that HTTP monitor
  10. Verify that TLS is enabled within the edit flow

Screen Shot 2021-11-02 at 11 28 00 AM

@dominiqueclarke dominiqueclarke added bug Fixes for quality problems that affect the customer experience v8.0.0 Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Nov 2, 2021
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner November 2, 2021 16:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@elastic elastic deleted a comment from kibanamachine Nov 15, 2021
Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM, Tested locally !!

@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Test Failures

  • [job] [logs] OSS CI Group #9 / management scripted fields preview should display script results when script is valid
  • [job] [logs] Default CI Group #6 / Uptime app with real-world data uptime alerts overview page alert flyout controls posts an alert, verifies its presence, and deletes the alert

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
uptime 574.1KB 574.3KB +176.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dominiqueclarke dominiqueclarke merged commit 063fb2e into elastic:main Nov 17, 2021
@dominiqueclarke dominiqueclarke deleted the fix/synthetics-legacy-package-policy-support branch November 17, 2021 20:40
@kibanamachine
Copy link
Contributor

The following labels were identified as gaps in your version labels and will be added automatically:

  • v8.1.0

If any of these should not be on your pull request, please manually remove them.

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Nov 17, 2021
…tls is enabled (elastic#117181)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Nov 17, 2021
…tls is enabled (elastic#117181)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0
7.16

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Nov 17, 2021
…tls is enabled (#117181) (#118943)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
kibanamachine added a commit that referenced this pull request Nov 17, 2021
…tls is enabled (#117181) (#118944)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
TinLe pushed a commit to TinLe/kibana that referenced this pull request Nov 20, 2021
…tls is enabled (elastic#117181)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
dmlemeshko pushed a commit that referenced this pull request Nov 29, 2021
…tls is enabled (#117181)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.16.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime] Update Synthetics Integration UI to support legacy policy versions
5 participants