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

[Connectors] Checking for undefined config and secrets during connector validation #122696

Merged
merged 6 commits into from Jan 19, 2022

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Jan 11, 2022

Resolves #122346

Summary

With this PR, we added validation of connector config and secrets together. This validation was only added to the email connector. We've found that in cases where the connector secrets field is undefined, this will lead to a null accessor error (Cannot read properties of undefined) when executing connector action (either via the test connector UI or during actual action execution. The secrets value can become undefined due to decryption errors during migration.

To Verify

  1. Create an email connector in an older version of Kibana. Verify that you can test execution with this connector and it is successful.
  2. On this branch, configure a different encryption key than before and start ES & Kibana using the data from 1)
  3. Navigate to Connector UI to test execution of this connector. You should receive an execution error that says secrets must be defined instead of Cannot read properties of undefined

Checklist

@ymao1 ymao1 self-assigned this Jan 11, 2022
@ymao1 ymao1 added Feature:Actions/Framework Issues related to the Actions Framework release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.0.0 v8.1.0 labels Jan 11, 2022
@ymao1 ymao1 marked this pull request as ready for review January 11, 2022 20:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Changes LGTM!

Tested with an email connector w/ username - password that was created in 7.15. I was able to see the difference after upgrading to main vs this PR and the error message change 👍

@LeeDr
Copy link
Contributor

LeeDr commented Jan 14, 2022

@elasticmachine merge upstream

@ymao1
Copy link
Contributor Author

ymao1 commented Jan 18, 2022

@elasticmachine merge upstream

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

@ymao1
Copy link
Contributor Author

ymao1 commented Jan 19, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @ymao1

@ymao1 ymao1 added the auto-backport Deprecated: Automatically backport this PR after it's merged label Jan 19, 2022
@ymao1 ymao1 merged commit d19a2f3 into elastic:main Jan 19, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 19, 2022
…or validation (elastic#122696)

* Checking for undefined config and secrets during connector validation

* Adding functional tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d19a2f3)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@ymao1 ymao1 deleted the alerting/null-accessor-error branch January 19, 2022 15:31
kibanamachine added a commit that referenced this pull request Jan 19, 2022
…or validation (#122696) (#123369)

* Checking for undefined config and secrets during connector validation

* Adding functional tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d19a2f3)

Co-authored-by: ymao1 <ying.mao@elastic.co>
ogupte pushed a commit to ogupte/kibana that referenced this pull request Jan 28, 2022
…or validation (elastic#122696)

* Checking for undefined config and secrets during connector validation

* Adding functional tests

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: Automatically backport this PR after it's merged Feature:Actions/Framework Issues related to the Actions Framework release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.0.0 v8.1.0
Projects
None yet
7 participants