From nobody Thu Dec 29 01:58:02 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NjBPM6Wl8z2ksFF for ; Thu, 29 Dec 2022 01:58:15 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NjBPM2sxyz40bv for ; Thu, 29 Dec 2022 01:58:15 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-x92c.google.com with SMTP id e24so3906423uam.10 for ; Wed, 28 Dec 2022 17:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qx3qvOVDfR6e1ojg4gVat4DvLiMmUzJEoi+YTGJuZbc=; b=PoBoYHjnQ35KdzYxvcCf6/rx9kW6y7ouVRQpIfu89sloRKONLMKmTiOradlCnye15d yH9ix+KsLH47vRiewe3pB+VNWqBtOLksiRn1UX8M+iyU+0Aig+nA6qY2RpY774ObHxHz k2DXrX+8CyKf1HiOdGXdDkgoRgYq+Hbh0M0oqVIQ0q6orY4zQUnpIJ94wxQQKlEKjxdz ymw878pj1NXoMF6MmeEkLVIs8FrnastPGxTCE9aZuqPXmmy6fOFIGT4HW2gcERArfUkG +M516RSN5mryhXwrZECpn7+rM44JMA7rzwgdtgn5RWXjpoo4t+1E4q4ZArOCeFTxbPqx fCmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qx3qvOVDfR6e1ojg4gVat4DvLiMmUzJEoi+YTGJuZbc=; b=4nPUFfKr3MS6l2P22PAj6SxiUJBQX3iFfqbCK7MpqlX+Gp9titL6wuIfjkds4vfbTI 1O/N/9QLdI5rqpp13BYJRIk4J8pui9qInvjDAokG0OtVhmCV8/89ubF0vNt7HtqouZZg dI+pojp7pJzyJDI4hoD8mY15mnmFaR3pJbkPD3ieaAd2OkEG4ATU3iIF19MS/yFYWEDb VkYNr58PDS7yGAy9yBQnJ5CakjmPn/GyQHzdV52Rb/47lLytgncY5jZCkk+u+dBOEqdS UcwftWVNpwSuSqmoNJLQ5LKqYN3rQCfx7WxTfgl7o1ZTGZ6yWbi9mz9BaSVcjtsYWz2o ErRw== X-Gm-Message-State: AFqh2kq7fT9cbRZVK/jA9Byh0AL/h90JOQDBZoxSG/9N+/Twpy7AKky8 UZGAZrb6y3tXN8goRXC7vMlSM6zo5caAzKi/wURqg4BWxQrP8/HzFxU= X-Google-Smtp-Source: AMrXdXtXuT6rN5jIDwA6WZReBO1IjNkA4tAXZhM0xQnScso47sgiZKCnJDsJ6QEVF1HZRTUFyjdbXOIC7J6z/44CWjU= X-Received: by 2002:a9f:2f12:0:b0:419:d688:24b2 with SMTP id x18-20020a9f2f12000000b00419d68824b2mr2544861uaj.79.1672279094412; Wed, 28 Dec 2022 17:58:14 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Damjan Jovanovic Date: Thu, 29 Dec 2022 03:58:02 +0200 Message-ID: Subject: Re: native recording of all network connections on freebsd To: Dan Mack Cc: freebsd-current@freebsd.org Content-Type: multipart/alternative; boundary="0000000000006349e305f0edd1e0" X-Rspamd-Queue-Id: 4NjBPM2sxyz40bv X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000006349e305f0edd1e0 Content-Type: text/plain; charset="UTF-8" On Wed, Dec 28, 2022 at 4:21 PM Dan Mack wrote: > > I'm wondering if anyone can help point me at a good way to continously > capture every inbound and outbound connection made to a freebsd system. > I'd prefer a way that is native in base if possible. I don't really want > to record all the packets, just the src:dest:rport:dport stats. > > Happy to RTFM as well, > > Dan > > Another possibility is to enable Netflow in ipfw (there is an ipfw_netflow service), which submits periodic reports of all connections made and their data usage, and then collect and process the Netflow data using a Netflow server. Or develop a custom Netgraph service that examines packets and logs connections. This would even work in the absence of any firewall. Damjan --0000000000006349e305f0edd1e0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Dec 28, 2022 at 4:21 PM Dan M= ack <mack@macktronics.com>= ; wrote:

I'm wondering if anyone can help point me at a good way to continously =
capture every inbound and outbound connection made to a freebsd system. I'd prefer a way that is native in base if possible.=C2=A0 =C2=A0I don&= #39;t really want
to record all the packets, just the src:dest:rport:dport stats.

Happy to RTFM as well,

Dan


Another possibility is to enable Netfl= ow in ipfw (there is an ipfw_netflow service), which submits periodic repor= ts of all connections made and their data usage, and then collect and proce= ss the Netflow data using a Netflow server.

Or dev= elop a custom Netgraph service that examines packets and logs connections. = This would even work in the absence of any firewall.

Damjan

--0000000000006349e305f0edd1e0--