Signed-off-by: Stefan Schantl <[email protected]>
---
 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 <sid> placeholder with the given sid.
+       $info_url =~ s/\<sid\>/$sid/g;
+
+       # Return the URL.
+       return $info_url;
+}
+
 1;
-- 
2.47.3


Reply via email to