Package: tlscanary
TLS CanaryStatus : ArchivedThis project is no longer maintained and has been archived. No further work will
be done on it including security fixes. Feel free to fork the project if you'd
like to extend it.DescriptionTLS Canary was aTLS/SSLtesting framework for theMozilla Firefoxweb browser. It was used by developers to run regression and
performance tests against a large number of HTTPS-enabled hosts on the Internet.This projectDownloads a test build and a base build of Firefox for comparison.Automatically queries thousands of secure sites with those builds.Diffs the results and presents potential regressions in an report for further diagnosis.Does performance regression testing.Extracts SSL state information.Can also use local Firefox build trees or package files for testing.Can maintain an updated list of HTTPS-enabled top sites.Requires a highly reliable network link.WiFi will give unstable results.RequirementsPython 3.6+7zipGo 1.7 or laterRust 1.39 or laterOpenSSL-devlibffi-devDependencies for Debian and Ubuntu usersAssuming that you run TLS Canary on a regular graphical desktop machine, these are the packages it requires:sudo apt-get install python3 python3-dev gcc golang-1.9-go p7zip-full libssl-dev libffi-dev libx11-xcb-devIn addition, you'll need to install the Rust Cargo toolchain:curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shThe scriptlinux_bootstrap.shprovides bootstrapping for a headless Ubuntu-based EC2
instance which requires installation of a few standard GUI libraries for running Firefox.
The script may or may not work for your other favourite Debian-based distribution.Dependencies for Mac usersAssuming that your're usingHomebrewfor package management, this should set you up:brew install openssl libffi python p7zip goThe scriptosx_bootstrap.shprovides bootstrapping for Travis CI's Mac OS X instances
using homebrew for package management. It may work for your OS X desktop environment as well.Dependencies for Windows usersWindows support targetsPowerShell 5.1onWindows 10. Windows 7 and 8 are generally able to run TLS Canary,
but expect minor unicode encoding issues in terminal logging output.First,install Chocolatey, then run the following command in an admin PowerShell
to install the dependencies:choco install 7zip.commandline git golang openssh python3For end usersTLS Canary can be installed as a stable package from PyPI and as experimental package directly from GitHub.
The following command will install the latest stable release of TLS Canary to your current Python environment:pip3 install [--user] --upgrade tlscanaryWhether or not you require the--userflag depends on how your Python environment is set up. Most Linux distributions
require it when not installing Python packages as root.Once it finishes thetlscanarybinary is available in your Python environment:tlscanary --help
tlscanary regression --help
tlscanary log --helpUsage examples# Run a quick regression test against the first 50000 hosts in the default `top` databasetlscanaryregression-l50000# Compile a fresh 'top 1000' host database called `mini`tlscanarysrcupdate-smini-l1000-x1# Show a list of available host databasestlscanarysrcupdate-slist# Use your fresh `mini` database for a quick regession test and see lots of things happeningtlscanary--debugregression-sminiPlease refer to the complete argument and mode references below.Run log and reportingTLS Canary collects all run log data in~/.tlscanary/log. The format is somewhat JSONny, but heavily compressed
to save disk space. Canary logs can get very big very fast when a run returns many results.Here are some usage examples how to interact with TLS Canary's run log database:# List all logs in database, including incomplete ones marked with (*)tlscanarylog# List and then delete incomplete logstlscanarylog-iincomplete
tlscanarylog-iincomplete-adelete# just a dry-runtlscanarylog-iincomplete-adelete--really# Print complete regression logs as JSON array to terminaltlscanarylog-iregression-eincomplete-ajson# Print JSON report of the last two runs to terminaltlscanarylog-i2-ajson# Create an HTML report in /tmp/report for completed regression runstlscanarylog-iregression-eincomplete-ahtmlreport-o/tmp/reportCanary run modesRun modes are specified via the mandatory positionalmodeparameter. Seetlscanary <mode> --helpfor mode-specific
arguments.ModeDescriptionlogPerforms various actions on run logs collected by performance, regression, and scan runs. Seetlscanary log --help.performanceRuns a performance analysis against the hosts in the test set. Use--scansto specify how often each host is tested.regressionRuns a TLS regression test, comparing the 'test' candidate against the 'baseline' candidate. Only reports errors that are new to the test candidate. No error generated by baseline can make it to the report.scanThis mode only collects connection state information for every host in the test set.srcupdateCompile a fresh set of TLS-enabled 'top' sites from theUmbrella Top 1Mlist. Use-lto override the default target size of 500k hosts. Use-xto adjust the number of passes for errors. Use-x1for a factor two speed improvement with slightly less stable results. Use-bto change the Firefox version used for filtering. You can use-sto create a new database, but you can't make it the default. Databases are written to~/.tlscanary/sources/.Command line arguments for test runsThe run modesperformance,regression, andscanshare a common set command line arguments:ArgumentChoices /defaultDescription-b --baserelease, nightly, beta, aurora, esr,build tree,package fileBaseline test candidate to test against. Only used by comparative test modes.-c --cachefalseEnable content caching in profiles-d --debugEnable verbose debug logging to the terminal-f --filter0,1The default filter level 1 removes network timeouts from reports which may appear spuriously. Filter level 0 applies no filtering.-h --helpLonger usage information-j --parallel4Number of parallel firefox worker instances the host set will be distributed among-l --limit100000The number of hosts in the test set is limited to the given number. Default is 100000 hosts. You can increase the limit, but such runs will require LOTS of memory (90 GBytes and more) and can cause instability.-m --timeout10Request timeout in seconds. Running more requests in parallel increases network latency and results in more timeouts.-n --requestsperworker50Chunk size of hosts that a worker will query in parallel.-o --onecrlproduction, stage, customOneCRL revocation list to install to the test profiles.customuses a pre-configured, static list.-s --sourcetop, list, ...Set of hosts to run the test against. Passlistto get info on available test sets.-t --testrelease,nightly, beta, aurora, esr,build tree,package fileSpecify the main test candidate. Used by every run mode.-u --max_timeout20Maximum request timeout in seconds. Each scan increases the timeout, up to this value-w --workdir~/.tlscanaryDirectory where cached files and other state is stored-x --scans3Number of scans to run against each host during performance or regression mode.MODEperformance, regression, scan, srcupdateTest mode to run, given as positional parameter. This is a mandatory argument.For developersFor development you will additionally need to install:gitvirtualenv (highly recommended)gitcan be installed with your favourite package manager.virtualenvcomes with a simplepip install [--user] virtualenv.Developing on Linux or MacThese are the commands that set you up for TLS Canary development work:git clone https://github.com/mozilla/tls-canary
cd tls-canary
virtualenv -p python3 venv
source venv/bin/activate
pip install -e .[dev]The latter command should be used regularly to install new Python dependencies that a TLS Canary update might require.Developing on WindowsDeveloping TLS Canary on Windows is not something we practice regularly. If you encounter quirks along the way,
please do not hesitate to open an issue here on GitHub. The following commands, executed in a PowerShell session
with user privileges, should set you up for TLS Canary development:git clone https://github.com/mozilla/tls-canary
cd tls-canary
virtualenv -p c:\python36\python.exe venv
venv\Scripts\activate
pip install -e .[dev]Building and running tls-canarypython setup.py build
python setup.py installRunning testsThere are two ways to run the test suite:python setup.py test
nosetests -vThey are largely equivalent, but the former takes care of missing test dependencies, while runningnosetestsdirectly offers more control. To get test coverage, for example, usenosetests -v --with-coverage --cover-erase --cover-package=tlscanaryInstalling the pre-commit hook for gitThere's a pre-commit hook for git that you can use for automatedPEP 8violations checking. You can install it by runningln -sf ../../hooks/pre-commit .git/hooks/in the top-level project directory. By using a symbolic link, you will automatically get updates once the hook
in the repo changes. This is highly recommended. You can also copy the script manually, but then you have to
take care of updates yourself.