{{define "content"}} {{$csrf := .CSRF}}

Policy Rules

A policy pairs a set of blacklists and allowlists with what to do when a name matches.

Add Policy
{{if .Data.Policies}}
{{range .Data.Policies}} {{end}}
PolicyBlocksAllows ActionNetworks StatusActions
{{.Name}} {{if .Description}}
{{truncate 70 .Description}}
{{end}}
{{if .BlacklistName}}
{{range .BlacklistName}} {{.}} {{end}}
{{else}}{{end}}
{{if .AllowlistName}}
{{range .AllowlistName}} {{.}} {{end}}
{{else}}{{end}}
{{.BlockAction.Label}} {{if eq (printf "%s" .BlockAction) "sinkhole"}}
{{.SinkholeIPv4}} / {{.SinkholeIPv6}}
{{end}}
{{.NetworkCount}} {{statusWord .Enabled}}
{{template "postform" dict "Action" (printf "/policies/rules/%d/toggle" .ID) "CSRF" $csrf "ReturnTo" "/policies" "Fields" (dict "enabled" (boolstr (not .Enabled))) "Icon" (toggleIcon .Enabled) "Class" "btn btn-sm btn-outline-secondary" "Title" (printf "%s this policy" (toggleVerb .Enabled))}} {{template "confirmform" dict "Action" (printf "/policies/rules/%d/delete" .ID) "CSRF" $csrf "Icon" "bi-trash" "Message" (printf "Delete the policy %q? It will be removed from %d network(s)." .Name .NetworkCount)}}
{{else}} {{template "empty" dict "Icon" "bi-sliders" "Title" "No policies yet" "Message" "A policy decides what happens when a query matches one of its blacklists — return NXDOMAIN, refuse the query, or answer with a sinkhole address. Assign the policy to a client network to put it into effect."}} {{end}}
{{end}}