Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Nov 29, 2023
1 parent b86a6c5 commit 8bbb0fa
Show file tree
Hide file tree
Showing 69 changed files with 5,784 additions and 518 deletions.
44 changes: 38 additions & 6 deletions internal/cmd/minipipeline/testdata/observations.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"DNSLookupFailure": "dns_no_answer",
"DNSQueryType": "AAAA",
"DNSEngine": "udp",
"DNSResolvedAddrs": null,
"IPAddress": null,
"IPAddressASN": null,
"IPAddressBogon": null,
Expand All @@ -29,6 +30,9 @@
"TagFetchBody": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -45,6 +49,7 @@
"DNSLookupFailure": "dns_no_answer",
"DNSQueryType": "AAAA",
"DNSEngine": "doh",
"DNSResolvedAddrs": null,
"IPAddress": null,
"IPAddressASN": null,
"IPAddressBogon": null,
Expand All @@ -68,6 +73,9 @@
"TagFetchBody": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -86,6 +94,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "A",
"DNSEngine": "udp",
"DNSResolvedAddrs": [
"130.192.16.171"
],
"IPAddress": "130.192.16.171",
"IPAddressASN": 137,
"IPAddressBogon": false,
Expand All @@ -107,8 +118,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": null,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -125,6 +139,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "ANY",
"DNSEngine": "getaddrinfo",
"DNSResolvedAddrs": [
"130.192.16.171"
],
"IPAddress": "130.192.16.171",
"IPAddressASN": 137,
"IPAddressBogon": false,
Expand All @@ -146,8 +163,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": null,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -164,6 +184,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "A",
"DNSEngine": "doh",
"DNSResolvedAddrs": [
"130.192.16.171"
],
"IPAddress": "130.192.16.171",
"IPAddressASN": 137,
"IPAddressBogon": false,
Expand All @@ -185,8 +208,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": null,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -205,6 +231,9 @@
"DNSLookupFailure": "",
"DNSQueryType": null,
"DNSEngine": null,
"DNSResolvedAddrs": [
"130.192.16.171"
],
"IPAddress": "130.192.16.171",
"IPAddressASN": 137,
"IPAddressBogon": false,
Expand Down Expand Up @@ -243,6 +272,9 @@
"TagFetchBody": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": "",
"MatchWithControlIPAddress": true,
"MatchWithControlIPAddressASN": true,
Expand Down
16 changes: 14 additions & 2 deletions internal/cmd/minipipeline/testdata/observations_classic.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "ANY",
"DNSEngine": "getaddrinfo",
"DNSResolvedAddrs": [
"130.192.16.171"
],
"IPAddress": "130.192.16.171",
"IPAddressASN": 137,
"IPAddressBogon": false,
Expand All @@ -28,8 +31,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": null,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -48,6 +54,9 @@
"DNSLookupFailure": "",
"DNSQueryType": null,
"DNSEngine": null,
"DNSResolvedAddrs": [
"130.192.16.171"
],
"IPAddress": "130.192.16.171",
"IPAddressASN": 137,
"IPAddressBogon": false,
Expand Down Expand Up @@ -86,6 +95,9 @@
"TagFetchBody": null,
"ControlDNSDomain": "nexa.polito.it",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"130.192.16.171"
],
"ControlTCPConnectFailure": "",
"MatchWithControlIPAddress": true,
"MatchWithControlIPAddressASN": true,
Expand Down
8 changes: 7 additions & 1 deletion internal/minipipeline/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ func (c *WebObservationsContainer) controlMatchDNSLookupResults(inputDomain stri
// handle the case in which the IP address has been provided by the control, which
// is a case where the domain is empty and the IP address is in thAddrMap
if domain == "" && thAddrMap[addr] {
obs.ControlDNSDomain = optional.Some(inputDomain)
obs.ControlDNSLookupFailure = optional.Some(utilsStringPointerToString(resp.DNS.Failure))
obs.ControlDNSResolvedAddrs = optional.Some(NewSet(resp.DNS.Addrs...))
obs.MatchWithControlIPAddress = optional.Some(true)
obs.MatchWithControlIPAddressASN = optional.Some(true)
continue
Expand All @@ -496,14 +499,17 @@ func (c *WebObservationsContainer) controlMatchDNSLookupResults(inputDomain stri
}

// register the control DNS domain
obs.ControlDNSDomain = optional.Some(domain)
obs.ControlDNSDomain = optional.Some(inputDomain)

// register whether the control failed and skip in such a case
obs.ControlDNSLookupFailure = optional.Some(utilsStringPointerToString(resp.DNS.Failure))
if resp.DNS.Failure != nil {
continue
}

// register the resolved IP addresses
obs.ControlDNSResolvedAddrs = optional.Some(NewSet(resp.DNS.Addrs...))

// compute whether also the TH observed this addr
obs.MatchWithControlIPAddress = optional.Some(thAddrMap[addr])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"DNSLookupFailure": "dns_no_answer",
"DNSQueryType": "AAAA",
"DNSEngine": "udp",
"DNSResolvedAddrs": null,
"IPAddress": null,
"IPAddressASN": null,
"IPAddressBogon": null,
Expand All @@ -29,6 +30,9 @@
"TagFetchBody": null,
"ControlDNSDomain": "expired.badssl.com",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"104.154.89.105"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -47,6 +51,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "ANY",
"DNSEngine": "getaddrinfo",
"DNSResolvedAddrs": [
"104.154.89.105"
],
"IPAddress": "104.154.89.105",
"IPAddressASN": 396982,
"IPAddressBogon": false,
Expand All @@ -68,8 +75,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": 0,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "expired.badssl.com",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"104.154.89.105"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -86,6 +96,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "A",
"DNSEngine": "udp",
"DNSResolvedAddrs": [
"104.154.89.105"
],
"IPAddress": "104.154.89.105",
"IPAddressASN": 396982,
"IPAddressBogon": false,
Expand All @@ -107,8 +120,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": 0,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "expired.badssl.com",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"104.154.89.105"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -127,6 +143,9 @@
"DNSLookupFailure": "",
"DNSQueryType": null,
"DNSEngine": null,
"DNSResolvedAddrs": [
"104.154.89.105"
],
"IPAddress": "104.154.89.105",
"IPAddressASN": 396982,
"IPAddressBogon": false,
Expand All @@ -150,6 +169,9 @@
"TagFetchBody": true,
"ControlDNSDomain": "expired.badssl.com",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"104.154.89.105"
],
"ControlTCPConnectFailure": "",
"MatchWithControlIPAddress": true,
"MatchWithControlIPAddressASN": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"DNSLookupFailure": "",
"DNSQueryType": "ANY",
"DNSEngine": "getaddrinfo",
"DNSResolvedAddrs": [
"104.154.89.105"
],
"IPAddress": "104.154.89.105",
"IPAddressASN": 396982,
"IPAddressBogon": false,
Expand All @@ -28,8 +31,11 @@
"HTTPResponseIsFinal": null,
"TagDepth": 0,
"TagFetchBody": null,
"ControlDNSDomain": null,
"ControlDNSLookupFailure": null,
"ControlDNSDomain": "expired.badssl.com",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"104.154.89.105"
],
"ControlTCPConnectFailure": null,
"MatchWithControlIPAddress": null,
"MatchWithControlIPAddressASN": null,
Expand All @@ -48,6 +54,9 @@
"DNSLookupFailure": "",
"DNSQueryType": null,
"DNSEngine": null,
"DNSResolvedAddrs": [
"104.154.89.105"
],
"IPAddress": "104.154.89.105",
"IPAddressASN": 396982,
"IPAddressBogon": false,
Expand All @@ -71,6 +80,9 @@
"TagFetchBody": true,
"ControlDNSDomain": "expired.badssl.com",
"ControlDNSLookupFailure": "",
"ControlDNSResolvedAddrs": [
"104.154.89.105"
],
"ControlTCPConnectFailure": "",
"MatchWithControlIPAddress": true,
"MatchWithControlIPAddressASN": true,
Expand Down
Loading

0 comments on commit 8bbb0fa

Please sign in to comment.