From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A3854613B; Mon, 27 Jan 2025 21:21:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 911E040A72; Mon, 27 Jan 2025 21:21:40 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9C21E402A9 for ; Mon, 27 Jan 2025 21:21:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738009298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Da3uaxwBuVkbS304e2YdwETbgiPtKvEdRF77b2OeqMI=; b=OY2DageGsoXqZldVpzbGFziRcn3O8cD3g/kr4cGwixFIFUZ4Ty/WNQvKQTBmB4/kvb06GK 42Y8lXBkqBvaYvy+i8AMbUrQAhsrZnx4ec6ZXaKn7WPTZvyL9CVv0kAkfVO9/YXFbVes/2 m2QEnvqfWJSek9WmaHhF8HkGe9korm0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-k-f7kUbfND26cHGyJTkXPQ-1; Mon, 27 Jan 2025 15:21:36 -0500 X-MC-Unique: k-f7kUbfND26cHGyJTkXPQ-1 X-Mimecast-MFC-AGG-ID: k-f7kUbfND26cHGyJTkXPQ Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4362153dcd6so24674755e9.2 for ; Mon, 27 Jan 2025 12:21:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738009295; x=1738614095; h=in-reply-to:references:user-agent:to:from:cc:subject:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Da3uaxwBuVkbS304e2YdwETbgiPtKvEdRF77b2OeqMI=; b=bjFTPCwO+W6f03MgNCyOzn1QSiRNvyiTAatmXvFUaXe0EWJ4lslA7ycdztp4426giG AcQuOW2XiQAoNf+JPnU3p7xhVPTWf/krcJ6vTxUKujEUdhs8wUgrPFvUbzQ4G/I1zQvR kGRF1CnnjB6NDTX01Q14Ax6PFleKGVdz8H7iH5U0Uy08K/Y+1s0atVnptCHWNsT2RG0z xbmEk9Si0CVGmr/+wdGbY0YFnRZ3igc5x7mkdDTDR7HPZzHtAf5cTTqwkmdLhGxrXUSO f/5nj+QGMRjp5xgR1gtWJvUHPu2+OXjvT0NaH1+h3ra0TkdpmPEa+vlaOvr3cYvXnyVS YkIw== X-Gm-Message-State: AOJu0Yw/BPrPfg+HKfR5T/Wms18+tIDyvmjejLwnmi/zJHwzdxURIQOP PTYYDsaw2Q5HNMsIbiz6KI/8fn+LQh04oapClg5gCGzZ0Eau6kc+bYZt5/H1KdNsKmu9W16eu6s 6W/emjSsQH9ibCfJT/xngDsyNU6frILSNwNwM4SY4 X-Gm-Gg: ASbGncuez399Q0UFFieHtvPzu6Gw2V0Wz5NyT+WNoEGMXn/WhU66DSxPPoKlc6Z1vQw oW3dAyFR6K1X3ZkYJuMKCdWEO0tOQG/qoSwYzSI8CsrZLSw0wpM5yRkaJGpnwqea6o2hlSqzNKS 7VGZplGxx/OjH/GRznSZcy6Oxgvv7f1RZC+5xG2/Z2vT9C6iAHMo30FqXo2WSx4VvkSRSIs37Rb bB2cKzS5GNy/lxZBM3aI6Hq0/KvZ+hqghMJQT/kLNEvwSVDMzyUi2UlVkVY/E9JFNCyLYRYcGo+ SBYxGar2gtZi/EMvrTjoEhJBArtHlMrnssgyXy+U6heJvL/ZhZ5rnWeMOPBY/m8= X-Received: by 2002:a05:600c:4894:b0:434:a7e7:a1ca with SMTP id 5b1f17b1804b1-43891427762mr337023555e9.20.1738009295445; Mon, 27 Jan 2025 12:21:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyuoceV1duCdDyMqWNjrVsduY4FNqYtvWII7LxneCtRqB1l9Zw/YXzG+YyK2RSINSrZ/dbow== X-Received: by 2002:a05:600c:4894:b0:434:a7e7:a1ca with SMTP id 5b1f17b1804b1-43891427762mr337023415e9.20.1738009295091; Mon, 27 Jan 2025 12:21:35 -0800 (PST) Received: from localhost (2a01cb000245cb001c88b351a0902c32.ipv6.abo.wanadoo.fr. [2a01:cb00:245:cb00:1c88:b351:a090:2c32]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4fa3efsm145348475e9.2.2025.01.27.12.21.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2025 12:21:34 -0800 (PST) Mime-Version: 1.0 Date: Mon, 27 Jan 2025 21:21:34 +0100 Message-Id: Subject: Re: [PATCH dpdk] telemetry-exporter: listen on loopback by default Cc: , From: "Robin Jarry" To: "Bruce Richardson" User-Agent: aerc/0.20.0-2-g96322f5eae08 References: <20250127115143.585207-2-rjarry@redhat.com> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: XR8wrMp_B9SPRx_smsNBE7v4Ppygt96D20_R7J6sIoQ_1738009295 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Bruce Richardson, Jan 27, 2025 at 15:39: > On Mon, Jan 27, 2025 at 12:51:44PM +0100, Robin Jarry wrote: >> Fix the following warning reported by Coverity: >>=20 >> Defect type: SIGMA.insecure_network_bind: >> > dpdk-stable-24.11.1/usertools/dpdk-telemetry-exporter.py:278: >> > Sigma main event: The HTTP server binds to all network interfaces by >> > setting the IP address to "", `0.0.0.0`, `::`, or `::0`. >> > This may expose the server to unintended traffic. >>=20 >> Avoid listening to all interfaces by default to avoid exposing private >> information unwillingly. >>=20 >> Unrelated: The Python stdlib TCP server listens on IPv4 only by default. >> Changing this requires creating a subclass that overrides address_family >> to socket.AF_INET6. >>=20 >> Fixes: d94ebd627a86 ("usertools: add telemetry exporter") >> Cc: stable@dpdk.org >> Signed-off-by: Robin Jarry >> --- >> usertools/dpdk-telemetry-exporter.py | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >>=20 >> diff --git a/usertools/dpdk-telemetry-exporter.py b/usertools/dpdk-telem= etry-exporter.py >> index 6eca0db2e80a..6f66d4ecaab1 100755 >> --- a/usertools/dpdk-telemetry-exporter.py >> +++ b/usertools/dpdk-telemetry-exporter.py >> @@ -75,7 +75,7 @@ def cmd(self, uri, arg=3DNone) -> dict | list: >> "/usr/local/share/dpdk/telemetry-endpoints", >> "/usr/share/dpdk/telemetry-endpoints", >> ] >> -DEFAULT_OUTPUT =3D "openmetrics://:9876" >> +DEFAULT_OUTPUT =3D "openmetrics://127.0.0.1:9876" >> =20 > > Minor nit, but would it be better to use "localhost" rather than the > hardcoded IP here and below? That's a good point. I had considered it but as I wrote in the commit message: >> Unrelated: The Python stdlib TCP server listens on IPv4 only by default. >> Changing this requires creating a subclass that overrides address_family >> to socket.AF_INET6. On certain systems and depending on the libc implementation, localhost may resolve to ::1 which causes an error on startup: socket.gaierror: [Errno -9] Address family for hostname not supported I dug a bit and it happens that the python standard TCPServer implementation explicitly uses AF_INET when creating the socket. Hence bind() fails with IPv6 addresses.