[cisco_asa] Fix 106015 grok for NAT alias names with underscores. - #20692
[cisco_asa] Fix 106015 grok for NAT alias names with underscores.#20692ie-ops wants to merge 2 commits into
Conversation
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
|
|
Pinging @elastic/integration-experience (Team:Integration-Experience) |
| "address": "PROD_INSIDE_GLOBAL", | ||
| "domain": "PROD_INSIDE_GLOBAL", |
There was a problem hiding this comment.
This is a bit odd, especially the domain. Technically, this value is an alias not an address, but I don't have any better suggestions on where to put it. More annoyingly, I don't know how you'd tell the difference between an alias or a hostname anyway, so this is probably fine.
|
@ie-ops - 💤 This PR was approved before I picked it up, so I will leave it — automatic reviews are skipped on approved PRs. If you would still like a review, request one with a |
|
Tick the box to add this pull request to the merge queue (same as
|
Executive summary
The grok processor for Cisco ASA message 106015 (
parse_106015) failed to parse log lines where the destination address was an ASA NAT alias name containing underscores (e.g.,PROD_INSIDE_GLOBAL). The default ElasticsearchHOSTNAMEgrok pattern excludes underscores, so such alias names did not match. The fix adds localpattern_definitionsto that single grok processor, overridingHOSTNAMEto permit underscores in each label segment and redefiningIPORHOSTto chain through the updatedHOSTNAME. A new pipeline test fixture entry covering an underscore-containing destination alias and ingress interface name is added to prevent regressions.Proposed commit message
Root cause
The
parse_106015grok processor uses the built-in ElasticsearchIPORHOSTpattern, whoseHOSTNAMEcomponent only allows alphanumeric characters and hyphens between dots; Cisco ASA NAT pool alias names containing underscores (e.g.PROD_INSIDE_GLOBAL) are valid on the destination side of 106015 messages but are not matched, causing the entire grok to fail. Unlikeparse_106023(which already defines a customHOSTNAMEallowing underscores viapattern_definitions),parse_106015has no such override.Approach
Replace the default Elasticsearch
IPORHOSTpattern in theparse_106015grok processor with a custompattern_definitionsblock that extendsHOSTNAMEto allow underscores (matching the identical override already used inparse_106023). Bothsource.addressanddestination.addresstokens need the extended pattern since ASA NAT global pool aliases such asPROD_INSIDE_GLOBALcan appear on either side of the connection. A new test fixture entry will cover the sanitized event with an underscore-containing destination alias.Implementation
packages/cisco_asa/data_stream/log/elasticsearch/ingest_pipeline/default.yml, locate theparse_106015grok processor at line 305–311.pattern_definitionsblock to theparse_106015grok processor definingHOSTNAMEas\b(?:[0-9A-Za-z][0-9A-Za-z\-_]{0,62})(?:\.(?:[0-9A-Za-z][0-9A-Za-z\-_]{0,62}))*(\. ?|\b)andIPORHOSTas(?:%{IP}|%{HOSTNAME})— identical to the override already present onparse_106023(line 357).%{IPORHOST:source.address}and%{IPORHOST:destination.address}— no change needed to the pattern string itself; only thepattern_definitionsaddition is required.Jun 27 01:09:46 host-1.example.local : %ASA-6-106015: Deny TCP (no connection) from 203.0.113.10/35531 to PROD_INSIDE_GLOBAL/80 flags PSH ACK on interface PUBLIC_FIREWALLto an appropriate existing test fixture log file (e.g.test-non-canonical.log).test-non-canonical.log-expected.json. Expected fields includesource.address=203.0.113.10,source.ip=203.0.113.10,source.port=35531,destination.address=PROD_INSIDE_GLOBAL,destination.domain=PROD_INSIDE_GLOBAL(nodestination.ip),network.transport=tcp,event.outcome=failure,event.code=106015,related.ip=[203.0.113.10],related.hosts=[host-1.example.local,PROD_INSIDE_GLOBAL].packages/cisco_asa/manifest.ymlfrom2.45.2to2.45.3(patch bump for bugfix).packages/cisco_asa/changelog.ymlfor version2.45.3with typebugfix:Fix 106015 grok pattern to match ASA NAT alias names containing underscores.Pipeline changes
pattern_definitionsblock to the existingparse_106015grok processor (line 305–311 in default.yml) with custom HOSTNAME (allowing underscores) and IPORHOST definitions, matching the identical override on parse_106023. No change to the pattern string itself.Field / mapping changes
—
Sanitized error message
Processor 'grok' with tag 'parse_106015' in pipeline 'logs-cisco_asa.log-default' failed with message '[on_failure_message]'Sanitized log (
event_sanitizedexcerpt)Jun 27 01:09:46 host-1.example.local : %ASA-6-106015: Deny TCP (no connection) from 203.0.113.10/35531 to PROD_INSIDE_GLOBAL/80 flags PSH ACK on interface PUBLIC_FIREWALLReviewer concerns
test-non-canonical.log) ends without a trailing newline (\ No newline at end of file); this is cosmetic but inconsistent with the rest of the test corpus.parse_106015; if other message-ID processors share the same IPORHOST ambiguity with underscore alias names, they would need analogous overrides separately.Self-review findings
Self-review invoked: yes (1 cycle)
Final validation passed: yes
Risk and classification
Links
f3ac0dcef9e14d1a