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] browser monitors - Zip Url - add TLS Options and Proxy Url #112554

Conversation

dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented Sep 20, 2021

E2E testing not yet available

Resolves #111482

Adds TLS options for browser monitors when zip url is selected.

Screen Shot 2021-10-13 at 7 37 50 PM

Screen Shot 2021-10-13 at 7 37 40 PM

Testing

Setting up your e2e testing environment
Overview: You will need to run a local version of kibana and package registry to test pending changes, but will use elastic-package to run a snapshot view of elasticsearch, fleet-server, and elastic-agent. Since fleet server relies on kibana, we'll also use elastic-package to start a snapshot view of kibana exclusively for bootstrapping fleet-server, but will point our local version of kibana to a separate port. So we'll be running two versions of Kibana.

  1. Stop all instances of elasticsearch or kibana
  2. Checkout this PR. In kibana.dev.yml settings, add remove kibana.index and xpack.task_manager.index to remove legacy multitenancy features. This ensures that both our instances of Kibana can share saved objects related to fleet and agent. Also, add the following keys:
xpack.encryptedSavedObjects.encryptionKey: "12345678901234567890123456789012"
xpack.fleet.registryUrl: "http://localhost:8080"
server.port: 5602
  1. Start your local kibana instance using env BUILD_TS_REFS_DISABLE=true yarn kbn bootstrap && yarn start
  2. Update elastic package. It was recently updated to add support for the elastic-agent-complete image which contains support for running synthetics agent via heartbeat. Run go get github.com/elastic/elastic-package
  3. Checkout synthetics - add new ssl and filter params for browser monitors integrations#1778. Navigate to packages/synthetics in the repo directory. Run elastic-package clean, then elastic-package build.
  4. Run elastic-package stack up -d -v --services "elasticsearch,fleet-server,elastic-agent,package-registry" --version 8.0.0-SNAPSHOT in the packages/synthetics directory. This will start up elasticsearch, fleet-server, elastic-agent, package registry AND kibana. This is because fleet-server requires kibana for bootstrapping.
  5. Change the password to kibana_system user curl -u elastic:changeme -X POST "http://localhost:9200/_security/user/kibana_system/_password?pretty" -H 'Content-Type: application/json' -d' { "password" : "changeme" } '
  6. Navigate to your local instance of kibana at http://localhost:5602

Testing TLS

  1. Navigate to the synthetics integration at fleet/integrations/synthetics-0.3.1/add-integration
  2. Add a policy name, then select the browser type from the dropdown
  3. Fill out the form with the following options: Zip url: https://github.com/elastic/synthetics-demo/archive/refs/heads/main.zip, folder todos/synthetics, params { "url": "https://elastic.github.io/synthetics-demo/" }
  4. Toggle Enable tls options for ZIP URL. Remove all the version options from the ssl version combo box and add TLSv1.0. This will force the zip url to be fetched with an unsupported version.

Screen Shot 2021-10-11 at 10 19 40 AM

5. Save the integration and navigate to Uptime 6. Verify that the journey was not ran and data is not indexed into ES.

@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

htmlIdGenerator: () => () => `id-${Math.random()}`,
}));

jest.mock('../../../../../../../src/plugins/kibana_react/public', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What are your thoughts on creating a jest setup file? I've noticed we tend not to use them in favor of helpers that are imported where they are needed. I've actually ran into some problems with transitioning this mock to a helper function, and the only thing that has worked thus far has been including it inline in a jest setup file.

There are some things that we are likely to always mock, like the Monaco Code Editor, Canvas, and the htmlIdGenerator. Thoughts?

@dominiqueclarke dominiqueclarke added v7.16.0 v8.0.0 auto-backport Deprecated - use backport:version if exact versions are needed enhancement New value added to drive a business result release_note:enhancement Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Sep 21, 2021
@dominiqueclarke dominiqueclarke marked this pull request as ready for review September 21, 2021 15:09
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner September 21, 2021 15:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@dominiqueclarke dominiqueclarke changed the title Feature/111482 synthetics integration browser tls [Uptime] [Synthetics integration] browser monitors - Zip Url - add TLS Options Sep 21, 2021
@dominiqueclarke dominiqueclarke marked this pull request as draft September 21, 2021 18:22
@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@dominiqueclarke dominiqueclarke marked this pull request as ready for review October 12, 2021 01:09
@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
uptime 660 663 +3

Async chunks

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

id before after diff
uptime 564.7KB 570.0KB +5.3KB

History

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

@dominiqueclarke dominiqueclarke changed the title [Uptime] [Synthetics integration] browser monitors - Zip Url - add TLS Options [Uptime] [Synthetics integration] browser monitors - Zip Url - add TLS Options and Proxy Url Oct 14, 2021
Copy link

@drewpost drewpost left a comment

Choose a reason for hiding this comment

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

Looks good from design and product perspective. Ship it.

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

Tested this locally, works as expected. LGTM.

...original,
// Mocking CodeEditor, which uses React Monaco under the hood
CodeEditor: (props: any) => (
<input
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool 🥇

@dominiqueclarke dominiqueclarke merged commit 7fb99fb into elastic:master Oct 14, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2021
…S Options and Proxy Url (elastic#112554)

* add tls options to browser monitors when zip url is selected

* adjust types

* add tests

* refactor tls fields and zip url tls fields

* adjust types

* adjust i18n

* add proxy url

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 14, 2021
…S Options and Proxy Url (#112554) (#115080)

* add tls options to browser monitors when zip url is selected

* adjust types

* add tests

* refactor tls fields and zip url tls fields

* adjust types

* adjust i18n

* add proxy url

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Dominique Clarke <[email protected]>
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 enhancement New value added to drive a business result release_note:enhancement Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime] Support HTTP Common options for synthetics integration
5 participants