From nobody Sat Feb 7 05:22:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1728395126538880.1442704009697; Tue, 8 Oct 2024 06:45:26 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 65FDC161A; Tue, 8 Oct 2024 09:45:25 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4E4431634; Tue, 8 Oct 2024 09:44:14 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 50DA410A2; Tue, 8 Oct 2024 09:44:08 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CCB59BD1 for ; Tue, 8 Oct 2024 09:44:07 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-265-rPUuC0opMCyyqhySj2jIPA-1; Tue, 08 Oct 2024 09:44:05 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 227001955EEA for ; Tue, 8 Oct 2024 13:44:05 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.12]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 50DC719560AA for ; Tue, 8 Oct 2024 13:44:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728395047; h=from:from: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; bh=XW/ux321YYzsDi4Rzxt7nKNUfvE4Pt9FKhXF/lve6AY=; b=VYCR/2aZ7nNfTZHaq1MTpP+tz6uQIypKgTASL5YPMlJ0NHEJvulKnjB7GMSEXD14B8HMMM LewtRMS6Dej75JfODWGMP1xG/1bPcsjTbDt+mKMEBB6Nat792VxZ0RVLOFZwQffPOMddO0 YT+3ok9musttAWjVTKGPNn8u7sEpX+g= X-MC-Unique: rPUuC0opMCyyqhySj2jIPA-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 2/6] docs: Reject non-https external links Date: Tue, 8 Oct 2024 15:43:55 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LQHAM6TWMRIX5OSTWRWR6B5KJPNXMYIK X-Message-ID-Hash: LQHAM6TWMRIX5OSTWRWR6B5KJPNXMYIK X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1728395127135116600 Content-Type: text/plain; charset="utf-8" Add a '--require-https' switch to 'check-html-references' helper script which will error out if any non-https external link is used from our web and use it while builidng docs. Signed-off-by: Peter Krempa --- docs/meson.build | 1 + scripts/check-html-references.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/meson.build b/docs/meson.build index 53b518f987..a94f481730 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -358,6 +358,7 @@ if tests_enabled[0] python3_prog, args: [ check_html_references_prog.full_path(), + '--require-https', '--webroot', meson.project_build_root() / 'docs' ], diff --git a/scripts/check-html-references.py b/scripts/check-html-referenc= es.py index d15f28bea7..3382d838c5 100755 --- a/scripts/check-html-references.py +++ b/scripts/check-html-references.py @@ -224,6 +224,18 @@ def check_images(usedimages, imagefiles, ignoreimages): return fail +# checks that all links are accessed via https +def check_https(links): + fail =3D False + + for link in links: + if link.startswith('http://'): + print(f'ERROR: URI \'{link}\' uses insecure "http" protocol') + fail =3D True + + return fail + + parser =3D argparse.ArgumentParser(description=3D'HTML reference checker') parser.add_argument('--webroot', required=3DTrue, help=3D'path to the web root') @@ -233,6 +245,8 @@ parser.add_argument('--external', action=3D"store_true", help=3D'print external references instead') parser.add_argument('--ignore-images', action=3D'append', help=3D'paths to images that should be considered as u= sed') +parser.add_argument('--require-https', action=3D"store_true", + help=3D'require secure https for external links') args =3D parser.parse_args() @@ -269,6 +283,13 @@ else: if check_images(usedimages, imagefiles, args.ignore_images): fail =3D True + if args.require_https: + if check_https(externallinks): + fail =3D True + + if check_https(externalimages): + fail =3D True + if fail: sys.exit(1) --=20 2.46.0