From patchwork Tue Oct 30 04:49:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1977 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 3E92761A1B for ; Mon, 29 Oct 2018 18:49:55 +0100 (CET) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id B399420F5E73; Mon, 29 Oct 2018 17:49:54 +0000 (GMT) Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [IPv6:2a03:4000:6:432c:1f9e:48:ac3:199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 233EE20F5E67 for ; Mon, 29 Oct 2018 17:49:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1540835389; h=from:from: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: references; bh=WiaNBRHRRcraWG5WCXqqJ10dG48TD9KnlC2f24Qr4KY=; b=40JwQOaREOkaQeNu0gH23uhcYeYw5ioODcnmijxQCqCxP0pqPWFzN6OkqunWapo+NKXQTS RyMQP993bRxAGTiKThy07LMPUqGqC2STf8zojdsh5HC5+QutvYiYtJUVN4gqNqtXJENpVo 6nq7ny+L61XyOyRHAbXKxXx/5+jS6qv2+PULY6uNr0Gn1YHgH05uQVzEIiG2cNwpbIHojS 69zFZ8L8soemnzeRvjPosfJm0eVFK8cb5cP6c4zQ5nNFKWUiQHv8PQ2iIw1wHuNb1Ml8d9 NLPOCWdzKVbISfH8gDjNXuFyzR4t1BKK/gviu87XyJdRlDcq6PxCJkCHQBojWA== From: =?utf-8?q?Peter_M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH] fix downloading Snort rules if behind upstream proxy Date: Mon, 29 Oct 2018 18:49:49 +0100 Message-Id: <20181029174949.7220-1-peter.mueller@link38.eu> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu X-Spamd-Result: default: False [-2.45 / 11.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[link38.eu]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a03:4000:6:432c:1f9e:48:ac3:199]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM(1.26)[0.421,0]; DKIM_TRACE(0.00)[link38.eu:+]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_MED(-0.20)[9.9.1.0.3.c.a.0.8.4.0.0.e.9.f.1.c.2.3.4.6.0.0.0.0.0.0.4.3.0.a.2.list.dnswl.org : 127.0.6.2]; DMARC_POLICY_ALLOW(-0.50)[link38.eu,none]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-2.45 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Currently, the wget call only uses proxy information for HTTP. Since rulesets are downloaded via HTTPS now, the same information also needs to be applied for HTTPS. Signed-off-by: Peter Müller --- html/cgi-bin/ids.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index d9d697deb..eddfc387c 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -692,7 +692,7 @@ sub downloadrulesfile { } if ($peer) { - system("wget -r --proxy=on --proxy-user=$proxysettings{'UPSTREAM_USER'} --proxy-passwd=$proxysettings{'UPSTREAM_PASSWORD'} -e http_proxy=http://$peer:$peerport/ -o /var/tmp/log --output-document=/var/tmp/snortrules.tar.gz $url"); + system("wget -r --proxy=on --proxy-user=$proxysettings{'UPSTREAM_USER'} --proxy-passwd=$proxysettings{'UPSTREAM_PASSWORD'} -e http_proxy=http://$peer:$peerport/ -e https_proxy=http://$peer:$peerport/ -o /var/tmp/log --output-document=/var/tmp/snortrules.tar.gz $url"); } else { system("wget -r -o /var/tmp/log --output-document=/var/tmp/snortrules.tar.gz $url"); }