iclab / centinel

http://iclab.org/
MIT License
34 stars 17 forks source link

TLS produces tracebacks constantly #161

Closed jakubd closed 9 years ago

jakubd commented 9 years ago

The TLS certificate requests experiment constantly produces constant traceback output when you run centinel-dev. I think this is related to the fact that not all the TLS requests go through (ie name doesn't resolve, connection doesn't connect cleanly etc) which is expected in an experiment but I don't think we should output tracebacks to the users if this functionality is expected.

This is a dump of what I am talking about:

vagrant@precise32:~$ sudo centinel-dev
2015-08-04 15:15:08,430: INFO: Centinel started.
2015-08-04 15:15:08,432: INFO: Getting metadata for experiment...
2015-08-04 15:15:11,609: INFO: Running baseline...
2015-08-04 15:15:21,611: INFO: tcpdump started...
2015-08-04 15:15:23,616: INFO: Testing input file world.csv...
2015-08-04 15:15:23,628: INFO: Running HTTP GET requests...
2015-08-04 15:39:34,198: INFO: HTTP GET requests took 1450 seconds for
500 URLs.
2015-08-04 15:39:34,199: INFO: Running TLS certificate requests...
2015-08-04 15:39:34,199: INFO: TLS certificate requests took 0 seconds
for 0 domains.
2015-08-04 15:39:34,200: INFO: Running DNS requests...
2015-08-04 15:41:35,456: INFO: DNS requests took 121 seconds for 500
domains.
2015-08-04 15:41:35,457: INFO: Running TCP traceroutes...
2015-08-04 15:44:48,126: INFO: Traceroutes took 192 seconds for 500 domains.
2015-08-04 15:44:48,128: INFO: Running UDP traceroutes...
2015-08-04 15:48:03,760: INFO: Traceroutes took 195 seconds for 500 domains.
2015-08-04 15:48:03,764: INFO: Testing took a total of 1960 seconds.
2015-08-04 15:48:03,765: INFO: Testing input file country.csv...
2015-08-04 15:48:03,774: INFO: Running HTTP GET requests...
2015-08-04 15:55:37,993: INFO: HTTP GET requests took 454 seconds for
397 URLs.
2015-08-04 15:55:37,994: INFO: Running TLS certificate requests...
Exception in thread Thread-3899:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3900:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3901:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3902:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3904:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3905:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3906:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3907:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3909:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3911:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3912:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3913:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3914:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3915:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -2] Name or service not known

Exception in thread Thread-3910:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
gaierror: [Errno -3] Temporary failure in name resolution

Exception in thread Thread-3908:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/centinel/primitives/tls.py",
line 48, in get_fingerprint
    raise exception
error: [Errno 110] Connection timed out

2015-08-04 15:56:46,846: INFO: TLS certificate requests took 68 seconds
for 17 domains.
2015-08-04 15:56:46,847: INFO: Running DNS requests...
2015-08-04 15:58:25,679: INFO: DNS requests took 98 seconds for 397 domains.
2015-08-04 15:58:25,680: INFO: Running TCP traceroutes...
2015-08-04 16:01:05,037: INFO: Traceroutes took 159 seconds for 397 domains.
2015-08-04 16:01:05,040: INFO: Running UDP traceroutes...
2015-08-04 16:03:46,905: INFO: Traceroutes took 161 seconds for 397 domains.
2015-08-04 16:03:46,909: INFO: Testing took a total of 943 seconds.
2015-08-04 16:03:46,910: INFO: Waiting for tcpdump to process packets...
2015-08-04 16:03:51,915: INFO: tcpdump stopped.
2015-08-04 16:03:51,916: INFO: Saved pcap to
/root/.centinel/results/pcap_baseline-2015-08-04T15:15:11.610007.pcap.bz2.
2015-08-04 16:03:51,917: INFO: baseline took 0:48:40.307117 to finish.
2015-08-04 16:04:03,732: INFO: Finished running experiments. Look in
/root/.centinel/results for results.
vagrant@precise32:~$

In the above example, everything runs fine but the tracebacks give the impression that the test doesn't work and I would forgive someone for Ctrl-C'ing out of the test assuming something went wrong. Maybe a better approach would be to summarize the output into a debug log and not output to standard out?

rpanah commented 9 years ago

This means that name resolution has failed (maybe the domain name isn't registered anymore).

jakubd commented 9 years ago

I get that-- but why output the tracebacks to the user if this is expected in a test? It gives the impression that something is broken. When an HTTP GET 404's we don't output that to the user in a traceback, why is this done in the TLS test?

rpanah commented 9 years ago

Raising the exception is not necessary in this case since the textual representation is already recorded in the results file. I'm removing the part that raises the exception. This makes the output cleaner.