Repository navigation
[medium] Switch six domain lists from "string" to "hostname" matching - #461
Merged
Merged
Conversation
MISP core matches "string" lists by exact, case-sensitive lookup with the
entries loaded as-is, while "hostname" lists have their entries dot-trimmed
and lowercased and match the value's host or any parent domain of it (also
when the value is a URL). Six lists rely on the "hostname" behaviour while
being typed "string":
- microsoft, microsoft-win10-connection-endpoints,
microsoft-win11-connection-endpoints: entries with a leading dot
(".aadrm.com"), meant as "this domain and its subdomains", never matched
anything (250 of 322 entries of microsoft). Entries are now stored bare.
- microsoft-office365: the generator reduces Microsoft's "*.foo.com" to
"foo.com", which under "string" only matched the apex.
- rfc6761: "test", "localhost", "invalid", "example" and the
in-addr.arpa zones reserve every name under them.
- public-ipfs-gateways: has url/uri in matching_attributes, which a bare
host name can never equal exactly; subdomain gateways did not match either.
Because "hostname" entries also cover their subdomains, entries that are
themselves public suffixes (azurewebsites.net, cloudapp.net, azureedge.net,
azure-api.net, azure-mobile.net, akadns.net, akamai.net, akamaiedge.net,
blob.core.windows.net) are dropped from the three Microsoft lists: they
would otherwise match names registered by any customer of those platforms.
Entries with a "*" inside a name (".autodiscover.*.onmicrosoft.com",
"watson.*.microsoft.com") are dropped, as no list type supports them; the
onmicrosoft.com ones were already covered by ".onmicrosoft.com".
Generators are updated so the next run keeps the new type and shape, and
filter wildcards and public suffixes the same way (via a shared
get_public_suffixes() helper reading the second-level-tlds list).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wC3ntBnXWYwYidQwyNq9W
Now that the list is of type "hostname", the former leading-dot entries match every subdomain. These eleven are shared CDN zones serving many non-Microsoft customers (hwcdn.net customer subdomains can serve arbitrary content), so they would suppress warnings well beyond Windows 10 endpoints: g.akamaiedge.net, b.akamaiedge.net, dscb1.akamaiedge.net, dspb.akamaiedge.net, dspg.akamaiedge.net, g.akamai.net, dscd.akamai.net, dspw65.akamai.net, hwcdn.net, wac.edgecastcdn.net, wac.phicdn.net. Specific hosts on those CDNs (a122.dscd.akamai.net, Microsoft-named *.akadns.net / *.nsatc.net / *.footprint.net CNAMEs) are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wC3ntBnXWYwYidQwyNq9W
Microsoft publishes the CRL / OCSP / AIA endpoints of the CAs Office 365 relies on (*.verisign.com, *.entrust.net, crl3.digicert.com, ...). Now that the list is of type "hostname" they would match every subdomain of those CAs, and suppress them for every other vendor using the same CA. Drop the 22 such entries, keeping Microsoft's own (crl.microsoft.com, mscrl.microsoft.com, oneocsp.microsoft.com, ocsp.msocsp.com). The CA registrable domains generate-microsoft.py already excluded move to generator.py as CERTIFICATE_AUTHORITY_DOMAINS, and generate-office365.py now filters on them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wC3ntBnXWYwYidQwyNq9W
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF
microsoft,microsoft-win10-connection-endpoints,microsoft-win11-connection-endpoints,microsoft-office365,rfc6761,public-ipfs-gateways) switch from"type": "string"to"type": "hostname". Their generators are updated so the next scheduled run keeps the new type.string, leading-dot entries (250 of 322 inmicrosoft) never match. Entries cut down from*.foo.comonly match the apex, andurl/uriattributes never match at all. In practice the Microsoft lists are dead today.hostnamematches subdomains, so entries that would match third-party infrastructure are dropped. These are public suffixes (azurewebsites.net,blob.core.windows.net, …), shared CDN zones (g.akamai.net,hwcdn.net, …) and 22 certificate-authority endpoints. They were dead understringtoo, so no working match is lost.Why
Six domain lists use
"type": "string"but are written forhostnamematching. In MISP core (app/Model/Warninglist.php):string: exact, case-sensitive lookup. Entries are loaded as they are (getFilteredEntries()), with no trimming.hostname: entries are loaded viastrtolower(trim($v, '.')).__evalHostname()takes the host part of the value (so URLs work) and matches it or any parent domain of it.So under
string, entries with a leading dot (.aadrm.com) never match anything. Entries reduced from*.foo.comtofoo.comonly match the apex. Andurl/uriattributes never match a bare host name.tools/generate-google.pyalready notes thatmicrosoftandmicrosoft-win10-connection-endpoints"appear to already be non-functional" for this reason.What changes
stringmicrosoftmicrosoft-win10-connection-endpointsmicrosoft-win11-connection-endpoints*.foointo.foo)microsoft-office365*.foo.comintofoo.com, so subdomains were lostrfc6761test,localhost,invalid,exampleand*.in-addr.arpapublic-ipfs-gatewaysurl/uriinmatching_attributes, which can't match a bare host. Subdomain gateways (<cid>.ipfs.dweb.link) didn't match eitherEntries are stored bare (no leading dot), lowercased and deduplicated, following the
google/trancoprecedent.Entries removed
hostnamealso matches subdomains. That makes two kinds of entry either harmful or useless:Public suffixes, checked against the committed
second-level-tldslist (the PSL). These are dropped from the three Microsoft lists:azurewebsites.net,cloudapp.net,azureedge.net,azure-api.net,azure-mobile.net,akadns.net(microsoft)akamai.net,akamaiedge.net,blob.core.windows.net(win10)blob.core.windows.net(win11)As
hostnameentries they would match names registered by any Azure or Akamai customer, including attacker infrastructure. Understringthey were dead entries anyway, so nothing that works today is lost.public-ipfs-gatewayskeeps its public-suffix entries (dweb.link,cf-ipfs.com,cloudflare-ipfs.com) on purpose. Its category isknown, and "this is served through a public IPFS gateway" is exactly what it should say for<cid>.ipfs.dweb.link.Shared CDN zones in win10 (second commit):
g.akamaiedge.net,b.akamaiedge.net,dscb1.akamaiedge.net,dspb.akamaiedge.net,dspg.akamaiedge.net,g.akamai.net,dscd.akamai.net,dspw65.akamai.net,hwcdn.net,wac.edgecastcdn.net,wac.phicdn.net.They aren't on the PSL, but they serve many non-Microsoft customers, and
hwcdn.netcustomer subdomains can serve arbitrary content. As suffix matches they would suppress warnings far beyond Windows 10 endpoints. Specific hosts on those CDNs are kept, e.g.a122.dscd.akamai.netand the Microsoft-named*.akadns.net,*.nsatc.netand*.footprint.netCNAMEs.Certificate authorities in
microsoft-office365(third commit): 22 CRL/OCSP/AIA endpoints Microsoft publishes, e.g.*.verisign.com,*.entrust.net,*.geotrust.com,crl3.digicert.com,ocsp.globalsign.comandcert.int-x3.letsencrypt.org.As suffix matches they would cover these CAs entirely, for every vendor using them. Microsoft's own endpoints (
crl.microsoft.com,mscrl.microsoft.com,oneocsp.microsoft.com,ocsp.msocsp.com) are kept. The CA domainsgenerate-microsoft.pyalready excluded now live ingenerator.pyasCERTIFICATE_AUTHORITY_DOMAINS, and both generators filter on them.*inside a name:.autodiscover.*.onmicrosoft.com|us,.autodiscover.*.mail.onmicrosoft.com|usandwatson.*.microsoft.com. No list type supports*there, so these never matched. The.comones are covered byonmicrosoft.com.Generators
These are updated so the next scheduled run keeps the new type and shape:
generate-microsoft.py: stores bare entries and skips wildcard/public-suffix candidates. Committed entries are normalised the same way. The CA exclusions now come from the sharedCERTIFICATE_AUTHORITY_DOMAINS.generate-microsoft-win11-endpoints.py:*.foobecomesfoo. Remaining*and public suffixes are dropped. Writeshostname.generate-office365.py: writeshostname. A wildcard now drops every label up to and including the label holding the*, so*-admin.foo.comgivesfoo.cominstead ofadmin.foo.com, which wouldn't match tenant names. Public suffixes and certificate-authority domains are filtered.generate-public-ipfs-gateways.py: writeshostname.generate-rfc6761.py: preserves the committed type; docstring updated.generator.py: newget_public_suffixes()helper andCERTIFICATE_AUTHORITY_DOMAINS.generate-google.py: removed the now-stale remark about the two Microsoft lists.win10has no generator; it was edited directly.Before / after
Computed with a Python port of
Warninglist::checkValue()forstring/hostname:Points for review
generate-microsoft.pyis idempotent on the converted list, and the wildcard and public-suffix cases are skipped or reduced as intended.Checks
jsonschemapasses on all six lists.jq -S .formatting check passes.tools/validate_values.pypasses.🤖 Generated with Claude Code