From patchwork Mon Feb 9 14:23:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 9495 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4f8n752BBzz3xGR for ; Mon, 09 Feb 2026 14:26:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "E8" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4f8n75072zz5gw for ; Mon, 09 Feb 2026 14:26:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4f8n706pRQz349h for ; Mon, 09 Feb 2026 14:26:04 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4f8n6x6kYTz333G for ; Mon, 09 Feb 2026 14:26:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4f8n6x2l4Fzvw; Mon, 09 Feb 2026 14:26:01 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1770647161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cNAkDY6hHk1Bu/ucNTBDkw6jdqkmSRYIlaGc8tGiUtI=; b=EYXWSxgYxocaqKEXDWVL2pbUA8VjiFi27ntvSZhm5/Tva/SsUXGzRqf9+D8ksXiubpYRc0 YTvPNiQB2iFjqbAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1770647161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cNAkDY6hHk1Bu/ucNTBDkw6jdqkmSRYIlaGc8tGiUtI=; b=t7xR6NXTHztKGR8vRMEJroGPN0A28kuJOIcExW/PFOUWSGdzwUsEoAtwgelfdSmuBAyfw5 CEFe6qY4CiZ2WIF29lHbPAhMrpt5N+kv8tnw735FiIh8Z4JTig50HiK2OQQCU+QG/6rwoO t3ifSsn9Dl+IxLFrFwH6MoViBU8jl4ba3VVvREYxDY2na+lOICkHQYxsVuhsXwkXd0s90d jU+Er5V/nuHlphvmnD0XROD4D4dpjkgebdfBJBsHpTNVLlYinmVJd60Mv5lm3C3ctJbRX7 Kbdo3vCWZjpzX/bVeumGYVlGzZXCoU6UK7vC4UDeyQlu9uzc4Wv0Fwj2D4jQTA== From: Stefan Schantl To: development@lists.ipfire.org Cc: Stefan Schantl Subject: [PATCH 3/4] ids-functions.pl: Add function to get the info url for a given rule id Date: Mon, 9 Feb 2026 15:23:21 +0100 Message-ID: <20260209142322.2481-3-stefan.schantl@ipfire.org> In-Reply-To: <20260209142322.2481-1-stefan.schantl@ipfire.org> References: <20260209142322.2481-1-stefan.schantl@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 0271ef4fc..93d1acdee 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -1909,4 +1909,29 @@ sub is_sid_in_range($\@) { return undef; } +# +## Function to get the sid info url in case it is defined +# +sub get_sid_info_url($) { + my ($sid) = @_; + + # Call function to get the provider for this rule id. + my $provider = &get_provider_by_sid($sid); + + # Exit if no provder could be determined. + return unless($provider); + + # Exit if no info URL is known for the provider. + return unless($IDS::Ruleset::Providers{$provider}{"sid_info_url"}); + + # Grab the URL for the given provider. + my $info_url = $IDS::Ruleset::Providers{$provider}{"sid_info_url"}; + + # Replace the placeholder with the given sid. + $info_url =~ s/\/$sid/g; + + # Return the URL. + return $info_url; +} + 1;