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

[Cases] Handle undefined connectors config field #120686

Merged

Conversation

jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Dec 7, 2021

This fixes an issue where Cases will crash the UI when determining if a connector is deprecated. This is because we attempt to read from the config property on a connector and the property might be undefined. config is undefined when the connector is pre-configured. If a connector doesn't leverage the config field it will be an empty object.

For more details see: #119696

I filter out the connectors do not have the config field defined or are marked as PreConfigured: true.

Cases will not show the connectors as options to select.

Slack has an empty config

image

Cases doesn't show the preconfigured connectors

image

To test this you can define the following in your config/kibana.dev.yml

xpack.actions.preconfigured:
  my-servicenow:
    name: preconfigured-servicenow-sir-connector-type
    actionTypeId: .servicenow-sir
    config:
      usesTableApi: true
      apiUrl: https://testservicenow
      hasAuth: true

Release Notes

Pre-configured connectors cannot be used within Cases.

cc: @YulNaumenko

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-cases (Team:Threat Hunting:Cases)

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@jonathan-buttner jonathan-buttner added auto-backport Deprecated - use backport:version if exact versions are needed and removed v7.16.1 labels Dec 8, 2021
@cnasikas
Copy link
Member

@elasticmachine merge upstream

@@ -203,17 +203,10 @@ async function get(
}
}

async function getConnectors({
export async function getConnectors({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm exporting this so I can test it directly 😬 I could test via the createConfigurationSubClient but it's a little more difficult.

@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

@jonathan-buttner jonathan-buttner merged commit 55b07a2 into elastic:main Dec 17, 2021
@jonathan-buttner jonathan-buttner deleted the cases-fix-preconfig-connectors branch December 17, 2021 14:11
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Dec 17, 2021
* Marking config as optional

* Filtering out preconfigured connectors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Dec 17, 2021
* Marking config as optional

* Filtering out preconfigured connectors

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

💚 Backport successful

Status Branch Result
8.0
7.17

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Dec 17, 2021
* Marking config as optional

* Filtering out preconfigured connectors

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

Co-authored-by: Jonathan Buttner <56361221+jonathan-buttner@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Dec 17, 2021
* Marking config as optional

* Filtering out preconfigured connectors

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

Co-authored-by: Jonathan Buttner <56361221+jonathan-buttner@users.noreply.github.com>
@KOTungseth KOTungseth added the Team:Threat Hunting Security Solution Threat Hunting Team label Jan 19, 2022
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 release_note:fix Team:Threat Hunting Security Solution Threat Hunting Team v7.17.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants