From nobody Mon Feb 9 01:48:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579882152; cv=none; d=zohomail.com; s=zohoarc; b=JrqMfP90HTa37kEIGcG16Pu3mGLRWmmdSci+c/mzJnDnykh66Nc04rPraVKM08hG7nauT2UmlYMKPDwa8beMmOeatgysKwKqQy9FFv0U7EAYlWFqHBXIkCQLBuQ3vma/FR1XEGjbYNXSB72GmR2dJ7PMPDEFx80Imf7Ub8Aazt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579882152; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=InxzFpjrzv+N5oO/UHUXERFFPRvtnjQ4qWxaU5ZLwdA=; b=VTSPgkcUcvZbGyHncCUW30yRxlLkaXtrR/X4l92syP9jDYIx57DFKYr5TmU29pNl/RUwXwI+TjE/BDE/YkEpsIWkOJyk+EE2H1zYi8V8qy5B+4CDIYpkdVBw8/1J+nriCmMdzD6LzHVcdu+0e5/wwZOYkdSS0h44Wt1m5hTIS0A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579882152008828.3187689248882; Fri, 24 Jan 2020 08:09:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-jbUl5Rd7MSabkapvLZd-hQ-1; Fri, 24 Jan 2020 11:09:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 075691084E7D; Fri, 24 Jan 2020 16:09:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D5B965C241; Fri, 24 Jan 2020 16:09:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 893A51803C40; Fri, 24 Jan 2020 16:09:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00OG90X0011953 for ; Fri, 24 Jan 2020 11:09:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 25F7F5C298; Fri, 24 Jan 2020 16:09:00 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id A15BD5C296 for ; Fri, 24 Jan 2020 16:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579882150; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=InxzFpjrzv+N5oO/UHUXERFFPRvtnjQ4qWxaU5ZLwdA=; b=RZnTMHn7314TyhBokfCwA5n27Ql3rh5rk+ks8k4dbzShMrVbocYspH8dDznsmfoPrCfpNN CSK9dJCiIJAqZRjJ7AL0uU9cVEND/tXCKnQmLijATl1RcVBZiWd766llUyYcmV9oM8onE1 u2CwaE4Z179rzXKUNDlCR+jfj/cDOYc= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 6/9] virsh: secret: Print warning that passing secret on command-line is insecure Date: Fri, 24 Jan 2020 17:08:38 +0100 Message-Id: <671105902fec86c7b7f3c0e9f6f311ff469c8238.1579881978.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: jbUl5Rd7MSabkapvLZd-hQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Print a warning if users pass in secrets as command line arguments and mention it in the man page. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/manpages/virsh.rst | 3 +++ tools/virsh-secret.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index a7551b9709..823f130f1c 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -6571,6 +6571,9 @@ Base64-encoded value *base64* or Base-64-encoded cont= ents of file named Note that *--file* and *base64* options are mutually exclusive. +Passing secrets via the *base64* option on command line is INSECURE and +deprecated. Use the *--file* option instead. + secret-get-value ---------------- diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 66852173b5..0ca08bc133 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -217,6 +217,10 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd) return false; } + /* warn users that the --base64 option passed from command line is wro= ng */ + if (base64) + vshError(ctl, _("Passing secret value as command-line argument is = insecure!")); + if (filename) { ssize_t read_ret; if ((read_ret =3D virFileReadAll(filename, 1024, &file_buf)) < 0) { --=20 2.24.1