Skip to content

[citrix_waf] Support RFC5424 syslog header for NetScaler NS14.1+#19891

Merged
ilyannn merged 1 commit into
mainfrom
citrix_waf-rfc5424-support
Jul 2, 2026
Merged

[citrix_waf] Support RFC5424 syslog header for NetScaler NS14.1+#19891
ilyannn merged 1 commit into
mainfrom
citrix_waf-rfc5424-support

Conversation

@ilyannn

@ilyannn ilyannn commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What / why

NetScaler NS14.1 and later, when sending syslog over TCP/UDP, prepend an RFC5424 syslog header to both CEF and native App Firewall messages (e.g. <134>1 2026-06-22T14:34:06Z host APPFW 0-PPE-3 - - CEF:0|...). The citrix_waf pipeline never stripped this envelope, so:

  • the whole <PRI>VER … header leaked into citrix.detail, and grok_citrix_detail_21fa0653 failed with "Provided Grok expressions do not match field value";
  • CEF events were additionally mis-routed to the native sub-pipeline, because the <134>1 prefix defeats the ctx.citrix.detail.startsWith("CEF:") routing check.

The shipped test fixtures only cover NS10/NS11 BSD-syslog framing (EOL), so this went undetected.

Changes

  • default.yml: add an RFC5424 envelope pattern to the entry grok that strips the header so the existing CEF/native routing works, mapping the envelope timestamp → @timestamp and the appliance hostname → observer.hostname. The RFC5424 APP-NAME is carried via a _tmp field for native reconstruction.
  • native.yml: make the NetScaler native header optional, and for native bodies that omit the leading module token (the module now lives in RFC5424 APP-NAME) reconstruct citrix.device_event_class_id from the carried APP-NAME. Classic NS10/NS11 native parsing is unchanged (the two paths are if-gated).
  • Add NS14.1 pipeline test fixtures (test-citrix-waf-rfc5424.log) covering both CEF and native, with fully synthetic values.
  • Bump to 1.21.0 (enhancement).

cef.yml is unchanged — once the envelope is stripped, the existing CEF dissect/KV handling works as-is.

Testing

  • elastic-package test pipeline — all pass; existing CEF/native expected outputs are byte-for-byte unchanged.
  • New RFC5424 fixture parses cleanly (no pipeline_error/error.message): correct @timestamp from the envelope, observer.hostname set, citrix.device_event_class_id reconstructed, native fields and CEF source.ip/port/KV fields populated, no leftover _tmp.* keys.
  • elastic-package lint and elastic-package check pass.

@ilyannn ilyannn force-pushed the citrix_waf-rfc5424-support branch from a581986 to b2bd593 Compare June 30, 2026 17:17
@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.

@ilyannn ilyannn self-assigned this Jun 30, 2026
@ilyannn ilyannn added enhancement New feature or request Integration:citrix_waf Citrix Web App Firewall Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience] labels Jun 30, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@ilyannn ilyannn force-pushed the citrix_waf-rfc5424-support branch 2 times, most recently from da3c4e9 to c5090d4 Compare July 1, 2026 16:56
NetScaler NS14.1 and later prepend an RFC5424 syslog header to both CEF
and native messages over TCP/UDP, which the pipeline never stripped. The
whole <PRI>VER ... envelope leaked into citrix.detail, so grok_citrix_detail
failed, and CEF events were mis-routed to the native sub-pipeline because the
<PRI>VER prefix defeats the startsWith("CEF:") check.

- default.yml: parse the RFC5424 envelope with the standard SYSLOG5424BASE /
  SYSLOG5424PRI grok building blocks (matching symantec_endpoint, fortinet,
  etc.), capturing log.syslog.{priority,version,hostname,appname,procid,msgid}
  and the envelope timestamp -> @timestamp, and surfacing the appliance
  hostname as observer.hostname. Stripping the envelope lets the existing
  CEF/native routing work.
- native.yml: make the NetScaler header optional and reconstruct
  citrix.device_event_class_id from the RFC5424 APP-NAME (log.syslog.appname)
  for native bodies that omit the module token. Classic NS10/NS11 parsing is
  unchanged.
- Declare the log.syslog.* ECS fields and add NS14.1 pipeline test fixtures
  (CEF + native).

Relates to elastic/sdh-beats#7312.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ilyannn ilyannn force-pushed the citrix_waf-rfc5424-support branch from c5090d4 to 9fa0951 Compare July 1, 2026 17:19
@ilyannn ilyannn marked this pull request as ready for review July 1, 2026 17:23
@ilyannn ilyannn requested a review from a team as a code owner July 1, 2026 17:23
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@vera-review-bot

Copy link
Copy Markdown

No issues across the latest commits 9fa0951.

I'll pick up this PR for review again after 15 minutes.

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

⚠️ Automated review — verify suggestions before applying.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @ilyannn

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Jul 1, 2026
@mergify

mergify Bot commented Jul 2, 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

@ilyannn ilyannn merged commit 030101f into main Jul 2, 2026
11 checks passed
@ilyannn ilyannn deleted the citrix_waf-rfc5424-support branch July 2, 2026 13:40
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:citrix_waf Citrix Web App Firewall Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants