Skip to content

cisco_asa: relax some grok rules for divergent logs#3943

Merged
efd6 merged 2 commits intoelastic:mainfrom
efd6:3942-cisco_asa
Aug 10, 2022
Merged

cisco_asa: relax some grok rules for divergent logs#3943
efd6 merged 2 commits intoelastic:mainfrom
efd6:3942-cisco_asa

Conversation

@efd6
Copy link
Contributor

@efd6 efd6 commented Aug 3, 2022

What does this PR do?

Fixes grok handling of a variety of non-canonical log formats.

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

  • [ ]

How to test this PR locally

Related issues

Screenshots

@efd6 efd6 added bug Something isn't working, use only for issues Team:Security-External Integrations Integration:cisco_asa Cisco ASA labels Aug 3, 2022
@efd6 efd6 self-assigned this Aug 3, 2022
@efd6 efd6 marked this pull request as ready for review August 3, 2022 04:14
@efd6 efd6 requested a review from a team as a code owner August 3, 2022 04:15
@elasticmachine
Copy link

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

@elasticmachine
Copy link

elasticmachine commented Aug 3, 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-08-10T06:36:08.770+0000

  • Duration: 19 min 2 sec

Test stats 🧪

Test Results
Failed 0
Passed 30
Skipped 0
Total 30

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Aug 3, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚 2.918
Classes 100.0% (1/1) 💚 2.918
Methods 94.444% (17/18) 👍 4.91
Lines 65.424% (1211/1851) 👎 -26.154
Conditionals 100.0% (0/0) 💚

patterns:
- ^%{NOTSPACE:event.outcome} ((protocol %{POSINT:network.iana_number})|%{NOTSPACE:network.transport}) src %{NOTCOLON:_temp_.cisco.source_interface}:%{IPORHOST:source.address}(/%{POSINT:source.port})?\s*(\(%{CISCO_USER:_temp_.cisco.source_username}\) )?dst %{NOTCOLON:_temp_.cisco.destination_interface}:%{IPORHOST:destination.address}(/%{POSINT:destination.port})?%{DATA}by access-group "%{NOTSPACE:_temp_.cisco.list_id}"
pattern_definitions:
HOSTNAME: "\\b(?:[0-9A-Za-z][0-9A-Za-z-_]{0,62})(?:\\.(?:[0-9A-Za-z_][0-9A-Za-z-_]{0,62}))*(\\.?|\\b)"
Copy link
Contributor

@r00tu53r r00tu53r Aug 8, 2022

Choose a reason for hiding this comment

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

Any reason for adding underscore (_) to the HOSTNAME regex ? I missed seeing an event for this case.

Some hostnames include characters ('_') that do not comply with RFC952 and
RFC1123. This change allows those hostnames to be parsed. Since there is no RFC
to fall back on here, the rules used for hyphen is used for underscore.

Note that the pattern here is derived from the well known grok patterns collection
which allows a terminal hyphen, at odds with the RFCs.
@efd6 efd6 merged commit c85538c into elastic:main Aug 10, 2022
@efd6 efd6 deleted the 3942-cisco_asa branch February 5, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working, use only for issues Integration:cisco_asa Cisco ASA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cisco_asa: some grok patterns fail on some non-canonically formatted logs

3 participants