<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
p.Textodeglobo, li.Textodeglobo, div.Textodeglobo
{mso-style-name:"Texto de globo";
mso-style-link:"Texto de globo Car";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.TextodegloboCar
{mso-style-name:"Texto de globo Car";
mso-style-priority:99;
mso-style-link:"Texto de globo";
font-family:"Tahoma","sans-serif";}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 85.05pt 70.85pt 85.05pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1455438834;
mso-list-type:hybrid;
mso-list-template-ids:185351482 -1259587830 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>$EXTERNAL_NET is every IP that isn’t in your $HOME_NET, and that includes the Google DNS servers. It’s like saying [8.8.8.8,!8.8.8.8], which matches both 8.8.8.8 and every IP that isn’t 8.8.8.8, so it’s always a true condition. You can fix it just by removing the $EXTERNAL_NET, unless your sensor is positioned where it would see port 53 traffic between internal hosts. If that’s the case, you can exclude particular IPs by putting a pass rule ahead of the alert rule.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>- Matt<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> oisf-users-bounces@lists.openinfosecfoundation.org [mailto:oisf-users-bounces@lists.openinfosecfoundation.org] <b>On Behalf Of </b>Xavier Romero<br><b>Sent:</b> Wednesday, August 27, 2014 4:40 AM<br><b>To:</b> oisf-users@lists.openinfosecfoundation.org<br><b>Subject:</b> [Oisf-users] Ignore ips in rule<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=CA>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>I’ve this custom rule:<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='mso-fareast-language:CA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:CA'>...<o:p></o:p></span></p><p class=MsoNormal><span lang=RU style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:CA'>alert udp [$EXTERNAL_NET,!$GOOGLE_DNS] 53 -> [$HOME_NET,!$DNS_SERVERS] any (msg:"Possible atac DNS"; threshold: type both, track by_dst, count 600, seconds 60; classtype:attempted-dos; sid:101111009; rev:5;)</span><span lang=CA style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:CA'><o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:CA'>...<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='mso-fareast-language:CA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>And this definition on suricata.yaml:<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>...<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'># Holds variables that would be used by the engine.<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>vars:<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> # Holds the address group vars that would be passed in a Signature.<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> # These would be retrieved during the Signature address parsing stage.<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> address-groups:<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> HOME_NET: "[x.x.x.x/24]"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> GOOGLE_DNS: "[8.8.8.8,8.8.4.4]"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> EXTERNAL_NET: "!$HOME_NET"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> HTTP_SERVERS: "$HOME_NET"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> SMTP_SERVERS: "$HOME_NET"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> SQL_SERVERS: "$HOME_NET"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> DNS_SERVERS: "[a.a.a.a,b.b.b.b,c.c.c.c,d.d.d.d]"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'> TELNET_SERVERS: "$HOME_NET"<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>...<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>However, there are alerts like these:<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>...<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>08/27/2014-10:33:37.344581 [**] [1:101111009:5] Possible atac DNS [**] [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 8.8.8.8:53 -> a.b.c.d:52721<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>08/27/2014-10:33:48.511591 [**] [1:101111009:5] Possible atac DNS [**] [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 8.8.8.8:53 -> a.b.c.d:35899<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas'>...<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>I’m expecting to totally ignore packets whith IP source 8.8.8.8. What I’m doing wrong?<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>I’ve also tried<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'> </span><span lang=RU style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'>[$EXTERNAL_NET,!</span><span lang=CA style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'>[8.8.8.8,8.8.4.4]</span><span lang=RU style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'>]</span><span lang=CA style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'><o:p></o:p></span></p><p class=MsoNormal><span lang=CA>Instead of:<o:p></o:p></span></p><p class=MsoNormal><span lang=CA style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'> </span><span lang=RU style='font-size:9.0pt;font-family:Consolas;mso-fareast-language:CA'>[$EXTERNAL_NET,!$GOOGLE_DNS]</span><span lang=CA style='font-size:10.0pt'><o:p></o:p></span></p><p class=MsoNormal><span lang=CA>With the same result.<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>Each time I modify the rule, I increment REV number and restart suricata.<o:p></o:p></span></p><p class=MsoNormal><span lang=CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=CA>Thank you very much,<o:p></o:p></span></p><p class=MsoNormal><span lang=CA>Xavier Romero<o:p></o:p></span></p></div></div></body></html>