Skip to content

[imperva_cloud_waf] Encode spaces in URL - #14220

Merged
efd6 merged 3 commits into
elastic:mainfrom
navnit-elastic:imperva_cloud_waf-1.12.1
Jun 16, 2025
Merged

[imperva_cloud_waf] Encode spaces in URL#14220
efd6 merged 3 commits into
elastic:mainfrom
navnit-elastic:imperva_cloud_waf-1.12.1

Conversation

@navnit-elastic

@navnit-elastic navnit-elastic commented Jun 13, 2025

Copy link
Copy Markdown

Proposed commit message

imperval_cloud_waf: encode spaces and prepend scheme in URL

This change replaces spaces with '%20' in URL to ensure
proper encoding. Prepends the scheme to the URL, as
the 'uri_parts' processor requires a fully qualified URL.

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

Author's Checklist

  • [ ]

How to test this PR locally

Pipeline Tests:

--- Test results for package: imperva_cloud_waf - START ---
╭───────────────────┬─────────────┬───────────┬────────────────────────────────────────────┬────────┬──────────────╮
│ PACKAGE           │ DATA STREAM │ TEST TYPE │ TEST NAME                                  │ RESULT │ TIME ELAPSED │
├───────────────────┼─────────────┼───────────┼────────────────────────────────────────────┼────────┼──────────────┤
│ imperva_cloud_waf │ event       │ pipeline  │ (ingest pipeline warnings test-event.json) │ PASS   │ 415.785086ms │
│ imperva_cloud_waf │ event       │ pipeline  │ test-event.json                            │ PASS   │ 257.979149ms │
╰───────────────────┴─────────────┴───────────┴────────────────────────────────────────────┴────────┴──────────────╯
--- Test results for package: imperva_cloud_waf - END   ---
Done

Related issues

Screenshots

@navnit-elastic navnit-elastic self-assigned this Jun 13, 2025
@navnit-elastic navnit-elastic added bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Integration:imperva_cloud_waf Imperva Cloud WAF Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Jun 13, 2025
@navnit-elastic
navnit-elastic marked this pull request as ready for review June 13, 2025 12:59
@navnit-elastic
navnit-elastic requested a review from a team as a code owner June 13, 2025 12:59
@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

lang: painless
source: |
ctx.url.original = ctx.network.application + "://" + ctx.url.original
if: ctx.url?.original != null && ctx.network?.application != null

@efd6 efd6 Jun 15, 2025

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.

I think we should also check that neither of these is ''.

Note also that this can be a set processor:

- set:
    field: url.original
    value: '{{{network.application}}}://{{{url.original}}}'
    if: ctx.url?.original != null && ctx.url.original != '' && ctx.network?.application != null && ctx.network.application != ''

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, this looks more reliable. Thanks!

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @navnit-elastic

@efd6 efd6 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.

We may have additional issues with this since there are other codepoints that must be percent encoded. Let's revisit if they become an issue.

@efd6
efd6 merged commit c686816 into elastic:main Jun 16, 2025
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

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

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:imperva_cloud_waf Imperva Cloud WAF Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

3 participants