From nobody Thu Dec 29 09:13:24 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 4NjN3W2RzKz2kjH9 for ; Thu, 29 Dec 2022 09:13:27 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Received: from plan-b.pwste.edu.pl (plan-b.pwste.edu.pl [IPv6:2001:678:618::40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "plan-b.pwste.edu.pl", Issuer "GEANT OV RSA CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NjN3V4rslz3HBj for ; Thu, 29 Dec 2022 09:13:26 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=plan-b.pwste.edu.pl header.s=plan-b-mailer header.b=FfDr+qrZ; spf=none (mx1.freebsd.org: domain of zarychtam@plan-b.pwste.edu.pl has no SPF policy when checking 2001:678:618::40) smtp.mailfrom=zarychtam@plan-b.pwste.edu.pl; dmarc=pass (policy=none) header.from=plan-b.pwste.edu.pl Received: from [IPV6:2a02:22e0:cf00:1ff:14:8c0b:28dd:98c] (mzar@[IPv6:2a02:22e0:cf00:1ff:14:8c0b:28dd:98c]) (authenticated bits=0) by plan-b.pwste.edu.pl (8.17.1/8.17.1) with ESMTPSA id 2BT9DOIr009172 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Thu, 29 Dec 2022 10:13:24 +0100 (CET) (envelope-from zarychtam@plan-b.pwste.edu.pl) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=plan-b.pwste.edu.pl; s=plan-b-mailer; t=1672305205; bh=gCtpJP5K2f8XeeYhPfN7hKNUdEpa0q5qNVlvTRQflds=; h=Date:Subject:To:References:From:In-Reply-To; b=FfDr+qrZuls3vZ+uD3R8KeQDETc7DfuXGJ+lLSO72t15BkGSU+nqx8BC1umqomTYj Q1vqLIbCyujqD8wlZr85OEhO+nOcVBllnKLGNbnfXWKuwMxj/AprxRTGMaq8c6uyLA Fdgs3CbzyT71B5Qw1ir3mUmMb9ioCo3BDZWnxoAOxYQX/uULMtHSoG0XDcd/u+KUJW w80qM7HRZZb2mqIP/HMWivn+bjybXezohnlCmVyCqCZwE8q/gWRdW/dmPfkLfoo6Gk T1hK2bpMjJ79KsgkWfr2GHEN/+hHUX+Y1dFi1VMWVcD3cbIM0eob5kzPz2xI2b+mKn HYBsQ3S9NeqBA== Content-Type: multipart/alternative; boundary="------------UIWKljjd19Yx81xeL1gh6a3v" Message-ID: Date: Thu, 29 Dec 2022 10:13:24 +0100 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: native recording of all network connections on freebsd Content-Language: en-US To: freebsd-current@freebsd.org References: From: Marek Zarychta In-Reply-To: X-Spamd-Result: default: False [-3.80 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[plan-b.pwste.edu.pl,none]; R_DKIM_ALLOW(-0.20)[plan-b.pwste.edu.pl:s=plan-b-mailer]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:206006, ipnet:2001:678:618::/48, country:PL]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DKIM_TRACE(0.00)[plan-b.pwste.edu.pl:+]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4NjN3V4rslz3HBj X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N This is a multi-part message in MIME format. --------------UIWKljjd19Yx81xeL1gh6a3v Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit W dniu 29.12.2022 o 02:58, Damjan Jovanovic pisze: > > > 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. > Such a node exists: ng_netflow(4) and works flawlessly. -- Marek Zarychta --------------UIWKljjd19Yx81xeL1gh6a3v Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
W dniu 29.12.2022 o 02:58, Damjan Jovanovic pisze:


On Wed, Dec 28, 2022 at 4:21 PM Dan Mack <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.   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.

Such a node exists: ng_netflow(4) and works flawlessly.



-- 
Marek Zarychta
--------------UIWKljjd19Yx81xeL1gh6a3v--