Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update palo alto url.original #1422

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Palo Alto Networks/paloalto-ngfw/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 2025-07-01

- Always display url.original

## 2024-15-01

### Update
Expand Down
12 changes: 2 additions & 10 deletions Palo Alto Networks/paloalto-ngfw/ingest/parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -799,17 +799,9 @@ stages:
url.original: "{{parsed_event.message.URL}}"

- set:
url.original: "{{parsed_event.message.FileName or parsed_event.message.URLFilename}}"
url.domain: '{{final.url.original.split("/")[0].split(":")[0]}}'
url.original: "https://{{parsed_event.message.FileName or parsed_event.message.URLFilename}}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a filter that check if Filename or URL Filename is set?
It will avoid tests with https as destination.domain and https:// as url.original

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try with filter None and filter null, I don't know the correct one ?

destination.domain: '{{final.url.original.split("/")[0].split(":")[0]}}'
url.port: '{{final.url.original.split("/")[0].split(":")[1]}}'
url.path: '{{final.url.original.split("?")[0].split("/")[1:] | join("/")}}'
url.query: '{{final.url.original.split("?")[1]}}'
filter: "{{final.action.type == 'url'}}"

- delete:
- url.original
filter: "{{final.action.type == 'url'}}"
filter: "{{final.action.type == 'url'and (parsed_event.message.FileName != null or parsed_event.message.URLFilename != null)}}"

- set:
source.ip: "{{parsed_event.message.PublicIPv4}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"destination": {
"address": "5.6.7.8",
"domain": "www.example.org",
"geo": {
"country_iso_code": "NL"
},
Expand Down Expand Up @@ -68,9 +67,6 @@
"VirtualLocation": "vsys1"
},
"related": {
"hosts": [
"www.example.org"
],
"ip": [
"1.2.3.4",
"4.3.2.1",
Expand All @@ -97,10 +93,8 @@
}
},
"url": {
"domain": "www.example.org",
"registered_domain": "example.org",
"subdomain": "www",
"top_level_domain": "org"
"original": "www.example.org",
"path": "www.example.org"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"destination": {
"address": "5.6.7.8",
"domain": "www.example.com",
"geo": {
"country_iso_code": "US"
},
Expand Down Expand Up @@ -74,9 +73,6 @@
"VirtualLocation": "vsys1"
},
"related": {
"hosts": [
"www.example.com"
],
"ip": [
"1.2.3.4",
"4.3.2.1",
Expand Down Expand Up @@ -110,11 +106,8 @@
}
},
"url": {
"domain": "www.example.com",
"path": "connecttest.txt",
"registered_domain": "example.com",
"subdomain": "www",
"top_level_domain": "com"
"original": "www.example.com/connecttest.txt",
"path": "www.example.com/connecttest.txt"
},
"user": {
"domain": "example.org",
Expand Down
10 changes: 2 additions & 8 deletions Palo Alto Networks/paloalto-ngfw/tests/test_new_url_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"destination": {
"address": "17.25.11.9",
"domain": "test.gstatic.com",
"geo": {
"country_iso_code": "US"
},
Expand Down Expand Up @@ -74,9 +73,6 @@
"VirtualLocation": "vsys1"
},
"related": {
"hosts": [
"test.gstatic.com"
],
"ip": [
"17.25.11.9",
"19.16.1.6",
Expand All @@ -102,10 +98,8 @@
}
},
"url": {
"domain": "test.gstatic.com",
"registered_domain": "gstatic.com",
"subdomain": "test",
"top_level_domain": "com"
"original": "test.gstatic.com/",
"path": "test.gstatic.com/"
}
}
}
7 changes: 5 additions & 2 deletions Palo Alto Networks/paloalto-ngfw/tests/test_threat.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"destination": {
"address": "5.6.7.8",
"domain": "test.fr",
"domain": "https",
"ip": "5.6.7.8",
"nat": {
"ip": "0.0.0.0",
Expand Down Expand Up @@ -60,7 +60,7 @@
},
"related": {
"hosts": [
"test.fr"
"https"
],
"ip": [
"0.0.0.0",
Expand All @@ -87,8 +87,11 @@
},
"url": {
"domain": "test.fr",
"original": "https://test.fr:9999/",
"path": "/",
"port": 9999,
"registered_domain": "test.fr",
"scheme": "https",
"top_level_domain": "fr"
}
}
Expand Down
8 changes: 5 additions & 3 deletions Palo Alto Networks/paloalto-ngfw/tests/threat-url-xff.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"destination": {
"address": "192.168.0.1",
"domain": "www.sekoia.io",
"domain": "https",
"ip": "192.168.0.1",
"nat": {
"ip": "0.0.0.0",
Expand Down Expand Up @@ -73,7 +73,7 @@
},
"related": {
"hosts": [
"www.sekoia.io"
"https"
],
"ip": [
"0.0.0.0",
Expand All @@ -96,10 +96,12 @@
},
"url": {
"domain": "www.sekoia.io",
"path": "catalog/integrations",
"original": "https://www.sekoia.io:443/catalog/integrations?query=this",
"path": "/catalog/integrations",
"port": 443,
"query": "query=this",
"registered_domain": "sekoia.io",
"scheme": "https",
"subdomain": "www",
"top_level_domain": "io"
},
Expand Down
Loading