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

[cisco_umbrella] Add DLP and Intrusion logs for SIG users #5716

Merged
merged 14 commits into from
Apr 4, 2023

Conversation

LaZyDK
Copy link
Contributor

@LaZyDK LaZyDK commented Mar 28, 2023

What does this PR do?

Added DLP logs, Intrusion logs and Firewall logs for Umbrella SIG users.
https://docs.umbrella.com/umbrella-user-guide/docs/log-format-and-versioning

Fixes audit logs being multiline.

Added event.severity, event.action, event.kind, event.category and event.type.

Proxylogs will now show up in SIEM -> Network -> HTTP as more HTTP ECS fields are used.

User identities is now in user.name.
Host identities is now in host.name.
Network identities is now in network.name.

Added found FQDNs to related.hosts.
Added files hashes from DLP logs to related.hash.

user_agent.original is now processed.

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.

@LaZyDK LaZyDK requested a review from a team as a code owner March 28, 2023 13:55
@elasticmachine
Copy link

elasticmachine commented Mar 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-04-04T08:06:53.077+0000

  • Duration: 14 min 49 sec

Test stats 🧪

Test Results
Failed 0
Passed 10
Skipped 0
Total 10

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

Copy link
Member

@P1llus P1llus 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 nitpick, can see if I can help out here.

I can also confirm that indeed the CSVs for auditlog are multiline, and in quite a few different format types.
Since we do not have system tests for S3 inputs we would have to test this manually.

Comment on lines 310 to 325
- remove:
field: user.email
if: ctx.user?.email == "null"
- remove:
field: user.id
if: ctx.user?.id == "null"
- remove:
field: user.name
if: ctx.user?.name == "null"
# Remove user field if present and empty
- remove:
field:
- user
if: ctx.user instanceof Map && ctx.user.size() == 0
ignore_failure: true

Copy link
Member

Choose a reason for hiding this comment

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

I think we have to go back to where these are populated and create better logic for when not to populate those fields.
We also try to not use ignore_failure (ignore_missing is fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are populated by the audit log - so we should go back to Cisco to fix fields containing the string "null". 🥇
I can remove the ignore_failure real fast.

@P1llus
Copy link
Member

P1llus commented Mar 28, 2023

/test

@elasticmachine
Copy link

elasticmachine commented Mar 28, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚
Classes 100.0% (1/1) 💚
Methods 95.238% (20/21) 👎 -4.762
Lines 94.805% (511/539) 👍 9.723
Conditionals 100.0% (0/0) 💚

@efd6
Copy link
Contributor

efd6 commented Mar 28, 2023

/test

@LaZyDK
Copy link
Contributor Author

LaZyDK commented Mar 29, 2023

I will deliver small edits to event.severity and event.action today.

@LaZyDK
Copy link
Contributor Author

LaZyDK commented Mar 29, 2023

Ready for comments.

LaZyDK and others added 2 commits March 30, 2023 08:38
…ipeline/default.yml

Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com>
@elasticmachine
Copy link

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

@efd6
Copy link
Contributor

efd6 commented Apr 2, 2023

/test

@LaZyDK
Copy link
Contributor Author

LaZyDK commented Apr 3, 2023

All tests are passing locally on my machine.

@efd6
Copy link
Contributor

efd6 commented Apr 3, 2023

Needs a field definition. In "static test: Verify sample_event.json – cisco_umbrella.log"

 one or more errors found in document: [0] field "cisco.umbrella.content_type" is undefined

This isn't being generated anymore, so you removed it from fields.yml, but it's still in the sample event. So you'll need to rerun elastic-package test system -g.

@LaZyDK
Copy link
Contributor Author

LaZyDK commented Apr 3, 2023

By some reason, the sample_event.json is never regenerated. Not even if I fill in the file with {}.
All tests run multiple times, including the exact line you wrote me.

@efd6
Copy link
Contributor

efd6 commented Apr 3, 2023

Turns out there are no system tests. This means that the sample event was hand constructed or added. I'm in two (three?) minds; the options are to remove the sample event and update the docs, hand correct the event (not ideal), obtain a real sample event and replace with that (also not ideal but probably better). Writing a system test is not really feasible since s3 is the only input. I think I'd be OK with a combination of 2. and 3. where you've checked that a hand edited sample is valid when compared to a real event.

@LaZyDK
Copy link
Contributor Author

LaZyDK commented Apr 4, 2023

New sample event, but with more information.

@efd6
Copy link
Contributor

efd6 commented Apr 4, 2023

/test

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

🎉

@efd6 efd6 merged commit e1b60a5 into elastic:main Apr 4, 2023
@LaZyDK LaZyDK deleted the umbrella_identity branch April 4, 2023 08:23
@elasticmachine
Copy link

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

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.

None yet

5 participants