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

Revert "Revert "[Security Solution] Update ecs package to latest ecs … #168953

Closed
wants to merge 1 commit into from

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Oct 16, 2023

…definiti… (#168864)"

This reverts commit 11c0bac.

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 16, 2023

Prior 8.6 ECS ecs_flat.ts definition for faas.trigger:

{
  'faas.trigger': {
    dashed_name: 'faas-trigger',
    description: 'Details about the function trigger.',
    flat_name: 'faas.trigger',
    level: 'extended',
    name: 'trigger',
    normalize: [],
    short: 'Details about the function trigger.',
    type: 'nested',
  },
  'faas.trigger.request_id': {
    dashed_name: 'faas-trigger-request-id',
    description: 'The ID of the trigger request , message, event, etc.',
    example: 123456789,
    flat_name: 'faas.trigger.request_id',
    ignore_above: 1024,
    level: 'extended',
    name: 'trigger.request_id',
    normalize: [],
    short: 'The ID of the trigger request , message, event, etc.',
    type: 'keyword',
  },
  'faas.trigger.type': {
    dashed_name: 'faas-trigger-type',
    description: 'The trigger for the function execution.',
    example: 'http',
    expected_values: ['http', 'pubsub', 'datasource', 'timer', 'other'],
    flat_name: 'faas.trigger.type',
    ignore_above: 1024,
    level: 'extended',
    name: 'trigger.type',
    normalize: [],
    short: 'The trigger for the function execution.',
    type: 'keyword',
  },
}

which turns into this mapping:

{
  "faas": {
    "properties": {
      "trigger": {
        "type": "nested",
        "properties": {
          "type": {
            "ignore_above": 1024,
            "type": "keyword"
          },
          "request_id": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      },
    }
  }
}

Current ECS ecs_flat.ts definition for faas.trigger:

{
  'faas.trigger.request_id': {
    dashed_name: 'faas-trigger-request-id',
    description: 'The ID of the trigger request , message, event, etc.',
    example: 123456789,
    flat_name: 'faas.trigger.request_id',
    ignore_above: 1024,
    level: 'extended',
    name: 'trigger.request_id',
    normalize: [],
    short: 'The ID of the trigger request , message, event, etc.',
    type: 'keyword',
  },
  'faas.trigger.type': {
    dashed_name: 'faas-trigger-type',
    description: 'The trigger for the function execution.',
    example: 'http',
    expected_values: ['http', 'pubsub', 'datasource', 'timer', 'other'],
    flat_name: 'faas.trigger.type',
    ignore_above: 1024,
    level: 'extended',
    name: 'trigger.type',
    normalize: [],
    short: 'The trigger for the function execution.',
    type: 'keyword',
  },
}

which turns into this mapping:

{
  "faas": {
    "properties": {
      "trigger": {
        "properties": {
          "type": {
            "ignore_above": 1024,
            "type": "keyword"
          },
          "request_id": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      }
  }
}

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 16, 2023

It looks like this difference is reflected in the docs as well:
https://www.elastic.co/guide/en/ecs/8.6/ecs-faas.html vs
https://www.elastic.co/guide/en/ecs/current/ecs-faas.html

so we likely need to bring this up to the ECS team

@ymao1
Copy link
Contributor Author

ymao1 commented Oct 16, 2023

Looks like this was an intentional change to the schema because the faas.trigger field was not GA when it was introduced? elastic/ecs#2192

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Cypress Tests #1 / Enrichment Custom query rule from new risk scores Should has enrichment fields from legacy risk Should has enrichment fields from legacy risk
  • [job] [logs] Investigations - Security Solution Cypress Tests #5 / Timeline search and filters Update kqlMode for timeline should be able to update timeline kqlMode with filter should be able to update timeline kqlMode with filter

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/ecs 34718 39558 +4840

Async chunks

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

id before after diff
apm 3.7MB 3.8MB +89.8KB
infra 1.9MB 2.0MB +89.8KB
observability 1.0MB 1.1MB +89.8KB
securitySolution 13.0MB 13.1MB +89.8KB
triggersActionsUi 1.4MB 1.5MB +89.8KB
total +449.1KB
Unknown metric groups

API count

id before after diff
@kbn/ecs 35125 39995 +4870

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

@ymao1 ymao1 closed this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants