Skip to content

zscaler_zia.firewall: Fix source/destination ip mapping - #11613

Merged
kcreddy merged 3 commits into
elastic:mainfrom
kcreddy:zscaler_ecs
Nov 6, 2024
Merged

zscaler_zia.firewall: Fix source/destination ip mapping#11613
kcreddy merged 3 commits into
elastic:mainfrom
kcreddy:zscaler_ecs

Conversation

@kcreddy

@kcreddy kcreddy commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

Proposed commit message

Fix source/destination ip mapping in firewall logs.

Currently the ECS source.ip and destination.ip are copied not only from
ZScaler client's source and destination ips, but also from the proxy server's
source and destination ips. From security detection point of view, the flow is clearly defined
if source.ip and destination.ip are mapped only from client's perspective instead of mixing
them with proxy's source and destination ips. Also, the current array representation of
source.ip and destination.ip makes it unable to be used with geoip processor.

This PR:

  • Removes the mapping from proxy server's source and destination to ECS source.ip and destination.ip respectively.
  • Adds source.nat.ip from zscaler's tsip field.
  • Adds geoip processor to source.ip and destination.ip.
  • Updates related.ip to reflect from custom fields of proxy's source and destination ips.

Reference: https://help.zscaler.com/zia/nss-feed-output-format-firewall-logs

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

Pipeline tests
cd packages/zscaler_zia && elastic-package stack down && elastic-package build && elastic-package stack up --version=8.13.0 -d -v && eval "$(elastic-package stack shellinit)" && elastic-package test pipeline --generate -v --data-streams=firewall

--- Test results for package: zscaler_zia - START ---
╭─────────────┬─────────────┬───────────┬────────────────────────────────────────────────────────────┬────────┬──────────────╮
│ PACKAGE     │ DATA STREAM │ TEST TYPE │ TEST NAME                                                  │ RESULT │ TIME ELAPSED │
├─────────────┼─────────────┼───────────┼────────────────────────────────────────────────────────────┼────────┼──────────────┤
│ zscaler_zia │ firewall    │ pipeline  │ (ingest pipeline warnings test-firewall-http-endpoint.log) │ PASS   │    275.157ms │
│ zscaler_zia │ firewall    │ pipeline  │ (ingest pipeline warnings test-firewall.log)               │ PASS   │ 289.361333ms │
│ zscaler_zia │ firewall    │ pipeline  │ (ingest pipeline warnings test-unicode.json)               │ PASS   │ 297.987209ms │
│ zscaler_zia │ firewall    │ pipeline  │ test-firewall-http-endpoint.log                            │ PASS   │  89.030917ms │
│ zscaler_zia │ firewall    │ pipeline  │ test-firewall.log                                          │ PASS   │  79.011458ms │
│ zscaler_zia │ firewall    │ pipeline  │ test-unicode.json                                          │ PASS   │  62.875291ms │
╰─────────────┴─────────────┴───────────┴────────────────────────────────────────────────────────────┴────────┴──────────────╯
--- Test results for package: zscaler_zia - END   ---
Done

System tests
cd packages/zscaler_zia && elastic-package stack down && elastic-package build && elastic-package stack up --version=8.13.0 -d -v && eval "$(elastic-package stack shellinit)" && elastic-package test system --generate -v --data-streams=firewall

--- Test results for package: zscaler_zia - START ---
╭─────────────┬─────────────┬───────────┬───────────────┬────────┬───────────────╮
│ PACKAGE     │ DATA STREAM │ TEST TYPE │ TEST NAME     │ RESULT │  TIME ELAPSED │
├─────────────┼─────────────┼───────────┼───────────────┼────────┼───────────────┤
│ zscaler_zia │ firewall    │ system    │ http-endpoint │ PASS   │ 43.568997917s │
│ zscaler_zia │ firewall    │ system    │ tcp           │ PASS   │ 46.003018042s │
╰─────────────┴─────────────┴───────────┴───────────────┴────────┴───────────────╯
--- Test results for package: zscaler_zia - END   ---
Done
@kcreddy kcreddy self-assigned this Nov 1, 2024
@kcreddy kcreddy added enhancement New feature or request Integration:zscaler_zia Zscaler Internet Access Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Nov 1, 2024
@kcreddy
kcreddy marked this pull request as ready for review November 1, 2024 09:21
@kcreddy
kcreddy requested a review from a team as a code owner November 1, 2024 09:21
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine

Copy link
Copy Markdown

�� Build Succeeded

cc @kcreddy

field: source.nat.ip
tag: set_source_nat_ip_from_zscaler_zia_firewall_tunnel_ip
copy_from: zscaler_zia.firewall.tunnel.ip
ignore_empty_value: true

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.

@kcreddy , Is this also part of the required change? cause I thought we were just removing the proxy address mapping from source and destination, adding geoip proc and updating related ips.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ShourieG, yes it is also one of the asks from the SDH. I've updated the PR description.

@kcreddy
kcreddy requested a review from ShourieG November 6, 2024 04:21

@ShourieG ShourieG 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

@kcreddy
kcreddy merged commit a773b73 into elastic:main Nov 6, 2024
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package zscaler_zia - 3.3.0 containing this change is available at https://epr.elastic.co/search?package=zscaler_zia

@Cris-Maggi

Copy link
Copy Markdown

thank you team, I'll follow up with the customer.

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
[zscaler_zia] Fix source/destination ip mapping in `firewall` logs.

Currently the ECS `source.ip` and `destination.ip` are copied not only from 
ZScaler client's source and destination ips, but also from the proxy server's 
source and destination ips. From security detection point of view, the flow is clearly defined 
if `source.ip` and `destination.ip` are mapped only from client's perspective instead of mixing 
them with proxy's source and destination ips. Also, the current array representation of  
`source.ip` and `destination.ip` makes it unable to be used with `geoip` processor. 

This PR:
- Removes the mapping from proxy server's source and destination to ECS `source.ip` and `destination.ip` respectively.
- Adds `source.nat.ip` from zscaler's `tsip` field.
- Adds `geoip` processor to `source.ip` and `destination.ip`.
- Updates `related.ip` to reflect from custom fields of  proxy's source and destination ips.
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
[zscaler_zia] Fix source/destination ip mapping in `firewall` logs.

Currently the ECS `source.ip` and `destination.ip` are copied not only from 
ZScaler client's source and destination ips, but also from the proxy server's 
source and destination ips. From security detection point of view, the flow is clearly defined 
if `source.ip` and `destination.ip` are mapped only from client's perspective instead of mixing 
them with proxy's source and destination ips. Also, the current array representation of  
`source.ip` and `destination.ip` makes it unable to be used with `geoip` processor. 

This PR:
- Removes the mapping from proxy server's source and destination to ECS `source.ip` and `destination.ip` respectively.
- Adds `source.nat.ip` from zscaler's `tsip` field.
- Adds `geoip` processor to `source.ip` and `destination.ip`.
- Updates `related.ip` to reflect from custom fields of  proxy's source and destination ips.
@kcreddy
kcreddy deleted the zscaler_ecs branch February 7, 2025 09:13
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:zscaler_zia Zscaler Internet Access Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants