Skip to content

OPNSense

Overview

  • Vendor:
  • Plan: Defend Core & Defend Prime
  • Supported environment:
  • Version compatibility:
  • Detection based on: Telemetry
  • Supported application or feature:

OPNSense is a firewall software distribution based on FreeBSD.

This intake ingest filterlog from OPNSense.

Configure

This setup guide will show you how to forward your Firewall logs to Sekoia.io by means of a syslog transport channel.

Prerequisites

  • Have an internal log concentrator

Enable Syslog forwarding

To enable syslog forwarding:

  1. Log in your OPNSense web interface.
  2. Go to System > Settings > Logging / targets.
  3. In the Destinations tab, click on the + button to add a new destination.
  4. In the modal, check the Enabled checkbox.
  5. Select UDP(4) as the transport.
  6. Select filter (filterlog) as Applications.
  7. Set the hostname/ip and the port of the log concentrator.
  8. Click on the RFC5424 checkbox
  9. Click the Save button

Create the intake

Go to the intake page and create a new intake from the format OpenBSD Packet Filter.

Forward logs to Sekoia.io

Please consult the Syslog Forwarding documentation to forward these logs to Sekoia.io.

Raw Events Samples

In this section, you will find examples of raw logs as generated natively by the source. These examples are provided to help integrators understand the data format before ingestion into Sekoia.io. It is crucial for setting up the correct parsing stages and ensuring that all relevant information is captured.

183,,,41cbdd1cea144179a26efd069e1ee54f,vtnet.9,match,block,out,4,0x0,,63,18292,0,DF,112,vrrp,72,1.2.3.4,5.6.7.8,3,255,13,2,0,1
70,,,6524e587872444838f901ac45cbf807c,vtnet1,match,pass,in,4,0x0,,19,36147,0,none,1,icmp,128,1.2.3.4,5.6.7.8,datalength=108
341,,,138b9664ed0d438b9fa1a14116606d50,vtnet9,match,pass,in,4,0x0,,63,26567,0,DF,6,tcp,60,1.2.3.4,5.6.7.8,40234,10050,0,S,3917296601:3917296620,,64240,,mss
183,,,41cbdd1cea144179a26efd069e1ee54f,vtnet9,match,pass,in,4,0x0,,63,18292,0,DF,17,udp,72,1.2.3.4,5.6.7.8,18448,53,52
123,001,anchor1,label2,eth0,match,pass,in,6,,123,64,12345,0,DF,vrrp,6,80,2001:0db8:85a3:0000:0000:8a2e:0370:7334,2001:0db8:85a3:0000:0000:ac1f:0001:0023,3,64,1,2,3,4
123,001,anchor1,label2,eth0,match,pass,in,6,,1234,64,tcp,6,60,2001:0db8:85a3:0000:0000:8a2e:0370:7334,2001:0db8:85a3:0000:0000:ac1f:0001:0023,12345,80,20,AP,1234,5678,8192,0,MMS=1460 NOP WS=256 SACK_PERM=1
123,001,anchor1,label2,eth0,match,pass,in,6,,1234,64,udp,17,1024,2001:0db8:85a3:0000:0000:8a2e:0370:7334,2001:0db8:85a3:0000:0000:ac1f:0001:0023,12345,80,1024
183,,,41cbdd1cea144179a26efd069e1ee54f,vtnet9,match,pass,in,4,0x0,,63,18292,0,DF,17,udp,72,1.2.3.4,5.6.7.8,18448,53,52

Detection section

The following section provides information for those who wish to learn more about the detection capabilities enabled by collecting this intake. It includes details about the built-in rule catalog, event categories, and ECS fields extracted from raw events. This is essential for users aiming to create custom detection rules, perform hunting activities, or pivot in the events page.

The following Sekoia.io built-in rules match the intake OpenBSD Packet Filter. This documentation is updated automatically and is based solely on the fields used by the intake which are checked against our rules. This means that some rules will be listed but might not be relevant with the intake.

SEKOIA.IO x OpenBSD Packet Filter on ATT&CK Navigator

Cryptomining

Detection of domain names potentially related to cryptomining activities.

  • Effort: master
Dynamic DNS Contacted

Detect communication with dynamic dns domain. This kind of domain is often used by attackers. This rule can trigger false positive in non-controlled environment because dynamic dns is not always malicious.

  • Effort: master
Exfiltration Domain

Detects traffic toward a domain flagged as a possible exfiltration vector.

  • Effort: master
Internet Scanner

Detects known scanner IP addresses. Alert is only raised when the scan hits an opened port, on TCP or UDP. This could be a very noisy rule, so be careful to check your detection perimeter before activation.

  • Effort: master
Internet Scanner Target

