<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 20, 2015 at 10:23 AM, John Heasley <span dir="ltr"><<a href="mailto:heas@shrubbery.net" target="_blank">heas@shrubbery.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Am 20.02.2015 um 04:54 schrieb Alan McKinnon <<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a>>:<br>
<span class="">><br>
> The deny/permit statements are regexes, so it treats the pipe character as<br>
> an "OR". Try this for 3409:<br>
><br>
> permit "^logging\|include foo$"<br>
<br>
</span>| should only be a regex atom inside ()s. So it should not need to be escaped, though it should have no effect.<br>
<div><div class="h5"><br></div></div></blockquote><div><br></div><div>John, Yep. | has not effect. </div><div><br></div><div>Alan, permit "^logging|include foo$" is the correct syntax. permit "^logging\|include foo$" gets complain like below</div><div><br></div><div> Fri Feb 20 10:54:34 2015 [4614]: Error expecting '}' but found 'include' on line 3409</div><div><br></div><div>With permit "^logging|include foo$" I see T+ only sees ``show logging''</div><div><br></div><div><div>Fri Feb 20 10:59:41 2015 [4658]: line 3409 compare show permit '^logging | include ERRINTR' & 'logging <cr>' no match</div><div>Fri Feb 20 10:59:41 2015 [4658]: show logging <cr> permitted by line 3409</div></div><div><br></div><div>So it looks like T+ only sees whatever before the pipe(|) and makes decision on permit/deny based on that.</div><div><br></div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">
> (pls excuse the top post, have to use Gmail in a browse for now)<br>
><br>
> Alan<br>
><br>
><br>
>> On Thu, Feb 19, 2015 at 9:34 PM, Asif Iqbal <<a href="mailto:vadud3@gmail.com">vadud3@gmail.com</a>> wrote:<br>
>><br>
>> Hi All,<br>
>><br>
>> How do I allow ``show logging | include foo'' but not ``show logging'' ?<br>
>> Some security requirement that we are trying to achieve where<br>
>> you are allowed to search for specific string ``foo'', but not allowed to<br>
>> see all the logs.<br>
>><br>
>> This is what I tried and did not work<br>
>><br>
>> cmd = show {<br>
>> deny "^logging$"<br>
>> permit "^logging|include foo" # line 3409<br>
>> deny .*<br>
>> }<br>
>><br>
>> And I am getting<br>
>><br>
>> Thu Feb 19 14:25:44 2015 [3506]: show logging <cr> permitted by line 3409<br>
>><br>
>> I ran<br>
>> router#show logging<enter><br>
>><br>
>> If I try ``permit "^logging\s+|include foo'' I get the following error<br>
>><br>
>> Thu Feb 19 14:22:43 2015 [3434]: Error expecting '}' but found '+|' on<br>
>> line 3409<br>
>><br>
>> Any suggestion is appreciated.<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Asif Iqbal<br>
>> PGP Key: 0xE62693C5 KeyServer: <a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a><br>
>> A: Because it messes up the order in which people normally read text.<br>
>> Q: Why is top-posting such a bad thing?<br>
>> -------------- next part --------------<br>
>> An HTML attachment was scrubbed...<br>
>> URL: <<br>
>> <a href="http://www.shrubbery.net/pipermail/tac_plus/attachments/20150219/d92d91d9/attachment.html" target="_blank">http://www.shrubbery.net/pipermail/tac_plus/attachments/20150219/d92d91d9/attachment.html</a><br>
>> _______________________________________________<br>
>> tac_plus mailing list<br>
>> <a href="mailto:tac_plus@shrubbery.net">tac_plus@shrubbery.net</a><br>
>> <a href="http://www.shrubbery.net/mailman/listinfo/tac_plus" target="_blank">http://www.shrubbery.net/mailman/listinfo/tac_plus</a><br>
><br>
><br>
><br>
> --<br>
> Alan McKinnon<br>
> alan dot mckinnon at gmail dot com<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
</div></div>> URL: <<a href="http://www.shrubbery.net/pipermail/tac_plus/attachments/20150220/07bd05ce/attachment.html" target="_blank">http://www.shrubbery.net/pipermail/tac_plus/attachments/20150220/07bd05ce/attachment.html</a>><br>
<div class=""><div class="h5">> _______________________________________________<br>
> tac_plus mailing list<br>
> <a href="mailto:tac_plus@shrubbery.net">tac_plus@shrubbery.net</a><br>
> <a href="http://www.shrubbery.net/mailman/listinfo/tac_plus" target="_blank">http://www.shrubbery.net/mailman/listinfo/tac_plus</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Asif Iqbal<br>PGP Key: 0xE62693C5 KeyServer: <a href="http://pgp.mit.edu">pgp.mit.edu</a><br>A: Because it messes up the order in which people normally read text.<br>Q: Why is top-posting such a bad thing?<br><br></div>
</div></div>