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.
-
PolicyEvent(): addPolicyTag(
tag)¶ Add policyTag
tagto the list of policyTags.- Parameters:¶
tag (
str) – The tag to add
-
PolicyEvent(): getPolicyTags(): {
str}¶ Get the current policy tags as a table of strings.
-
PolicyEvent(): setPolicyTags(
tags)¶ Set the policy tags to
tags, overwriting any existing policy tags.- Parameters:¶
tags ({
str}) – The policy tags
-
PolicyEvent(): discardPolicy(
policyname)¶ Skip the filtering policy (for example RPZ) named
policynamefor this query.- Parameters:¶
policyname (
str) – The name of the policy to ignore.
- PolicyEvent.appliedPolicy¶
The decision that was made by the policy engine, see Modifying Policy Decisions and
DNSQuestion.appliedPolicyfor the attributes ofPolicyEvent.appliedPolicy.
- PolicyEvent.qtype¶
Type the query is for as an integer, can be compared against
pdns.A,pdns.AAAA.
- PolicyEvent.isTcp¶
Whether the query was received over TCP.
- PolicyEvent.remote¶
ComboAddressof the requestor.
-
PolicyEvent(): addPolicyTag(