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

[Fortinet Fortigate] swap source and destination for fortigate VPN event #11523

Open
wants to merge 4 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
5 changes: 5 additions & 0 deletions packages/fortinet_fortigate/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.26.0"
changes:
- description: Swap destination and source for vpn event type.
type: bugfix
link: https://github.com/elastic/integrations/pull/11523
- version: "1.25.8"
changes:
- description: Use triple-brace Mustache templating when referencing variables in ingest pipelines.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,19 +549,22 @@
{
"@timestamp": "2019-05-13T14:21:42.000Z",
"destination": {
"as": {
"number": 209
},
"geo": {
"city_name": "London",
"continent_name": "Europe",
"country_iso_code": "GB",
"country_name": "United Kingdom",
"city_name": "Milton",
"continent_name": "North America",
"country_iso_code": "US",
"country_name": "United States",
"location": {
"lat": 51.5142,
"lon": -0.0931
"lat": 47.2513,
"lon": -122.3149
},
"region_iso_code": "GB-ENG",
"region_name": "England"
"region_iso_code": "US-WA",
"region_name": "Washington"
},
"ip": "81.2.69.142",
"ip": "216.160.83.56",
"port": 500
},
"ecs": {
Expand Down Expand Up @@ -611,30 +614,27 @@
},
"related": {
"ip": [
"216.160.83.56",
"81.2.69.142"
"81.2.69.142",
"216.160.83.56"
]
},
"rule": {
"description": "Progress IPsec phase 1"
},
"source": {
"as": {
"number": 209
},
"geo": {
"city_name": "Milton",
"continent_name": "North America",
"country_iso_code": "US",
"country_name": "United States",
"city_name": "London",
"continent_name": "Europe",
"country_iso_code": "GB",
"country_name": "United Kingdom",
"location": {
"lat": 47.2513,
"lon": -122.3149
"lat": 51.5142,
"lon": -0.0931
},
"region_iso_code": "US-WA",
"region_name": "Washington"
"region_iso_code": "GB-ENG",
"region_name": "England"
},
"ip": "216.160.83.56",
"ip": "81.2.69.142",
"port": 500
},
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@
"region_iso_code": "GB-ENG",
"region_name": "England"
},
"ip": "81.2.69.144",
"ip": "81.2.69.142",
"port": 500
},
"ecs": {
Expand Down Expand Up @@ -791,8 +791,8 @@
},
"related": {
"ip": [
"81.2.69.142",
"81.2.69.144"
"81.2.69.144",
"81.2.69.142"
]
},
"rule": {
Expand All @@ -811,7 +811,7 @@
"region_iso_code": "GB-ENG",
"region_name": "England"
},
"ip": "81.2.69.142",
"ip": "81.2.69.144",
"port": 500
},
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@
"lon": 90.5
}
},
"ip": "67.43.156.13",
"ip": "67.43.156.14",
"port": 500
},
"ecs": {
Expand Down Expand Up @@ -1805,8 +1805,8 @@
},
"related": {
"ip": [
"67.43.156.14",
"67.43.156.13"
"67.43.156.13",
"67.43.156.14"
]
},
"rule": {
Expand All @@ -1825,7 +1825,7 @@
"lon": 90.5
}
},
"ip": "67.43.156.14",
"ip": "67.43.156.13",
"port": 500
},
"tags": [
Expand Down Expand Up @@ -1949,21 +1949,6 @@
},
{
"@timestamp": "2020-04-23T12:23:47.000-05:00",
"destination": {
"as": {
"number": 35908
},
"geo": {
"continent_name": "Asia",
"country_iso_code": "BT",
"country_name": "Bhutan",
"location": {
"lat": 27.5,
"lon": 90.5
}
},
"ip": "67.43.156.13"
},
"ecs": {
"version": "8.11.0"
},
Expand Down Expand Up @@ -2018,13 +2003,7 @@
"rule": {
"description": "SSL VPN new connection"
},
"tags": [
"preserve_original_event"
]
},
{
"@timestamp": "2020-04-23T12:23:47.000-05:00",
"destination": {
"source": {
"as": {
"number": 35908
},
Expand All @@ -2039,6 +2018,12 @@
},
"ip": "67.43.156.13"
},
"tags": [
"preserve_original_event"
]
},
{
"@timestamp": "2020-04-23T12:23:47.000-05:00",
"ecs": {
"version": "8.11.0"
},
Expand Down Expand Up @@ -2100,6 +2085,19 @@
"description": "SSL VPN tunnel up"
},
"source": {
"as": {
"number": 35908
},
"geo": {
"continent_name": "Asia",
"country_iso_code": "BT",
"country_name": "Bhutan",
"location": {
"lat": 27.5,
"lon": 90.5
}
},
"ip": "67.43.156.13",
"user": {
"group": {
"name": "somegroup"
Expand Down Expand Up @@ -3159,19 +3157,7 @@
{
"@timestamp": "2020-11-02T08:11:38.000Z",
"destination": {
"as": {
"number": 35908
},
"geo": {
"continent_name": "Asia",
"country_iso_code": "BT",
"country_name": "Bhutan",
"location": {
"lat": 27.5,
"lon": 90.5
}
},
"ip": "67.43.156.13",
"ip": "10.10.10.10",
"port": 500
},
"ecs": {
Expand Down Expand Up @@ -3231,15 +3217,27 @@
},
"related": {
"ip": [
"10.10.10.10",
"67.43.156.13"
"67.43.156.13",
"10.10.10.10"
]
},
"rule": {
"description": "Progress IPsec phase 1"
},
"source": {
"ip": "10.10.10.10",
"as": {
"number": 35908
},
"geo": {
"continent_name": "Asia",
"country_iso_code": "BT",
"country_name": "Bhutan",
"location": {
"lat": 27.5,
"lon": 90.5
}
},
"ip": "67.43.156.13",
"port": 500
},
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ processors:
- fortinet.firewall.filesize
- fortinet.firewall.sess_duration
ignore_missing: true
# For vpn subtype, remip(the client), is source, and locip(the firewall) is destination
# https://docs.fortinet.com/document/fortigate/7.6.0/administration-guide/834425/understanding-vpn-related-logs
- script:
lang: painless
if: ctx.fortinet?.firewall?.subtype == 'vpn'
source: |
def tmp = ctx.source;
ctx.source = ctx.destination;
if ( tmp?.user != null ) {
ctx.source.user = tmp.user;
tmp.remove("user");
}
ctx.destination = tmp;
on_failure:
- set:
field: event.kind
Expand Down
2 changes: 2 additions & 0 deletions packages/fortinet_fortigate/data_stream/log/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
name: destination.user.email
- external: ecs
name: destination.user.name
- external: ecs
name: destination.user.group.name
- external: ecs
name: dns.id
- external: ecs
Expand Down
1 change: 1 addition & 0 deletions packages/fortinet_fortigate/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ An example event for `log` looks as following:
| destination.packets | Packets sent from the destination to the source. | long |
| destination.port | Port of the destination. | long |
| destination.user.email | User email address. | keyword |
| destination.user.group.name | Name of the group. | keyword |
| destination.user.name | Short name or login of the user. | keyword |
| destination.user.name.text | Multi-field of `destination.user.name`. | match_only_text |
| dns.id | The DNS packet identifier assigned by the program that generated the query. The identifier is copied to the response. | keyword |
Expand Down
2 changes: 1 addition & 1 deletion packages/fortinet_fortigate/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fortinet_fortigate
title: Fortinet FortiGate Firewall Logs
version: "1.25.8"
version: "1.26.0"
description: Collect logs from Fortinet FortiGate firewalls with Elastic Agent.
type: integration
format_version: "3.0.3"
Expand Down