Skip to content

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

Merged
ymao1 merged 6 commits intoelastic:mainfrom
ymao1:alerting/null-accessor-error
Jan 19, 2022
Merged

[Connectors] Checking for undefined config and secrets during connector validation#122696
ymao1 merged 6 commits intoelastic:mainfrom
ymao1:alerting/null-accessor-error

Conversation

@ymao1
Copy link
Copy Markdown
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 Platform ResponseOps team (formerly the Cases and Alerting teams) t// 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
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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
Copy Markdown

LeeDr commented Jan 14, 2022

@elasticmachine merge upstream

@ymao1
Copy link
Copy Markdown
Contributor Author

ymao1 commented Jan 18, 2022

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor Author

ymao1 commented Jan 19, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

💚 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 - use backport:version if exact versions are needed label Jan 19, 2022
@ymao1 ymao1 merged commit d19a2f3 into elastic:main Jan 19, 2022
kibanamachine added 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
Copy Markdown
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>
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 Feature:Actions/Framework Issues related to the Actions Framework release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.0.0 v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Actions] Fix Cannot read properties of undefined (reading 'password') error when executing decryption-error migrated connectors

7 participants