Skip to content

[Security Solution] Kibana crash on adding endpoint integration #83277

@pzl

Description

@pzl

Describe the bug:

Adding endpoint integration to a policy triggers a side effect (#79198) of installing detection index and rules. If installing those rules fails, the error is not caught correctly, and kibana crashes

Kibana/Elasticsearch Stack version:

kibana master @ 7e24ae6

Server OS version:

8.0.0-SNAPSHOT

Browser and Browser OS versions:

n/a

Elastic Endpoint version:

n/a

Original install method (e.g. download page, yum, from source, etc.):

kibana running from source yarn start --no-base-path

elasticsearch running from docker snapshot

docker run --rm -it \
    -p 9200:9200 -p 9300:9300 \
    -e discovery.type=single-node \
    -e xpack.security.authc.api_key.enabled=true \
    -e xpack.security.enabled=true \
    -e xpack.license.self_generated.type=trial \
    -e network.host=0.0.0.0 \
    -e ELASTIC_PASSWORD=foo \
    -e ES_JAVA_OPTS=-Xms4g -Xmx4g \
    --ulimit=host \
    --privileged
    elasticsearch:8.0.0-SNAPSHOT

(similar to yarn es snapshot, but the rule installation only fails w/ docker snapshot)

Steps to reproduce:

  1. start es snapshot in docker
  2. start kibana
  3. navigate to fleet policy page ( http://localhost:5601/app/ingestManager#/policies )
  4. Click Default policy name
  5. Add integration
  6. Endpoint Security
  7. give it a name
  8. Kibana will crash on clicking Save

Current behavior:

Performing the detection rules installation seems to fail with HTTP 503 and ECONNRESET. Which, sure, that's an environment thing maybe. But The exception is not handled and kibana crashes

Expected behavior:

Flaky connections or other errors are gracefully handled

Screenshots (if relevant):

2020-11-12-084016_scrot

2020-11-12-084116_scrot

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

server    log   [08:22:51.193] [error][data][elasticsearch] [ConnectionError]: read ECONNRESET
Unhandled Promise rejection detected:

{ ConnectionError: read ECONNRESET
    at ClientRequest.request.on.err (/home/dan/dev/elastic/kibana/node_modules/@elastic/elasticsearch/lib/Connection.js:132:18)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:401:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'ConnectionError',
  meta:
   { body: null,
     statusCode: null,
     headers: null,
     meta:
      { context: null,
        request: [Object],
        name: 'elasticsearch-js',
        connection: [Object],
        attempts: 0,
        aborted: false } },
  isBoom: true,
  isServer: true,
  data: null,
  output:
   { statusCode: 503,
     payload:
      { statusCode: 503,
        error: 'Service Unavailable',
        message: 'read ECONNRESET' },
     headers: {} },
  [Symbol(SavedObjectsClientErrorCode)]: 'SavedObjectsClient/esUnavailable' }

Terminating process...
 server crashed  with status code 1

Any additional context (logs, chat logs, magical formulas, etc.):

Metadata

Metadata

Assignees

Labels

Feature:EndpointElastic Endpoint featureTeam: SecuritySolutionSecurity Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.Team:Defend Workflows“EDR Workflows” sub-team of Security SolutionTeam:Detections and RespSecurity Detection Response TeambugFixes for quality problems that affect the customer experienceimpact:highAddressing this issue will have a high level of impact on the quality/strength of our product.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions