Skip to content

Conversation

@kcreddy
Copy link
Contributor

@kcreddy kcreddy commented Aug 23, 2024

Proposed commit message

Sanitize unwanted characters in firewall.

Character \u0000 appears unescaped in oipcat field inside
firewall logs causing json parsing errors. ZIA documentation suggests
adding \" to Feed Escape Character to escape special characters
such as \. But this character still appear unescaped.

Adding a gsub processor to replace these unwanted characters.

Reference: https://help.zscaler.com/zia/general-guidelines-nss-feeds-and-feed-formats

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.

How to test this PR locally

Added a new test file (.json) with unescaped \u0000 character inside oipcat. The characters are removed in the final document.

cd packages/zscaler_zia && 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 │ 481.934375ms │ │ zscaler_zia │ firewall │ pipeline │ (ingest pipeline warnings test-firewall.log) │ PASS │ 424.45325ms │ │ zscaler_zia │ firewall │ pipeline │ (ingest pipeline warnings test-unicode.json) │ PASS │ 486.630042ms │ │ zscaler_zia │ firewall │ pipeline │ test-firewall-http-endpoint.log │ PASS │ 79.703084ms │ │ zscaler_zia │ firewall │ pipeline │ test-firewall.log │ PASS │ 74.329917ms │ │ zscaler_zia │ firewall │ pipeline │ test-unicode.json │ PASS │ 56.771ms │ ╰─────────────┴─────────────┴───────────┴────────────────────────────────────────────────────────────┴────────┴──────────────╯ --- Test results for package: zscaler_zia - END --- Done 
@elasticmachine
Copy link

elasticmachine commented Aug 23, 2024

🚀 Benchmarks report

Package zscaler_zia 👍(6) 💚(1) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
audit 4149.38 2754.82 -1394.56 (-33.61%) 💔

To see the full report comment with /test benchmark fullreport

@kcreddy kcreddy requested a review from chrisberkhout August 23, 2024 06:00
@kcreddy kcreddy added bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Integration:zscaler_zia Zscaler Internet Access labels Aug 23, 2024
@kcreddy kcreddy marked this pull request as ready for review August 23, 2024 06:01
@kcreddy kcreddy requested a review from a team as a code owner August 23, 2024 06:01
@elasticmachine
Copy link

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

Copy link
Contributor

@chrisberkhout chrisberkhout left a comment

Choose a reason for hiding this comment

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

Just needs a version bump :-)

@elasticmachine
Copy link

💚 Build Succeeded

History

@kcreddy kcreddy merged commit 2ead0b8 into elastic:main Aug 23, 2024
@elasticmachine
Copy link

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

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
Sanitize unwanted characters in firewall. Character `\u0000` appears unescaped in `oipcat` field inside firewall logs causing json parsing errors. ZIA documentation suggests adding `\"` to `Feed Escape Character` to escape special characters such as `\`. But this character still appear unescaped.
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
Sanitize unwanted characters in firewall. Character `\u0000` appears unescaped in `oipcat` field inside firewall logs causing json parsing errors. ZIA documentation suggests adding `\"` to `Feed Escape Character` to escape special characters such as `\`. But this character still appear unescaped.
@kcreddy kcreddy deleted the zscaler_zia_parsing branch February 7, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:zscaler_zia Zscaler Internet Access Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

3 participants