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@ipfire.org --- html/cgi-bin/logs.cgi/ids.dat | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/html/cgi-bin/logs.cgi/ids.dat b/html/cgi-bin/logs.cgi/ids.dat index 98176d690..5aef53499 100644 --- a/html/cgi-bin/logs.cgi/ids.dat +++ b/html/cgi-bin/logs.cgi/ids.dat @@ -336,7 +336,14 @@ print <<END END ; if ($sid ne "n/a") { - print "<a href='https://www.snort.org/rule_docs/$sid' "; + # Link to sourcefire if the the rule sid is less than 1000000. + if ($sid lt 1000000) { + print "<a href='https://www.snort.org/rule_docs/1-$sid'"; + # Link to emergingtreads if the rule sid is between 2000000 and 3000000. + } elsif (($sid gt 2000000) && ($sid lt 3000000)) { + print "<a href='http://doc.emergingthreats.net/$sid'"; + } + # Close html tag for hyperlink. print "target='_blank'>$sid</a></td>\n"; } else { print $sid;
Please see the comments on the bug ticket...
On Sat, 2018-08-11 at 20:08 +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@ipfire.org
html/cgi-bin/logs.cgi/ids.dat | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/html/cgi-bin/logs.cgi/ids.dat b/html/cgi-bin/logs.cgi/ids.dat index 98176d690..5aef53499 100644 --- a/html/cgi-bin/logs.cgi/ids.dat +++ b/html/cgi-bin/logs.cgi/ids.dat @@ -336,7 +336,14 @@ print <<END END ; if ($sid ne "n/a") {
print "<a href='https://www.snort.org/rule_docs/$sid' ";
# Link to sourcefire if the the rule sid is less than 1000000.
if ($sid lt 1000000) {
print "<a href='https://www.snort.org/rule_docs/1-$sid'"
;
# Link to emergingtreads if the rule sid is between 2000000 and
} elsif (($sid gt 2000000) && ($sid lt 3000000)) {
print "<a href='http://doc.emergingthreats.net/$sid'";
}
print "target='_blank'>$sid</a></td>\n"; } else { print $sid;# Close html tag for hyperlink.
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@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
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@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