You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exception thrown while resolving one domain shouldn't prevent the other domains from being tested. There are some cases where that can happen with the current implementation of Invoke-RobustDnsTxt.
Motivation and context
Invoke-RobustDnsTxt handles the following cases:
Non-existent domain names (NXDOMAIN)
Empty answer sections
One-time network failures
Split DNS scenarios where a domain isn't accessible locally but can be resolved on the public Internet (assuming DoH isn't blocked).
But if an exception occurs outside of that scope, Invoke-RobustDnsTxt will throw an exception. For example, if both Resolve-DnsName and Invoke-WebRequest both repeatedly timeout (e.g., due to a firewall), an exception will be thrown. For example, a misconfigured authoritative server might return a SERVFAIL for one domain, but that wouldn't imply that other domains would fail, so that shouldn't prevent ScubaGear from querying the other domains.
if: We got our answer, no change needed for this case.
elseif: We got an empty answer section, experience has shown that this might be due to a split DNS setup. A warning is printed by the calling function in this case.
else: This is the case that needs to be changed. Simplest thing would be to convert that throw to Write-Warning, then have the function return @{"Answers" = $Answers; "HighConfidence" = $true; "LogEntries" = $LogEntries}. Main problem with that strategy is that does introduce the possibility of a log of long warnings to be printed. Maybe that's ok?
Acceptance criteria
An error resolving one domain name doesn't prevent the rest of the domains from being attempted.
The text was updated successfully, but these errors were encountered:
schrolla
added
bug
This issue or pull request addresses broken functionality
and removed
enhancement
This issue or pull request will add new or improve existing functionality
labels
Dec 19, 2024
💡 Summary
An exception thrown while resolving one domain shouldn't prevent the other domains from being tested. There are some cases where that can happen with the current implementation of Invoke-RobustDnsTxt.
Motivation and context
Invoke-RobustDnsTxt handles the following cases:
But if an exception occurs outside of that scope,
Invoke-RobustDnsTxt
will throw an exception. For example, if bothResolve-DnsName
andInvoke-WebRequest
both repeatedly timeout (e.g., due to a firewall), an exception will be thrown. For example, a misconfigured authoritative server might return a SERVFAIL for one domain, but that wouldn't imply that other domains would fail, so that shouldn't prevent ScubaGear from querying the other domains.Resulting issues:
Implementation notes
Invoke-RobustDnsTxt
ends with an if/elseif/else.if
: We got our answer, no change needed for this case.elseif
: We got an empty answer section, experience has shown that this might be due to a split DNS setup. A warning is printed by the calling function in this case.else
: This is the case that needs to be changed. Simplest thing would be to convert thatthrow
toWrite-Warning
, then have the function return@{"Answers" = $Answers; "HighConfidence" = $true; "LogEntries" = $LogEntries}
. Main problem with that strategy is that does introduce the possibility of a log of long warnings to be printed. Maybe that's ok?Acceptance criteria
An error resolving one domain name doesn't prevent the rest of the domains from being attempted.
The text was updated successfully, but these errors were encountered: