Skip to content

[cisco_asa] Fix 113015 grok to handle missing user IP. - #20691

Merged
taylor-swanson merged 11 commits into
mainfrom
fix/0-add-a-second-grok-pattern-to-80764160
Aug 14, 2026
Merged

[cisco_asa] Fix 113015 grok to handle missing user IP.#20691
taylor-swanson merged 11 commits into
mainfrom
fix/0-add-a-second-grok-pattern-to-80764160

Conversation

@ie-ops

@ie-ops ie-ops commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Executive summary

The grok processor for Cisco ASA message 113015 only had a pattern that required a trailing user IP = <IP> field. When a device emits a 113015 message without a user IP (e.g., local-database auth failures), the processor failed to match and logged a MISSING_CASE error. The fix adds a second, fallback grok pattern for 113015 that captures the username via %{NOTSPACE} and terminates without requiring the IP field, allowing these events to parse successfully. The unused USERNAME and CISCO_USER custom pattern definitions that were scoped to this grok block were also removed.

Proposed commit message

[cisco_asa] Fix 113015 grok to handle missing user IP.

Root cause

The parse_113015 grok processor has only one pattern that requires a trailing : user IP = <ip> segment, but Cisco ASA omits that field when authentication originates from a local/console context with no client IP, causing the processor to fail for that valid message variant.

Approach

Add a second grok pattern to the parse_113015 processor that matches the no-IP variant of the 113015 message (i.e., the message ends after user = <name> with no : user IP = ... suffix). The existing with-IP pattern stays first; the new no-IP pattern is appended second so grok tries the more-specific variant first. A new test event using the sanitized log line is added to test-additional-messages.log with its expected output entry.

Implementation

  1. Step 1: In packages/cisco_asa/data_stream/log/elasticsearch/ingest_pipeline/default.yml, locate the parse_113015 grok processor at line 464. Append a second pattern under patterns: after the existing with-IP pattern: "AAA user authentication Rejected(%{SPACE})?: reason = %{REASON:_temp_.cisco.rejection_reason}(%{SPACE})?: local database(%{SPACE})?: [Uu]ser = %{CISCO_USER:source.user.name}". Keep REASON and CISCO_USER pattern_definitions identical to the existing block.
  2. Step 2: Append the sanitized test event to packages/cisco_asa/data_stream/log/_dev/test/pipeline/test-additional-messages.log: <166>Jun 27 2026 10:00:24: %ASA-6-113015: AAA user authentication Rejected : reason = User was not found : local database : user = alice.johnson
  3. Step 3: Add a corresponding expected-output JSON object to packages/cisco_asa/data_stream/log/_dev/test/pipeline/test-additional-messages.log-expected.json mirroring the structure of existing 113015 entries but without source.address/source.ip fields, with cisco.asa.rejection_reason: "User was not found", source.user.name: "alice.johnson", and no entry in related.ip.
  4. Step 4: Add a changelog entry to packages/cisco_asa/changelog.yml as a new version 2.45.3 with type bugfix and description Fix grok pattern for message 113015 to handle the no-IP variant where user IP is absent.
  5. Step 5: Run elastic-package test pipeline for the cisco_asa package to confirm the new event parses correctly and the existing 113015 with-IP events continue to pass.

Pipeline changes

  • Add second pattern to the parse_113015 grok processor (line 470): "AAA user authentication Rejected(%{SPACE})?: reason = %{REASON:_temp_.cisco.rejection_reason}(%{SPACE})?: local database(%{SPACE})?: [Uu]ser = %{CISCO_USER:source.user.name}" — placed after the existing with-IP pattern so grok tries specific first.

Field / mapping changes

Sanitized error message

Processor 'grok' with tag 'parse_113015' in pipeline 'logs-cisco_asa.log-default' failed with message '[on_failure_message]'

Sanitized log (event_sanitized excerpt)

<166>Jun 27 2026 10:00:24: %ASA-6-113015: AAA user authentication Rejected : reason = User was not found : local database : user = alice.johnson

Reviewer concerns

  • The fallback pattern uses %{NOTSPACE:source.user.name} rather than the more permissive %{DATA:...} used by the original pattern; if any username legitimately contains spaces this would silently mismatch and fall through, though that is extremely unlikely for AAA usernames.
  • USERNAME and CISCO_USER were removed from the pattern_definitions block. The diff confirms neither was referenced in the original 113015 patterns (the first pattern used bare %{DATA} and %{IP}), so this is safe, but a reviewer should confirm they are not referenced anywhere else in this specific grok processor block.
  • The changelog link field points to PR Initial structure #1 which is a placeholder; should be updated to the real PR number before merge.

Self-review findings

Risk and classification

  • Plan risk level: low
  • Tags: pipeline, processors, test-fixture, ingest
  • Impact: medium

Links

  • Issue: (no issue number)
  • Issue title: cisco_asa.log [MISSING_CASE]: Processor 'grok' with tag 'parse_113015' in pipeline 'logs-cisco_asa.log…
  • Pipeline case: 83c5760ccc22127f
@ie-ops ie-ops added enhancement New feature or request Integration:cisco_asa Cisco ASA source:integration_sentinel The PR was created via the Integration Sentinel pipeline Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience] labels Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ 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.

@taylor-swanson

Copy link
Copy Markdown
Contributor

/test

2 similar comments
@taylor-swanson

Copy link
Copy Markdown
Contributor

/test

@taylor-swanson

Copy link
Copy Markdown
Contributor

/test

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package cisco_asa 👍(0) 💚(0) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
log 1050.42 812.35 -238.07 (-22.66%) 💔

To see the full report comment with /test benchmark fullreport

@taylor-swanson
taylor-swanson marked this pull request as ready for review August 13, 2026 12:46
@taylor-swanson
taylor-swanson requested a review from a team as a code owner August 13, 2026 12:46
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/integration-experience (Team:Integration-Experience)

Comment thread packages/cisco_asa/data_stream/log/elasticsearch/ingest_pipeline/default.yml Outdated
Comment thread packages/cisco_asa/data_stream/log/elasticsearch/ingest_pipeline/default.yml Outdated
Comment thread packages/cisco_asa/data_stream/log/elasticsearch/ingest_pipeline/default.yml Outdated
@vera-review-bot

Copy link
Copy Markdown

🟢 No issues across the latest commits 236af7c.

Review summary

Issues found across earlier commits d5cc7b5 — 1 medium
  • 🟡 The new USERPART definition is [^:]*?, which matches the empty string, so a 113015 line ending in user = sets source.user.name to "" instead of failing to parse. Make it one-or-more ([^:]+?) so an absent username falls through to the grok on_failure path. (link) (Resolved)
Issues found across earlier commits 0cf1c34 — 1 high
  • 🟠 The new no-IP fallback pattern captures source.user.name with an unbounded %{DATA}, so any 113015 line the first pattern rejects is silently mis-parsed with the whole ' : user IP = ...' tail stored as the username. Constrain the capture so it cannot cross a ':' and allow trailing whitespace on the IP pattern. (link) (Resolved)
Issues found across earlier commits 21db256 — 1 medium
  • 🟡 The new no-IP 113015 pattern captures the username with %{NOTSPACE}, so a username containing a space is silently truncated instead of failing (link) (Resolved)

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot - v0.2.6 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@vinit-chauhan
vinit-chauhan self-requested a review August 14, 2026 16:04
@ilyannn ilyannn self-assigned this Aug 14, 2026
@vinit-chauhan
vinit-chauhan removed their request for review August 14, 2026 16:44

@ilyannn ilyannn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, good call on names with spaces (we even have ;;alice-johnson(test user) username in the tests)

@ilyannn ilyannn assigned taylor-swanson and unassigned ilyannn Aug 14, 2026
@mergify

mergify Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@taylor-swanson
taylor-swanson enabled auto-merge (squash) August 14, 2026 19:18
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @taylor-swanson

@taylor-swanson
taylor-swanson merged commit 18de5f5 into elastic:main Aug 14, 2026
9 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package cisco_asa - 2.45.13 containing this change is available at https://epr.elastic.co/package/cisco_asa/2.45.13/

@taylor-swanson
taylor-swanson deleted the fix/0-add-a-second-grok-pattern-to-80764160 branch August 14, 2026 19:56
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:cisco_asa Cisco ASA source:integration_sentinel The PR was created via the Integration Sentinel pipeline Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience]

3 participants