Policy Events

Since 4.4.0, the Lua hook policyEventFilter() is called along with a PolicyEvent object whenever a filtering policy matches.

PolicyEvent class

class PolicyEvent

Represents an event related to a filtering policy.

:addPolicyTag(tag)

Add policyTag tag to the list of policyTags.

Parameters:tag (str) – The tag to add
:getPolicyTags() → {str}

Get the current policy tags as a table of strings.

:setPolicyTags(tags)

Set the policy tags to tags, overwriting any existing policy tags.

Parameters:tags ({str}) – The policy tags
:discardPolicy(policyname)

Skip the filtering policy (for example RPZ) named policyname for this query.

Parameters:policyname (str) – The name of the policy to ignore.
appliedPolicy

The decision that was made by the policy engine, see Modifying Policy Decisions and DNSQuestion.appliedPolicy for the attributes of PolicyEvent.appliedPolicy.

qname

DNSName of the name the query is for.

qtype

Type the query is for as an integer, can be compared against pdns.A, pdns.AAAA.

isTcp

Whether the query was received over TCP.

remote

ComboAddress of the requestor.