From 80dc5de20c2fb6e67e7b9a66cab540336f1469bd Mon Sep 17 00:00:00 2001 From: Adolf Belka Date: Wed, 12 Mar 2025 15:46:10 +0100 Subject: [PATCH] ipblocklist-functions.pl: Specify an IPFire user agent for the downloads - As discussed at the IPFire conf call in March 2025, this patch provides an IPFire specific User Agent string for the IP Block Lists downloads using LWP::UserAgent. - It turned out that there was already a function in general-functions.pl that creates an IPFire Useer Agent string. This was used for this IP Blocklist download. - Currently it gave me the string IPFire/2.29/192. - This was tested out with the Threatview.io IP blocklist download and it worked fine. - If this patch is approved and merged then I will let contact Threatview.io to let them know what our User Agent string is. Tested-by: Adolf Belka Signed-off-by: Adolf Belka Signed-off-by: Michael Tremer --- config/cfgroot/ipblocklist-functions.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/cfgroot/ipblocklist-functions.pl b/config/cfgroot/ipblocklist-functions.pl index bd026a01df..665dadb4cb 100644 --- a/config/cfgroot/ipblocklist-functions.pl +++ b/config/cfgroot/ipblocklist-functions.pl @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2022 IPFire Team # +# Copyright (C) 2007-2025 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -118,13 +118,15 @@ sub download_and_create_blocklist($) { use LWP::UserAgent; # Create a user agent for downloading the blacklist + # Define the User Agent string # Limit the download size for safety + my $user_agent = &General::MakeUserAgent(); my $ua = LWP::UserAgent->new ( ssl_opts => { SSL_ca_file => '/etc/ssl/cert.pem', verify_hostname => 1, }, - + agent => $user_agent, max_size => $max_dl_bytes, ); -- 2.39.5