Hi Brian,

On 8/28/19 6:35 PM, Brian Sullivan wrote:
> I figured it out ... the following works fine. Maybe the dq object is
> readonly?

Most parts of dq are indeed read-only, except for those that are
documented as 'settable': https://dnsdist.org/reference/dq.html

Best regards,

Remi

> *-- Any traffic that exeeds max qps will be logged
> function rateLimitRule(dq)
>   local ca = dq.remoteaddr
>   ca:truncate(24)
>   errlog("Rate Limit Exceeded: DNSDistRateLimiting "..ca:toString())
>   return DNSAction.None, ""
> end*
> 
> Regards,
> brian
> 
> On Wed, Aug 28, 2019 at 11:35 AM Brian Sullivan
> <brian.sulli...@lookout.com <mailto:brian.sulli...@lookout.com>> wrote:
> 
>     Hi All,
> 
>     I am trying to use the truncate function associated with the
>     CombAddress object. 
> 
>     Here is the config:
>     *-- Any traffic that exceeds max qps will be logged
>     function rateLimitRule(dq)
>       dq.remoteaddr:truncate(24)
>       errlog("Rate Limit Exceeded: DNSDistRateLimiting
>     "..dq.remoteaddr:toString())
>       return DNSAction.None, ""
>     end
>     addAction(MaxQPSIPRule(10, 24, 48), LuaAction(rateLimitRule))*
> 
>     Unfortunately I see the following output:
> 
>     *dnsdist[882]: Rate Limit Exceeded: DNSDistRateLimiting 10.51.13.64
>     *
>     *
>     *
>     I know this must work so I must be doing something wrong.
> 
>     Regards,
>     brian
>     -- 
> 
>       
> 
>     Brian M. Sullivan
>     Senior Staff Security Intelligence Engineer
>     bsulli...@lookout.com <mailto:bsulli...@lookout.com> |
>      www.lookout.com <http://www.lookout.com>
> 
> 
> 
> -- 
> 
>   
> 
> Brian M. Sullivan
> Senior Staff Security Intelligence Engineer
> bsulli...@lookout.com <mailto:bsulli...@lookout.com> |  www.lookout.com
> <http://www.lookout.com>
> 
> 
> _______________________________________________
> dnsdist mailing list
> dnsdist@mailman.powerdns.com
> https://mailman.powerdns.com/mailman/listinfo/dnsdist
> 


-- 
Remi Gacogne
PowerDNS.COM BV - https://www.powerdns.com/

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dnsdist mailing list
dnsdist@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/dnsdist

Reply via email to