-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(webconnectivitylte): handle measurements with loopback addrs (#1462)
This diff modifies webconnectivitylte and related packages to correctly handle measurements containing loopback addresses. There are two cases: (a) when both the probe and the TH only see loopback addresses at least for the getaddrinfo lookups; (b) when only the probe sees loopback addresses at least for the getaddrinfo lookups. In the former case, we should mark the website as "down" (maybe a little bit of a stretch, but if we mark down a website where the TLS is misconfigured, arguably we can do the same when DNS is misconfigured). In the latter case, we mark the measurement as censorship, since seeing a loopback address is not what we expect. Closes ooni/probe#1517.
- Loading branch information
1 parent
5371908
commit 9a75677
Showing
28 changed files
with
5,230 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package webconnectivityqa | ||
|
||
import "github.com/ooni/probe-cli/v3/internal/netemx" | ||
|
||
// localhostWithHTTP is the case where the website DNS is misconfigured and returns a loopback address. | ||
func localhostWithHTTP() *TestCase { | ||
return &TestCase{ | ||
Name: "localhostWithHTTP", | ||
Flags: TestCaseFlagNoV04, | ||
Input: "http://www.example.com/", | ||
Configure: func(env *netemx.QAEnv) { | ||
|
||
// make sure all resolvers think the correct answer is localhost | ||
env.ISPResolverConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
env.OtherResolversConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
|
||
}, | ||
ExpectErr: false, | ||
ExpectTestKeys: &testKeys{ | ||
DNSConsistency: "consistent", | ||
XDNSFlags: 1, // AnalysisFlagDNSBogon | ||
Accessible: false, | ||
Blocking: false, | ||
}, | ||
} | ||
} | ||
|
||
// localhostWithHTTPS is the case where the website DNS is misconfigured and returns a loopback address. | ||
func localhostWithHTTPS() *TestCase { | ||
return &TestCase{ | ||
Name: "localhostWithHTTPS", | ||
Flags: TestCaseFlagNoV04, | ||
Input: "https://www.example.com/", | ||
Configure: func(env *netemx.QAEnv) { | ||
|
||
// make sure all resolvers think the correct answer is localhost | ||
env.ISPResolverConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
env.OtherResolversConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
|
||
}, | ||
ExpectErr: false, | ||
ExpectTestKeys: &testKeys{ | ||
DNSConsistency: "consistent", | ||
XDNSFlags: 1, // AnalysisFlagDNSBogon | ||
Accessible: false, | ||
Blocking: false, | ||
}, | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.