public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCHv2] logs.cgi/ids.dat: Rework linking to external rule documentation.
Date: Tue, 14 Aug 2018 11:48:26 +0100	[thread overview]
Message-ID: <7d4596910931a774382805fb5fde6b8bd60577f6.camel@ipfire.org> (raw)
In-Reply-To: <20180814100153.6901-1-stefan.schantl@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

Thanks. Merged.

On Tue, 2018-08-14 at 12:01 +0200, Stefan Schantl wrote:
> Check if the sid of a rule belongs to sourcefire and link to the
> changed URL for gathering more details. If the sid of the rule belongs
> to emergingthreads now link to the emergingthreads documentation.
> 
> Fixes #11806.
> 
> Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
> ---
>  html/cgi-bin/logs.cgi/ids.dat | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/html/cgi-bin/logs.cgi/ids.dat b/html/cgi-bin/logs.cgi/ids.dat
> index 98176d690..030fd4b64 100644
> --- a/html/cgi-bin/logs.cgi/ids.dat
> +++ b/html/cgi-bin/logs.cgi/ids.dat
> @@ -335,10 +335,18 @@ print <<END
>  <td valign='top'>
>  END
>  	;
> -	if ($sid ne "n/a") {
> -		print "<a href='https://www.snort.org/rule_docs/$sid' ";
> +	if ($sid eq "n/a") {
> +		print $sid;
> +	} elsif ($sid < 1000000) {
> +		# Link to sourcefire if the the rule sid is less than 1000000.
> +		print "<a href='https://www.snort.org/rule_docs/1-$sid' ";
> +		print "target='_blank'>$sid</a></td>\n";
> +	} elsif ($sid >= 2000000 and $sid < 3000000) {
> +		# Link to emergingthreats if the rule sid is between 2000000 and 3000000.
> +		print "<a href='http://doc.emergingthreats.net/$sid' ";
>  		print "target='_blank'>$sid</a></td>\n";
>  	} else {
> +		# No external link for user defined rules
>  		print $sid;
>  	}
>  print <<END


      reply	other threads:[~2018-08-14 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-11 18:08 [PATCH] " Stefan Schantl
2018-08-14  8:16 ` Michael Tremer
2018-08-14 10:01   ` [PATCHv2] " Stefan Schantl
2018-08-14 10:48     ` Michael Tremer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d4596910931a774382805fb5fde6b8bd60577f6.camel@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox