Skip to content

Commit 9fabd96

Browse files
authored
[Fortinet Fortigate] Fixed parsing of login events to capture username in message (elastic#15954)
Corrected the capturing of user name in the messages of login events where an error may occur when a symbol is present in the name such as "-" Previously, the pipeline was expecting a single word without any symbols.
1 parent fcddefa commit 9fabd96

File tree

5 files changed

+98
-2
lines changed

5 files changed

+98
-2
lines changed

packages/fortinet_fortigate/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.36.1"
3+
changes:
4+
- description: Properly parse user names for login events messages.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/15954
27
- version: "1.36.0"
38
changes:
49
- description: Preserve event.original on pipeline error.

packages/fortinet_fortigate/data_stream/log/_dev/test/pipeline/test-fortinet-7-4.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ date=2021-06-17 time=16:55:26 eventtime=1623974126411127210 tz="-0700" logid="17
7474
<165>1 2022-11-14T06:54:03Z use2-dmz-fw02 - - - - eventtime=1668408842876531561 tz="-0800" logid="0317013312" type="utm" subtype="webfilter" eventtype="ftgd_allow" level="notice" vd="root" policyid=25 poluuid="ccb269e0-5735-51e9-a218-a397dd08b7eb" policytype="policy" sessionid=130637139 srcip=10.80.28.193 srcport=64152 srccountry="Reserved" srcintf="az-b" srcintfrole="undefined" srcuuid="8666f70e-cfb9-51eb-4991-9012417d69da" dstip=89.160.20.128 dstport=443 dstcountry="United States" dstintf="port1" dstintfrole="undefined" dstuuid="ae28f494-5735-51e9-f247-d1d2ce663f4b" proto=6 service="HTTPS" hostname="[server.example.com](https://server.example.com/)" profile="default-ipsoft" action="passthrough" reqtype="direct" url="https://server.example.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" msg="URL belongs to an allowed category in policy" method="domain" cat=52 catdesc="Information Technology"
7575
date=2019-05-13 time=11:20:54 logid="0100032001" type="event" subtype="system" level="information" vd="vdom1" eventtime=1557771654587081441 logdesc="Admin login successful" sn="1557771654" user="admin" ui="jsconsole" method="jsconsole" srcip=172.16.200.254 dstip=172.16.200.2 action="login" status="success" reason="none" profile="super_admin" msg="Administrator admin logged in successfully from jsconsole"
7676
date=2021-06-17 time=16:55:26 eventtime=1623974126411127210 tz="-0700" logid="0101037100" type="event" subtype="vpn" level="notice" vd="vdom" logdesc="IPsec tunnel statistics" msg="IPsec tunnel statistics" action="tunnel-stats" remip=192.168.10.1 locip=192.168.10.1 remport=4500 locport=4500 outintf="internet" srccountry="Reserved" cookies="" user="2" group="N/A" useralt="N/A" xauthuser="user1" xauthgroup="group1" assignip=10.10.10.1 vpntunnel="VPNTUNNEL" tunnelip=10.10.10.1 tunnelid=123456789 tunneltype="ipsec" duration=919 sentbyte=1641284 rcvdbyte=33245 nextstat=600 fctuid="52C66FE08F724FE0B116DAD5062C9600" advpnsc=0
77+
<190>date=2025-11-11 time=09:03:29 devname="MYDEV" devid="MYDEVID" eventtime=1746018712493245679 tz="+0200" logid="1059021234" type="event" subtype="vpn" level="notice" vd="vdom" logdesc="IPsec tunnel statistics" sn="1557771654" user="ABC-EFG-Admin04" ui="jsconsole" method="jsconsole" srcip=172.16.200.254 dstip=172.16.200.2 action="login" status="success" reason="none" profile="super_admin" msg="Administrator ABC-EFG-Admin04 logged in successfully from jsconsole"

packages/fortinet_fortigate/data_stream/log/_dev/test/pipeline/test-fortinet-7-4.log-expected.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5791,6 +5791,96 @@
57915791
"tags": [
57925792
"preserve_original_event"
57935793
]
5794+
},
5795+
{
5796+
"@timestamp": "2025-11-11T09:03:29.000+02:00",
5797+
"destination": {
5798+
"ip": "172.16.200.254"
5799+
},
5800+
"ecs": {
5801+
"version": "8.17.0"
5802+
},
5803+
"event": {
5804+
"action": "login",
5805+
"category": [
5806+
"network",
5807+
"authentication"
5808+
],
5809+
"code": "1059021234",
5810+
"kind": "event",
5811+
"original": "<190>date=2025-11-11 time=09:03:29 devname=\"MYDEV\" devid=\"MYDEVID\" eventtime=1746018712493245679 tz=\"+0200\" logid=\"1059021234\" type=\"event\" subtype=\"vpn\" level=\"notice\" vd=\"vdom\" logdesc=\"IPsec tunnel statistics\" sn=\"1557771654\" user=\"ABC-EFG-Admin04\" ui=\"jsconsole\" method=\"jsconsole\" srcip=172.16.200.254 dstip=172.16.200.2 action=\"login\" status=\"success\" reason=\"none\" profile=\"super_admin\" msg=\"Administrator ABC-EFG-Admin04 logged in successfully from jsconsole\"",
5812+
"outcome": "success",
5813+
"reason": "none",
5814+
"start": "2025-04-30T15:11:52.493+02:00",
5815+
"timezone": "+0200",
5816+
"type": [
5817+
"connection"
5818+
]
5819+
},
5820+
"fortinet": {
5821+
"firewall": {
5822+
"action": "login",
5823+
"method": "jsconsole",
5824+
"profile": "super_admin",
5825+
"sn": "1557771654",
5826+
"subtype": "vpn",
5827+
"type": "event",
5828+
"vd": "vdom"
5829+
}
5830+
},
5831+
"log": {
5832+
"level": "notice",
5833+
"syslog": {
5834+
"facility": {
5835+
"code": 23
5836+
},
5837+
"priority": 190,
5838+
"severity": {
5839+
"code": 6
5840+
}
5841+
}
5842+
},
5843+
"message": "Administrator ABC-EFG-Admin04 logged in successfully from jsconsole",
5844+
"network": {
5845+
"direction": "internal"
5846+
},
5847+
"observer": {
5848+
"name": "MYDEV",
5849+
"product": "Fortigate",
5850+
"serial_number": "MYDEVID",
5851+
"type": "firewall",
5852+
"vendor": "Fortinet"
5853+
},
5854+
"related": {
5855+
"ip": [
5856+
"172.16.200.2",
5857+
"172.16.200.254"
5858+
],
5859+
"user": [
5860+
"ABC-EFG-Admin04"
5861+
]
5862+
},
5863+
"rule": {
5864+
"description": "IPsec tunnel statistics"
5865+
},
5866+
"source": {
5867+
"ip": "172.16.200.2",
5868+
"user": {
5869+
"name": "ABC-EFG-Admin04",
5870+
"roles": [
5871+
"Administrator"
5872+
]
5873+
}
5874+
},
5875+
"tags": [
5876+
"preserve_original_event"
5877+
],
5878+
"user": {
5879+
"name": "ABC-EFG-Admin04",
5880+
"roles": [
5881+
"Administrator"
5882+
]
5883+
}
57945884
}
57955885
]
57965886
}

packages/fortinet_fortigate/data_stream/log/elasticsearch/ingest_pipeline/login.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ processors:
7878
field: "message"
7979
tag: "ssh login 3"
8080
patterns:
81-
- "%{WORD:_tmp.user.roles} %{WORD:user.name} logged in %{WORD:event.outcome} from (?:jsconsole|%{WORD}\\(%{IP:source.ip}\\))"
81+
- "%{WORD:_tmp.user.roles} %{NOTSPACE:user.name} logged in %{WORD:event.outcome} from (?:jsconsole|%{WORD}\\(%{IP:source.ip}\\))"
8282
if: "ctx.message != null && ctx.message.startsWith('Administrator') && ctx.message.toLowerCase().contains('logged in')"
8383
on_failure:
8484
- append:

packages/fortinet_fortigate/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: fortinet_fortigate
22
title: Fortinet FortiGate Firewall Logs
3-
version: "1.36.0"
3+
version: "1.36.1"
44
description: Collect logs from Fortinet FortiGate firewalls with Elastic Agent.
55
type: integration
66
format_version: "3.0.3"

0 commit comments

Comments
 (0)