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

Mimecast_Elastic integration #2157

Merged
merged 8 commits into from
Nov 26, 2021
Merged

Mimecast_Elastic integration #2157

merged 8 commits into from
Nov 26, 2021

Conversation

djordje-adzemovic-devtech
Copy link
Contributor

@djordje-adzemovic-devtech djordje-adzemovic-devtech commented Nov 15, 2021

What does this PR do?

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.
  • If I'm introducing a new feature, I have modified the Kibana version constraint in my package's manifest.yml file to point to the latest Elastic stack release (e.g. ^7.13.0).

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@cla-checker-service
Copy link

cla-checker-service bot commented Nov 15, 2021

💚 CLA has been signed

@djordje-adzemovic-devtech djordje-adzemovic-devtech marked this pull request as draft November 15, 2021 08:21
@elasticmachine
Copy link

elasticmachine commented Nov 15, 2021

💚 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: 2021-11-26T11:12:24.912+0000

  • Duration: 21 min 39 sec

  • Commit: 913f122

Test stats 🧪

Test Results
Failed 0
Passed 65
Skipped 0
Total 65

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@djordje-adzemovic-devtech djordje-adzemovic-devtech marked this pull request as ready for review November 15, 2021 08:50
@djordje-adzemovic-devtech
Copy link
Contributor Author

/test

@elasticmachine
Copy link

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

@marc-gr
Copy link
Contributor

marc-gr commented Nov 15, 2021

/test

Copy link
Contributor

@marc-gr marc-gr left a comment

Choose a reason for hiding this comment

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

Left some comments. In addition could be interesting to add some system tests (you can take a look at the tests in the google_workspace integration for reference), this way we can ensure the httpjson config is set as expected on top of validating the pipelines.

separator: "\\."
target_field: file.parts
if: 'ctx?.file?.name != null && ctx?.event?.action == "threat-intel-feed-download"'
# - join:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment slipped in.

@@ -0,0 +1,5 @@
# Mimecast/Elastic Integration

This is a new integration created using the [elastic-package](https:/elastic/elastic-package) tool.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to add some information about the integration in the readme, anything relevant to its setup, prerequisites, ... along with the list of fields and a sample event. You can take a look at the README template found in _dev/build/docs/README.md and use the one in some other packages as a guide.

"from": "\u003c\u003e",
"message_id": "\u003cDB8P194MB0824EE4C8D360CCE3DEB0243A1B89@DB8P194MB0824.EURP194.PROD.OUTLOOK.COM\u003e",
"attachments": {
"hash": "2fb26be55ac710e4d9f80677ba24ae212dbb36bd934a0569fe521839e9f5d16e",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hashes, user info, ips, etc.. would be nice if you could add a processor to copy them into the related.* fields, it is very useful for cross referencing and making searches easier. https://www.elastic.co/guide/en/ecs/current/ecs-related.html

"name": "Inbound - Safe file with On-Demand Sandbox"
},
"event": {
"action": "user release, none",
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not 100% sure spaces and commas are desired in the event.action field, maybe processing it a bit to clean it up would be nice

@ebeahan
Copy link
Member

ebeahan commented Nov 18, 2021

@djordje-adzemovic-devtech the Mimecast integration is looking awesome!

@jamiehynds had mentioned you've adopted some fields proposed over in the ECS email RFC.

Not sure if it impacts any work here, but I wanted to call out that I've changed the proposed mappings a bit based on feedback from several users. A summary of the changes is covered in elastic/ecs#1593 (comment)

@djordje-adzemovic-devtech
Copy link
Contributor Author

Thank you @ebeahan ! Should not be such a big deal, and will be implemented.

@marc-gr
Copy link
Contributor

marc-gr commented Nov 23, 2021

/test

4 similar comments
@marc-gr
Copy link
Contributor

marc-gr commented Nov 23, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 24, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 24, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 24, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 24, 2021

/test

1 similar comment
@marc-gr
Copy link
Contributor

marc-gr commented Nov 24, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 24, 2021

/test

1 similar comment
@marc-gr
Copy link
Contributor

marc-gr commented Nov 25, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 25, 2021

Great work! Could you add a screenshot of the dashboards and the setup page? Would help a lot :)

Copy link
Contributor

@marc-gr marc-gr left a comment

Choose a reason for hiding this comment

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

Some small changes aside from the screenshots and I think it should be good to go

changes:
- description: Initial draft of the package
type: enhancement
link: https:/elastic/integrations/pull/0 # FIXME Replace with the real PR link
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
link: https:/elastic/integrations/pull/0 # FIXME Replace with the real PR link
link: https:/elastic/integrations/pull/2157

---
description: Pipeline for processing sample logs
processors:
# Generic event/ecs fields we always want to populated
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Generic event/ecs fields we always want to populated
# Generic event/ecs fields we always want to populate

Comment on lines 143 to 146
- set:
field: event.created
value: "{{mimecast.date}}"
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'
- append:
field: event.created
value: "{{mimecast.time}}"
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'
- join:
field: event.created
separator: " "
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- set:
field: event.created
value: "{{mimecast.date}}"
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'
- append:
field: event.created
value: "{{mimecast.time}}"
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'
- join:
field: event.created
separator: " "
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'
- join:
field: event.created
separator: " "
if: 'ctx?.mimecast?.date != null && ctx?.mimecast?.time != null'

### RECEIPT LOGS
- rename:
field: mimecast.acc
target_field: cloud.account.id
Copy link
Contributor

Choose a reason for hiding this comment

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

This field might be populated in some cases, would be necessary to re-map to a custom field to avoid issues (it is failing right now in CI, for example one or more errors found in documents stored in logs-mimecast.siem_logs-ep data stream: [0] found error.message in event: field [cloud.account.id] already exists

@djordje-adzemovic-devtech
Copy link
Contributor Author

Here are dashboards:
Screenshot_4
Screenshot_5
Screenshot_6
Screenshot_7
Screenshot_8
Screenshot_9
Screenshot_10
Screenshot_11
Screenshot_12
Screenshot_13
Screenshot_14
Screenshot_15
Screenshot_16
Screenshot_17
Screenshot_18
Screenshot_19
Screenshot_20
Screenshot_21
Screenshot_22
Screenshot_23
Screenshot_24
Screenshot_25
Screenshot_26
Screenshot_27
Screenshot_28
Screenshot_29
Screenshot_30
Screenshot_31
Screenshot_32
Screenshot_3

@djordje-adzemovic-devtech
Copy link
Contributor Author

Setup page screenshots:
Screenshot_1
Screenshot_2
Screenshot_3
Screenshot_4
Screenshot_5
Screenshot_6
Screenshot_7
Screenshot_8
Screenshot_34

@marc-gr
Copy link
Contributor

marc-gr commented Nov 26, 2021

/test

1 similar comment
@marc-gr
Copy link
Contributor

marc-gr commented Nov 26, 2021

/test

@marc-gr
Copy link
Contributor

marc-gr commented Nov 26, 2021

/test

@marc-gr marc-gr merged commit 0346221 into elastic:master Nov 26, 2021
eyalkraft pushed a commit to build-security/integrations that referenced this pull request Mar 30, 2022
* Mimecast package initial build

* First Data stream added

* Package commited

* Mimecast Elastic package - everything should be ok now

* Correct test which fails

* CR requested changes

* Nullcheck and formatting fixes

Co-authored-by: Marc Guasch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants