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

suricata: add SNI to related.hosts for TLS events #3665

Merged
merged 4 commits into from
Jul 8, 2022

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Jul 8, 2022

What does this PR do?

This adds the SNI host to related.hosts when the event is a TLS event and cleans up some template invocations.

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

  • Related to the original issue, I confirmed that when forwarded is not set as a tag, the host information is present in events. It is not possible with current testing infrastructure to test this AFAICS. Note that the MAC address populated by libbeat does not conform to the ECS docs.

How to test this PR locally

Related issues

Screenshots

@efd6 efd6 requested a review from a team as a code owner July 8, 2022 02:06
@efd6 efd6 self-assigned this Jul 8, 2022
@elasticmachine
Copy link

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

packages/suricata/changelog.yml Outdated Show resolved Hide resolved
@elasticmachine
Copy link

elasticmachine commented Jul 8, 2022

💚 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: 2022-07-08T08:32:59.300+0000

  • Duration: 13 min 14 sec

Test stats 🧪

Test Results
Failed 0
Passed 29
Skipped 0
Total 29

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Jul 8, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (5/5) 💚 3.171
Classes 100.0% (5/5) 💚 3.171
Methods 100.0% (44/44) 💚 10.463
Lines 95.94% (827/862) 👍 4.856
Conditionals 100.0% (0/0) 💚

Comment on lines +64 to +74
- script:
lang: painless
if: ctx.host?.mac != null
source:
def fixup(ArrayList macs) {
for (def i = 0; i < macs.length; i++) {
macs[i] = macs[i].replace(':','-').toUpperCase();
}
return macs;
}
ctx.host['mac'] = fixup(ctx.host?.mac);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was tested manually.

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:suricata Suricata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suricata events don't set the host.name field in ingest pipeline
3 participants