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 3 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
5 changes: 5 additions & 0 deletions Cisco/cisco-esa/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ cisco.esa.url:
name: cisco.esa.url
type: keyword

cisco.esa.url_domain:
description: ''
name: cisco.esa.url_domain
type: keyword

email.attachments:
description: A list of objects describing the attachment files sent along with an
email message
Expand Down
9 changes: 7 additions & 2 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_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: >-
[{% for url, details in dict(json_event_url_details.message).items() %}
"{% if details.get('ExpandedUrl') is not none %}{{ details.ExpandedUrl }}{% else %}{{ url }}{% endif %}"
[{% 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
4 changes: 4 additions & 0 deletions Cisco/cisco-esa/tests/test_attachments_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"url": [
"http://schemas.microsoft.com/office/2004/12/omml",
"http://www.w3.org/TR/REC-html40"
],
"url_domain": [
"schemas.microsoft.com",
"www.w3.org"
]
}
},
Expand Down
4 changes: 4 additions & 0 deletions Cisco/cisco-esa/tests/test_ingest_log2.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
"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"
]
}
},
Expand Down
7 changes: 7 additions & 0 deletions Cisco/cisco-esa/tests/test_ingest_log5.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@
"url": [
"https://facebook.com/u/john.doe",
"https://tiktok.com",
"https://tinyurl.es/tbdra",
"www.twitter.com"
],
"url_domain": [
"",
"facebook.com",
"tiktok.com",
"tinyurl.es"
]
}
},
Expand Down
3 changes: 2 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,8 @@
"age": "30 days (or greater)"
}
},
"url": []
"url": [],
"url_domain": []
}
},
"email": {
Expand Down
Loading