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

Filebeat sophos/utm: Support logs containing hostname in syslog header #28638

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Oct 26, 2021

What does this PR do?

Updates the sophos/utm fileset (rsa2elk) so that it prioritizes logs that contain a hostname in their syslog header.

Why is it important?

Without this change, logs with a hostname are not correctly parsed.

Checklist

  • [ ] My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Known issues

Note that this change in turn can cause problems with syslog headers that don't contain a hostname. Due to the way the logs are structured, it's not possible to reliably support both scenarios at the same time.

This prioritizes logs with a hostname, hoping that they are more common.

As an example, given the following log (without a hostname):

2016:01:29-06:09:59 smtpd[905]: MASTER[NNN]: QR globally disabled, status one set to 'disabled'

The current parser will take smtpd[905] as hostname, MASTER as the message ID and NNN as the process ID.

Because of this, is recommended that all logs include a hostname.

Related issues

@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 26, 2021
@adriansr adriansr requested a review from a team October 26, 2021 10:21
@mergify
Copy link
Contributor

mergify bot commented Oct 26, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b fix_sophos_utm_header_order upstream/fix_sophos_utm_header_order
git merge upstream/master
git push upstream fix_sophos_utm_header_order

@elasticmachine
Copy link
Collaborator

💚 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

  • Duration: 93 min 23 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

@adriansr adriansr merged commit 71204c2 into elastic:master Oct 29, 2021
@adriansr adriansr deleted the fix_sophos_utm_header_order branch October 29, 2021 07:45
mergify bot pushed a commit that referenced this pull request Oct 29, 2021
)

Updates the sophos/utm datastream to support logs that include a
hostname in their syslog header.

(cherry picked from commit 71204c2)
adriansr added a commit that referenced this pull request Oct 29, 2021
…hostname in syslog header (#28714)

* Filebeat sophos/utm: Support logs with hostname in syslog header (#28638)

Updates the sophos/utm datastream to support logs that include a
hostname in their syslog header.

(cherry picked from commit 71204c2)

Co-authored-by: Adrian Serrano <adrisr83@gmail.com>
Icedroid pushed a commit to Icedroid/beats that referenced this pull request Nov 1, 2021
…stic#28638)

Updates the sophos/utm datastream to support logs that include a
hostname in their syslog header.
@adriansr adriansr added the backport-v8.0.0 Automated backport with mergify label Nov 11, 2021
@adriansr
Copy link
Contributor Author

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Nov 11, 2021

refresh

✅ Pull request refreshed

adriansr added a commit that referenced this pull request Nov 11, 2021
)

Updates the sophos/utm datastream to support logs that include a
hostname in their syslog header.

(cherry picked from commit 71204c2)
adriansr added a commit that referenced this pull request Nov 11, 2021
) (#28930)

Updates the sophos/utm datastream to support logs that include a
hostname in their syslog header.

(cherry picked from commit 71204c2)

Co-authored-by: Adrian Serrano <adrisr83@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify enhancement review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sophos UTM Integration incorrectly parses message header
3 participants