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

Fix on cisco.url fields #1385

Merged
merged 7 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions Cisco/cisco-esa/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,14 @@ cisco.esa.status:
name: cisco.esa.status
type: keyword

cisco.esa.url:
cisco.esa.url.domain:
description: the declaration of the cisco urls domains
name: cisco.esa.url.domain
type: keyword

cisco.esa.url.full:
description: the declaration of the cisco urls
name: cisco.esa.url
name: cisco.esa.url.full
type: keyword

email.attachments:
Expand Down
11 changes: 8 additions & 3 deletions Cisco/cisco-esa/ingest/parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ stages:
{% endif %}
{% endif %}
{%- endfor %}]
cisco.esa.url: >-
[{% for url, details in dict(json_event_url_details.message).items() %}
"{% if details.get('ExpandedUrl') is not none %}{{ details.ExpandedUrl }}{% else %}{{ url }}{% endif %}"
cisco.esa.url.domain: >-
[{% for url, details in json_event_url_details.message.items() %}
{% if details.get('ExpandedUrl') is not none %}"{{url.split('/')[2]}}", "{{ details.ExpandedUrl.split('/')[2] }}"{% else %}"{{ url.split('/')[2] }}"{% endif %}
{% if not loop.last %},{% endif %}
{% endfor %}]
cisco.esa.url.full: >-
[{% for url, details in json_event_url_details.message.items() %}
{% if details.get('ExpandedUrl') is not none %}"{{url}}", "{{ details.ExpandedUrl }}"{% else %}"{{ url }}"{% endif %}
{% if not loop.last %},{% endif %}
{% endfor %}]
url.domain: "{{parsed_event.message.EAURLDetails}}"
Expand Down
14 changes: 10 additions & 4 deletions Cisco/cisco-esa/tests/test_attachments_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@
"age": "30 days (or greater)"
}
},
"url": [
"http://schemas.microsoft.com/office/2004/12/omml",
"http://www.w3.org/TR/REC-html40"
]
"url": {
"domain": [
"schemas.microsoft.com",
"www.w3.org"
],
"full": [
"http://schemas.microsoft.com/office/2004/12/omml",
"http://www.w3.org/TR/REC-html40"
]
}
}
},
"email": {
Expand Down
14 changes: 10 additions & 4 deletions Cisco/cisco-esa/tests/test_ingest_log2.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@
"age": "9 years 3 months 14 days"
}
},
"url": [
"http://mandrill.appc.cisco.com/track/open.php?u=30372747&id=d57275a6c9df40418a90fd977e3bf506",
"https://bce-demo.appc.cisco.com/sensors/a7b04388-0f6e-11e9-8def-0242ac110002"
]
"url": {
"domain": [
"bce-demo.appc.cisco.com",
"mandrill.appc.cisco.com"
],
"full": [
"http://mandrill.appc.cisco.com/track/open.php?u=30372747&id=d57275a6c9df40418a90fd977e3bf506",
"https://bce-demo.appc.cisco.com/sensors/a7b04388-0f6e-11e9-8def-0242ac110002"
]
}
}
},
"email": {
Expand Down
19 changes: 14 additions & 5 deletions Cisco/cisco-esa/tests/test_ingest_log5.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,20 @@
"age": "30 days (or greater)"
}
},
"url": [
"https://facebook.com/u/john.doe",
"https://tiktok.com",
"www.twitter.com"
]
"url": {
"domain": [
"",
"facebook.com",
"tiktok.com",
"tinyurl.es"
],
"full": [
"https://facebook.com/u/john.doe",
"https://tiktok.com",
"https://tinyurl.es/tbdra",
"www.twitter.com"
]
}
}
},
"email": {
Expand Down
5 changes: 4 additions & 1 deletion Cisco/cisco-esa/tests/test_ingest_log7.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
"age": "30 days (or greater)"
}
},
"url": []
"url": {
"domain": [],
"full": []
}
}
},
"email": {
Expand Down
Loading