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

[ti_maltiverse] Add new Maltiverse threat intelligence integration #6741

Merged
merged 42 commits into from
Jul 26, 2023

Conversation

jlopezzarza
Copy link
Contributor

@jlopezzarza jlopezzarza commented Jun 28, 2023

What does this PR do?

Add Maltiverse as a source of data for Elastic Intelligence

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • Fields are correct
  • Tests are in place

How to test this PR locally

The changes can be tested in a local environment by adding the new integration to the stack. You will need to register in Maltiverse to generate an API key in order to request data.

Related issues

Screenshots

@cla-checker-service
Copy link

cla-checker-service bot commented Jun 28, 2023

💚 CLA has been signed

@elasticmachine
Copy link

elasticmachine commented Jun 28, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-07-26T09:14:38.885+0000

  • Duration: 15 min 52 sec

Test stats 🧪

Test Results
Failed 0
Passed 5
Skipped 0
Total 5

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@jlopezzarza jlopezzarza marked this pull request as ready for review June 28, 2023 14:39
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@jlopezzarza jlopezzarza marked this pull request as draft June 28, 2023 14:45
@marc-gr
Copy link
Contributor

marc-gr commented Jun 29, 2023

/cla

1 similar comment
@marc-gr
Copy link
Contributor

marc-gr commented Jun 29, 2023

/cla

@andrewkroh andrewkroh changed the title Add Maltiverse to threat intelligence integrations [ti_maltiverse] Add new Maltiverse threat intelligence integration Jun 29, 2023
@andrewkroh andrewkroh added Integration:ti_maltiverse Maltiverse New Integration Integration:ti_util Threat Intelligence Utilities and removed Integration:ti_util Threat Intelligence Utilities labels Jun 29, 2023
@kcreddy
Copy link
Contributor

kcreddy commented Jul 20, 2023

/test

fields: ["threat.indicator"]
- set:
field: _id
value: "{{ event.id }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add if: ctx.event?.id != null. Also please verify this in one of the document in Kibana

@kcreddy
Copy link
Contributor

kcreddy commented Jul 20, 2023

Also the CI is failing on tests because tests are not run after the changes are made. So, once you are done with above changes, please run:

eval "$(elastic-package stack shellinit)" && elastic-package test --generate -v 

and then

 elastic-package build && elastic-package format && elastic-package lint && elastic-package check && elastic-package build

@kcreddy
Copy link
Contributor

kcreddy commented Jul 23, 2023

/test

@kcreddy
Copy link
Contributor

kcreddy commented Jul 24, 2023

Hey @jlopezzarza The pipeline tests are failing. Are they successful on your end? If so, I think maybe some files are missing to be committed.

@jlopezzarza jlopezzarza requested a review from a team as a code owner July 24, 2023 07:26
@kcreddy
Copy link
Contributor

kcreddy commented Jul 24, 2023

/test

@kcreddy
Copy link
Contributor

kcreddy commented Jul 24, 2023

/test

@kcreddy
Copy link
Contributor

kcreddy commented Jul 25, 2023

Hey @jlopezzarza Tests are now successful.

There's field conflicts between source and destination (latest) indices.

It seems like a bug in elastic-package as its not expanding some fields in transform/latest/fields/fields.yml that are defined as ECS external .

To fix the issue, we will need to define their types explicitly. Please follow below steps to fix the mapping issue:

  1. Inside the transform/latest/fields/fields.yml , delete the fields that are copied from ecs.yml file. i.e, defined as - external: ecs
  2. Run elastic-package build
  3. Check the ecs.yml inside build folder. These fields should be expanded: build/packages/ti_...../data_stream/threatstream/fields/ecs.yml
  4. Copy these expanded fields into transform/latest/fields/fields.yml .

Comment on lines 1 to 15
- name: input.type
type: keyword
description: Input type.
- name: data_stream.type
type: constant_keyword
description: Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
- name: '@timestamp'
type: date
description: Event timestamp.
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to keep these above fields. Its just the fields defined as external are what needs to be replaced with full definition.

Comment on lines 192 to 197
- description: |-
Custom key/value pairs.
Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword.
Example: `docker` and `k8s` labels.
name: labels
type: object
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove labels field since its not going to be present in the destination index.

@kcreddy
Copy link
Contributor

kcreddy commented Jul 26, 2023

/test

1 similar comment
@kcreddy
Copy link
Contributor

kcreddy commented Jul 26, 2023

/test

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼
Thanks for the contribution @jlopezzarza 😄

@kcreddy kcreddy merged commit 2e27c44 into elastic:main Jul 26, 2023
@elasticmachine
Copy link

Package ti_maltiverse - 0.1.0 containing this change is available at https://epr.elastic.co/search?package=ti_maltiverse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants