POST api/filter-check explains whether a name is blocked for a client, and one call adds a domain to the built-in custom allow or block list #107
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
Reference
lantea-one/ninlil#107
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
An operator cannot ask why a name is blocked, or which lists contain it, without reading each list. Allow and block from the log need a list to write to; the owner chose two built-in custom lists.
What changes
IDnsFilterEngineandDnsFilterEngine: addExplainDomainAsync(DnsName name, IPAddress client, string clientId, bool allLists, CancellationToken).@@exception cancelled it) and the final verdict afterPrecedence, from the same in-memory index the query path uses (DnsFilterEngine.cs:125-149).allLists = truechecks every enabled domain list, whatever the client. This covers "which list contains this domain" without a database scan.Ninlil.Web/Controllers/FilterCheckController.cs(new):POST api/filter-checkwith body{ domain, clientAddress?, clientId?, allLists? }.{ verdict, filteringEnabled, matches[], scheduleBlock? }.filterlists:read, likeFilterPatternPreviewController.:63-67).Guidconstant (one for "Custom allow", one for "Custom block"), so no schema change is needed to find them, and a list the operator deleted is simply created again on next use.POST api/filter-lists/custom-entrieswith body{ domain, action: Allow|Block }, requiringfilterlists:write.Source = Local,Kinddomain, the matchingAction,AppliesToAllClients = true(src/dotnet/src/Ninlil.Dns.Data.Abstractions/Entity/DnsFilterListEntity.cs:19-71).Domainentry through the same validation asPOST api/filter-lists/{listId}/entries(FilterListEntriesController.cs:137). An entry that already exists returns 200 with the existing entry; a new one returns 201.Acceptance
src/dotnet/tests/Ninlil.Dns.Server.Filtering.Tests. A name on block list A and allow list B withAllowWinsexplains as verdict Allowed, with two matches.src/dotnet/tests/Ninlil.Web.Tests:POST api/filter-lists/custom-entrieswithBlockcreates the list on first call, returns 201, and a query for the domain is then blocked; a repeat returns 200 and adds no second entry.src/dotnet/tests/Ninlil.Web.Tests: 400 for a blank or over-long domain; 403 withoutfilterlists:read(check) orfilterlists:write(custom entries).Source
audit-feature-parity.md§2A #4.