[panw] Fix ignore_missing on threat XFF convert processor. - #20402
[panw] Fix ignore_missing on threat XFF convert processor.#20402ie-ops wants to merge 3 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. |
🚀 Benchmarks reportTo see the full report comment with |
Updated changelog for version 5.5.1 to reflect the correct pull request link.
|
Pinging @elastic/integration-experience (Team:Integration-Experience) |
|
✅ All changelog entries have the correct PR link. |
| <14>Nov 06 14:11:30 pa555 1,2024/11/06 14:11:30,0000000000001,THREAT,file,2562,2024/11/06 14:11:30,192.168.1.2,10.71.208.15,0.0.0.0,0.0.0.0,file download test rule,contoso\\steve,,web-browsing,vsys1,HOMENET,EXTNET,ethernet1/2,ethernet1/1,log-profile1,2024/11/06 14:11:30,994313,2,37268,443,0,0,0x1002000,tcp,alert,"elastic-agent.exe",Windows Executable (EXE)(52020),computer-and-internet-info,low,server-to-client,7367538158076100804,0x8000000000000000,192.168.0.0-192.168.255.255,United States,,,0,,,1,,,,,,,,0,199,479,0,0,,pa555,artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.15.3+build202411051926-windows-x86_64.zip,,,,7213055707168598,,0,2024/11/06 14:11:30,N/A,N/A,AppThreat-8911-9049,0x0,0,4294967295,,,88e69ca4-8783-4b7c-9982-f73ec6f1a83c,1679420,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,2024-11-06T14:11:30.036-05:00,,,,internet-utility,generate-internet,browser-based,2,"used-bymalware,able-to-transfer-file,has-known-vulnerability,tunnel-other-application,pervasive-use",,web-browsing,no,no, | ||
| <14>Nov 22 11:44:08 pa555 1,2024/11/22 11:44:07,013101001308,THREAT,spyware,2561,2024/11/22 11:44:07,67.43.156.0,67.43.156.1,0.0.0.0,0.0.0.0,A_DST_L7D_DNS,domain\user01,,dns-base,vsys1,Group,Servers,abc.123,abd.234,Panorama-Elastic,2024/10/01 10:43:54,34891187,2,59020,53,0,0,0x3000,tcp,sinkhole,"*.domain.dev",Suspicious Domain(12000000),any,medium,client-to-server,7401113521124350246,0x8000000000000000,10.0.0.0-10.255.255.255,10.0.0.0-10.255.255.255,,,0,,,0,,,,,,,,0,0,0,0,0,Core,AC5250,,,,,0,,0,,N/A,domain-edl,AppThreat-0-0,0x0,0,4291167295,,,5e791170-7507-4ab1-a951-79ebed0dad21,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,2024-10-01T10:43:55.308+02:00,,,,infrastructure,networking,network-protocol,3,"used-by-malware,has-known-vulnerability,pervasive-use",dns,dns-base,no,no,_reportid | ||
| Nov 26 12:53:54 FW-DNS-11 - 1,2025/11/26 12:53:53,023001020827,THREAT,spyware,2562,2025/11/26 12:53:53,10.1.15.61,10.100.15.1,0.0.0.0,0.0.0.0,From Endpoints to DNS_service,net.ad.users\empty14,,dns-base,vsys1,Consumer,Provider,es1.11,es1.12,All_Log_servers,2025/11/26 12:53:53,188610,1,63386,53,0,0,0x3000,udp,sinkhole,"user4.setupvpn.com",Proxy:setupvpn.com(109010004),any,low,client-to-server,7462647088666832890,0x0,10.0.0.0-10.255.255.255,10.0.0.0-10.255.255.255,,,0,,,0,,,,,,,,0,0,0,0,0,,FW-DNS-11,,,,,0,,0,,N/A,dns-proxy,AppThreat-0-0,0x0,0,4294967295,,,12345678-4444-4444-4444-123456789abc,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,2025-11-26T12:53:54.358+01:00,,,,infrastructure,networking,network-protocol,3,"used-by-malware,has-known-vulnerability,pervasive-use",dns,dns-base,no,no, | ||
| Nov 30 16:44:36 PA-220 1,2018/11/30 16:44:36,012801096514,THREAT,url,2049,2018/11/30 16:44:36,192.168.15.224,175.16.199.1,192.168.1.63,175.16.199.1,new_outbound_from_trust,,,ssl,vsys1,trust,untrust,ethernet1/2,ethernet1/1,send_to_mac,2018/11/30 16:44:36,28191,1,52984,443,37679,443,0x403000,tcp,alert,"consent.cmp.oath.com/",(9999),Web-URL-Allowlist,informational,client-to-server,7726,0x0,192.168.0.0-192.168.255.255,United States,0,,0,,,0,,,,,,,,0,0,0,0,0,,PA-220,,,,,0,,0,,N/A,N/A,AppThreat-0-0,0x0,0,4294967295,, |
There was a problem hiding this comment.
Severity: 🟡 Medium confidence: high path: packages/panw/data_stream/panos/_dev/test/pipeline/test-panw-panos-threat-sample.log:220
The new sample log leaves the X-Forwarded-For column empty, so its expected output is identical with and without the ignore_missing fix and it guards nothing. Add a sample with the XFF column populated so the convert branch is actually exercised.
Details
In threat.yml the csv processor maps CSV column 42 to _temp_.forwarded_ip. In this new line that column is empty (the run ...,0,,,,,,,,0,0,0,0,0,,PA-220,... after url_idx), and the Elasticsearch csv processor skips empty values when empty_value is not configured, so _temp_.forwarded_ip is never set.
Before this PR that missing field made the convert throw, but the processor's on_failure rename already carried ignore_missing: true (threat.yml:206), so the failure was swallowed with no error.message, no event.kind: pipeline_error, and no field written. The rendered document is therefore byte-identical before and after adding ignore_missing: true — this test case would pass unchanged against main.
The missing-XFF path is also already covered: the pre-existing samples on lines 218 and 219 (pa555 and FW-DNS-11) both have an empty column 42 and pass today.
What is genuinely untested is the populated-XFF behaviour. network.forwarded_ip and panw.panos.forwarded_ip appear nowhere in test-panw-panos-threat-sample.log-expected.json, and the four x_forwarded_for entries that do appear come from default.yml:1372 (_temp_.srcuser renamed when label bit 0x00080000 is set), not from this convert processor's on_failure.
Recommendation:
Populate CSV column 42 so the convert actually runs and writes network.forwarded_ip/panw.panos.forwarded_ip. Using the same line with the XFF slot filled (3rd empty field after url_idx):
Nov 30 16:44:37 PA-220 1,2018/11/30 16:44:37,012801096514,THREAT,url,2049,2018/11/30 16:44:37,192.168.15.224,175.16.199.1,192.168.1.63,175.16.199.1,new_outbound_from_trust,,,ssl,vsys1,trust,untrust,ethernet1/2,ethernet1/1,send_to_mac,2018/11/30 16:44:37,28192,1,52985,443,37680,443,0x403000,tcp,alert,"consent.cmp.oath.com/",(9999),Web-URL-Allowlist,informational,client-to-server,7727,0x0,192.168.0.0-192.168.255.255,United States,0,,0,,,0,,,192.0.2.55,,,,,0,0,0,0,0,,PA-220,,,,,0,,0,,N/A,N/A,AppThreat-0-0,0x0,0,4294967295,,
A second variant with a non-IP value in that slot (for example unknown-proxy) would cover the on_failure fallback into panw.panos.x_forwarded_for. Regenerate expectations with elastic-package test pipeline -g.
🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills
⚠️ Automated review — verify suggestions before applying.
| # newer versions go on top | ||
| - version: "5.5.1" | ||
| changes: | ||
| - description: Fix missing `ignore_missing` guard on XFF convert processor in threat pipeline, preventing errors for THREAT logs without an X-Forwarded-For header. |
There was a problem hiding this comment.
Severity: 🔵 Low confidence: high path: packages/panw/changelog.yml:4
The changelog says the fix prevents "errors" for THREAT logs without an XFF header, but no error was ever surfaced — reword it to describe the redundant processor failure this actually removes.
Details
The convert processor's on_failure rename already sets ignore_missing: true (threat.yml:206), so a missing _temp_.forwarded_ip was caught and discarded silently: no error.message was appended, event.kind was never set to pipeline_error, and no tag was added. Users saw no errors on THREAT logs without an X-Forwarded-For header.
As written, this entry tells operators that documents were failing to ingest, which will send them looking for data loss that did not occur. What the change actually removes is a thrown-and-caught processor exception on every THREAT log lacking an XFF value.
Recommendation:
Describe the real effect:
- version: "5.5.1"
changes:
- description: Add `ignore_missing` to the XFF convert processor in the threat pipeline to avoid a redundant processor failure on THREAT logs without an X-Forwarded-For value.
type: bugfix
link: https://github.com/elastic/integrations/pull/20402🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills
⚠️ Automated review — verify suggestions before applying.
Review summaryIssues found across the latest commits 4241d9a — 1 medium, 1 low
🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills
|
💚 Build Succeeded
History
|
Executive summary
Added
ignore_missing: trueto theconvertprocessor for_temp_.forwarded_ipin the THREAT pipeline. Without this guard, any THREAT log lacking an X-Forwarded-For header would fail the processor with a 'field not present' error, causing the entire document to error rather than process successfully. A new test fixture (URL subtype with no XFF) was added to cover this previously untested path.Proposed commit message
Root cause
The convert processor in
threat.ymlreads_temp_.forwarded_ipwithoutignore_missing: true; when a THREAT URL log arrives without the optional X-Forwarded-For HTTP header, the field is absent and Elasticsearch throws an error before theon_failurehandler can fire.Approach
Add
ignore_missing: trueto the convert processor taggedconvert__temp__forwarded_ip_to_network_forwarded_ip_e6722dccinthreat.yml(line 195). This mirrors the pattern already used indefault.ymlfor the samenetwork.forwarded_ipfield (tagconvert_network_forwarded_ip_8bdee41f), whereignore_missing: trueis present. Theon_failurerename block below already hasignore_missing: trueso no change is needed there. Add a test fixture for a URL-subtype THREAT event that has no XFF value, bump the package version to 5.5.1, and add a bugfix changelog entry.Implementation
packages/panw/data_stream/panos/elasticsearch/ingest_pipeline/threat.ymlat line 195, addignore_missing: trueto the convert processor taggedconvert__temp__forwarded_ip_to_network_forwarded_ip_e6722dcc(after thetype: ipline).packages/panw/data_stream/panos/_dev/test/pipeline/test-panw-panos-threat-url-no-xff-sample.logcontaining the sanitized event (URL-subtype THREAT log with no XFF value).test-panw-panos-threat-url-no-xff-sample.log-config.ymlmatching the pattern of the existing threat test config.test-panw-panos-threat-url-no-xff-sample.log-expected.jsonby runningelastic-package test pipelineand capturing the result; verify nopipeline_errortag is present in the output.packages/panw/manifest.yml, bump the version from5.5.0to5.5.1.packages/panw/changelog.yml, prepend a new entry for version5.5.1with abugfixentry: 'Fix missingignore_missingguard on XFF convert processor in threat pipeline, preventing errors for THREAT logs without an X-Forwarded-For header.'.Pipeline changes
ignore_missing: trueto the convert processor (tag: convert__temp__forwarded_ip_to_network_forwarded_ip_e6722dcc) that reads_temp_.forwarded_ipand writes tonetwork.forwarded_ip. No other processor changes required.Field / mapping changes
—
Sanitized error message
field [forwarded_ip] not present as part of path [_temp_.forwarded_ip]Sanitized log (
event_sanitizedexcerpt)Reviewer concerns
• The new test log entry in
test-panw-panos-threat-sample.loguses a short/truncated record (fewer trailing commas) — reviewers should confirm the parser tolerates variable-length THREAT records for this PAN-OS version (2049 log format).• The expected output timezone
+09:30(Adelaide) is unusual for a PA-220 device; this is driven by the syslog receiver offset and is correct if intentional, but worth a second look.• The changelog PR link placeholder (
pull/1) should be updated to the real PR number before merge.Self-review findings
—
Risk and classification
Links
09b1d6e47e099cdc