Detects known scanner IP addresses. Alert is only raised when the scan hits an opened port, on TCP or UDP and group by target address. This could be a very noisy rule, so be careful to check your detection perimeter before activation.

  • Effort: master
Remote Access Tool Domain

Detects traffic toward a domain flagged as a Remote Administration Tool (RAT).

  • Effort: master
SEKOIA.IO Intelligence Feed

Detect threats based on indicators of compromise (IOCs) collected by SEKOIA's Threat and Detection Research team.

  • Effort: elementary
Sekoia.io EICAR Detection

Detects observables in Sekoia.io CTI tagged as EICAR, which are fake samples meant to test detection.

  • Effort: master
TOR Usage

Detects TOR usage, based on the IP address and the destination port (filtered on NTP). TOR is short for The Onion Router, and it gets its name from how it works. TOR intercepts the network traffic from one or more apps on user’s computer, usually the user web browser, and shuffles it through a number of randomly-chosen computers before passing it on to its destination. This disguises user location, and makes it harder for servers to pick him/her out on repeat visits, or to tie together separate visits to different sites, this making tracking and surveillance more difficult. Before a network packet starts its journey, user’s computer chooses a random list of relays and repeatedly encrypts the data in multiple layers, like an onion. Each relay knows only enough to strip off the outermost layer of encryption, before passing what’s left on to the next relay in the list.

  • Effort: master
TOR Usage Generic Rule

Detects TOR usage globally, whether the IP is a destination or source. TOR is short for The Onion Router, and it gets its name from how it works. TOR intercepts the network traffic from one or more apps on user’s computer, usually the user web browser, and shuffles it through a number of randomly-chosen computers before passing it on to its destination. This disguises user location, and makes it harder for servers to pick him/her out on repeat visits, or to tie together separate visits to different sites, this making tracking and surveillance more difficult. Before a network packet starts its journey, user’s computer chooses a random list of relays and repeatedly encrypts the data in multiple layers, like an onion. Each relay knows only enough to strip off the outermost layer of encryption, before passing what’s left on to the next relay in the list.

  • Effort: master

Event Categories

The following table lists the data source offered by this integration.

Data Source Description
Network protocol analysis Packet Filter analyzes passing network packet.

In details, the following table denotes the type of events produced by this integration.

Name Values
Kind ``
Category network
Type connection

Transformed Events Samples after Ingestion

This section demonstrates how the raw logs will be transformed by our parsers. It shows the extracted fields that will be available for use in the built-in detection rules and hunting activities in the events page. Understanding these transformations is essential for analysts to create effective detection mechanisms with custom detection rules and to leverage the full potential of the collected data.

{
    "message": "183,,,41cbdd1cea144179a26efd069e1ee54f,vtnet.9,match,block,out,4,0x0,,63,18292,0,DF,112,vrrp,72,1.2.3.4,5.6.7.8,3,255,13,2,0,1",
    "event": {
        "action": "block",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "denied"
        ]
    },
    "destination": {
        "address": "5.6.7.8",
        "ip": "5.6.7.8"
    },
    "network": {
        "bytes": 72,
        "direction": "outbound",
        "iana_number": "112",
        "transport": "vrrp"
    },
    "observer": {
        "egress": {
            "interface": {
                "name": "vtnet.9"
            }
        }
    },
    "openbsd": {
        "pf": {
            "carp": {
                "advbase": "1",
                "advskew": "0",
                "type": 3,
                "version": "2",
                "vhid": "13"
            },
            "event": {
                "tracker": {
                    "id": "41cbdd1cea144179a26efd069e1ee54f"
                }
            },
            "routing": {
                "class": "0x0",
                "flags": "DF",
                "hoplimit": 255,
                "offset": 0
            }
        }
    },
    "related": {
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "rule": {
        "id": "183"
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    }
}
{
    "message": "70,,,6524e587872444838f901ac45cbf807c,vtnet1,match,pass,in,4,0x0,,19,36147,0,none,1,icmp,128,1.2.3.4,5.6.7.8,datalength=108",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "5.6.7.8",
        "ip": "5.6.7.8"
    },
    "network": {
        "bytes": 128,
        "direction": "inbound",
        "iana_number": "1",
        "transport": "icmp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "vtnet1"
            }
        }
    },
    "openbsd": {
        "pf": {
            "event": {
                "tracker": {
                    "id": "6524e587872444838f901ac45cbf807c"
                }
            },
            "icmp": {
                "datalength": 108
            },
            "routing": {
                "class": "0x0",
                "flags": "none",
                "hoplimit": 19,
                "offset": 0
            }
        }
    },
    "related": {
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "rule": {
        "id": "70"
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4"
    }
}
{
    "message": "341,,,138b9664ed0d438b9fa1a14116606d50,vtnet9,match,pass,in,4,0x0,,63,26567,0,DF,6,tcp,60,1.2.3.4,5.6.7.8,40234,10050,0,S,3917296601:3917296620,,64240,,mss",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "5.6.7.8",
        "ip": "5.6.7.8",
        "port": 10050
    },
    "network": {
        "bytes": 60,
        "direction": "inbound",
        "iana_number": "6",
        "transport": "tcp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "vtnet9"
            }
        }
    },
    "openbsd": {
        "pf": {
            "event": {
                "tracker": {
                    "id": "138b9664ed0d438b9fa1a14116606d50"
                }
            },
            "routing": {
                "class": "0x0",
                "flags": "DF",
                "hoplimit": 63,
                "offset": 0
            },
            "transport": {
                "bytes": 0,
                "seq_number": "3917296601:3917296620",
                "tcp_flags": "S",
                "window_size": 64240
            }
        }
    },
    "related": {
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "rule": {
        "id": "341"
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4",
        "port": 40234
    }
}
{
    "message": "183,,,41cbdd1cea144179a26efd069e1ee54f,vtnet9,match,pass,in,4,0x0,,63,18292,0,DF,17,udp,72,1.2.3.4,5.6.7.8,18448,53,52",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "5.6.7.8",
        "ip": "5.6.7.8",
        "port": 53
    },
    "network": {
        "bytes": 72,
        "direction": "inbound",
        "iana_number": "17",
        "transport": "udp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "vtnet9"
            }
        }
    },
    "openbsd": {
        "pf": {
            "event": {
                "tracker": {
                    "id": "41cbdd1cea144179a26efd069e1ee54f"
                }
            },
            "routing": {
                "class": "0x0",
                "flags": "DF",
                "hoplimit": 63,
                "offset": 0
            },
            "transport": {
                "bytes": 52
            }
        }
    },
    "related": {
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "rule": {
        "id": "183"
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4",
        "port": 18448
    }
}
{
    "message": "123,001,anchor1,label2,eth0,match,pass,in,6,,123,64,12345,0,DF,vrrp,6,80,2001:0db8:85a3:0000:0000:8a2e:0370:7334,2001:0db8:85a3:0000:0000:ac1f:0001:0023,3,64,1,2,3,4",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "2001:db8:85a3::ac1f:1:23",
        "ip": "2001:db8:85a3::ac1f:1:23"
    },
    "network": {
        "bytes": 80,
        "direction": "inbound",
        "iana_number": "6",
        "transport": "vrrp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "eth0"
            }
        }
    },
    "openbsd": {
        "pf": {
            "carp": {
                "advbase": "4",
                "advskew": "3",
                "type": 3,
                "version": "2",
                "vhid": "1"
            },
            "event": {
                "tracker": {
                    "id": "label2"
                }
            },
            "routing": {
                "flow": "123",
                "hoplimit": 64
            },
            "rule": {
                "subrulenr": "001"
            }
        }
    },
    "related": {
        "ip": [
            "2001:db8:85a3::8a2e:370:7334",
            "2001:db8:85a3::ac1f:1:23"
        ]
    },
    "rule": {
        "id": "123",
        "ruleset": "anchor1"
    },
    "source": {
        "address": "2001:db8:85a3::8a2e:370:7334",
        "ip": "2001:db8:85a3::8a2e:370:7334"
    }
}
{
    "message": "123,001,anchor1,label2,eth0,match,pass,in,6,,1234,64,tcp,6,60,2001:0db8:85a3:0000:0000:8a2e:0370:7334,2001:0db8:85a3:0000:0000:ac1f:0001:0023,12345,80,20,AP,1234,5678,8192,0,MMS=1460 NOP WS=256 SACK_PERM=1",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "2001:db8:85a3::ac1f:1:23",
        "ip": "2001:db8:85a3::ac1f:1:23",
        "port": 80
    },
    "network": {
        "bytes": 60,
        "direction": "inbound",
        "iana_number": "6",
        "transport": "tcp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "eth0"
            }
        }
    },
    "openbsd": {
        "pf": {
            "event": {
                "tracker": {
                    "id": "label2"
                }
            },
            "routing": {
                "flow": "1234",
                "hoplimit": 64
            },
            "rule": {
                "subrulenr": "001"
            },
            "transport": {
                "ack": "5678",
                "bytes": 20,
                "seq_number": "1234",
                "tcp_flags": "AP",
                "urgency": "0",
                "window_size": 8192
            }
        }
    },
    "related": {
        "ip": [
            "2001:db8:85a3::8a2e:370:7334",
            "2001:db8:85a3::ac1f:1:23"
        ]
    },
    "rule": {
        "id": "123",
        "ruleset": "anchor1"
    },
    "source": {
        "address": "2001:db8:85a3::8a2e:370:7334",
        "ip": "2001:db8:85a3::8a2e:370:7334",
        "port": 12345
    }
}
{
    "message": "123,001,anchor1,label2,eth0,match,pass,in,6,,1234,64,udp,17,1024,2001:0db8:85a3:0000:0000:8a2e:0370:7334,2001:0db8:85a3:0000:0000:ac1f:0001:0023,12345,80,1024",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "2001:db8:85a3::ac1f:1:23",
        "ip": "2001:db8:85a3::ac1f:1:23",
        "port": 80
    },
    "network": {
        "bytes": 1024,
        "direction": "inbound",
        "iana_number": "17",
        "transport": "udp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "eth0"
            }
        }
    },
    "openbsd": {
        "pf": {
            "event": {
                "tracker": {
                    "id": "label2"
                }
            },
            "routing": {
                "flow": "1234",
                "hoplimit": 64
            },
            "rule": {
                "subrulenr": "001"
            },
            "transport": {
                "bytes": 1024
            }
        }
    },
    "related": {
        "ip": [
            "2001:db8:85a3::8a2e:370:7334",
            "2001:db8:85a3::ac1f:1:23"
        ]
    },
    "rule": {
        "id": "123",
        "ruleset": "anchor1"
    },
    "source": {
        "address": "2001:db8:85a3::8a2e:370:7334",
        "ip": "2001:db8:85a3::8a2e:370:7334",
        "port": 12345
    }
}
{
    "message": "183,,,41cbdd1cea144179a26efd069e1ee54f,vtnet9,match,pass,in,4,0x0,,63,18292,0,DF,17,udp,72,1.2.3.4,5.6.7.8,18448,53,52",
    "event": {
        "action": "pass",
        "category": [
            "network"
        ],
        "reason": "match",
        "type": [
            "allowed"
        ]
    },
    "destination": {
        "address": "5.6.7.8",
        "ip": "5.6.7.8",
        "port": 53
    },
    "network": {
        "bytes": 72,
        "direction": "inbound",
        "iana_number": "17",
        "transport": "udp"
    },
    "observer": {
        "ingress": {
            "interface": {
                "name": "vtnet9"
            }
        }
    },
    "openbsd": {
        "pf": {
            "event": {
                "tracker": {
                    "id": "41cbdd1cea144179a26efd069e1ee54f"
                }
            },
            "routing": {
                "class": "0x0",
                "flags": "DF",
                "hoplimit": 63,
                "offset": 0
            },
            "transport": {
                "bytes": 52
            }
        }
    },
    "related": {
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "rule": {
        "id": "183"
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4",
        "port": 18448
    }
}

Extracted Fields

The following table lists the fields that are extracted, normalized under the ECS format, analyzed and indexed by the parser. It should be noted that infered fields are not listed.

Name Type Description
destination.ip ip IP address of the destination.
destination.port long Port of the destination.
event.action keyword The action captured by the event.
event.category keyword Event category. The second categorization field in the hierarchy.
event.reason keyword Reason why this event happened, according to the source
event.type keyword Event type. The third categorization field in the hierarchy.
network.bytes long Total bytes transferred in both directions.
network.direction keyword Direction of the network traffic.
network.iana_number keyword IANA Protocol Number.
network.transport keyword Protocol Name corresponding to the field iana_number.
observer.egress.interface.name keyword Interface name
observer.ingress.interface.name keyword Interface name
openbsd.pf.carp.advbase keyword
openbsd.pf.carp.advskew keyword
openbsd.pf.carp.type number
openbsd.pf.carp.version keyword
openbsd.pf.carp.vhid keyword The identifier of the virtual host that the appliance belong to in the CARP virtual group
openbsd.pf.event.tracker.id tracker tracker ID
openbsd.pf.icmp.datalength long the length of the content of the ICMP packet
openbsd.pf.routing.class keyword
openbsd.pf.routing.flags keyword
openbsd.pf.routing.flow keyword
openbsd.pf.routing.hoplimit number
openbsd.pf.routing.offset number
openbsd.pf.rule.subrulenr integer number of the subrule
openbsd.pf.transport.ack keyword
openbsd.pf.transport.bytes number
openbsd.pf.transport.classification keyword
openbsd.pf.transport.options keyword
openbsd.pf.transport.seq_number keyword
openbsd.pf.transport.tcp_flags keyword
openbsd.pf.transport.urgency keyword
openbsd.pf.transport.window_size number
rule.id keyword Rule ID
rule.ruleset keyword Rule ruleset
source.ip ip IP address of the source.
source.port long Port of the source.

For more information on the Intake Format, please find the code of the Parser, Smart Descriptions, and Supported Events here.