mozilla/Garmr — Issue #1: Passive tests are executed multiple times
Author: davehunt
Created: 2012-02-24 07:54:06+00:00
State: open

Perhaps I'm misunderstanding something, but it appears that the passive tests are being executed after every successful active test. This seems to cause issues where the response is empty. See the following output:

garmr dhunt$ garmr -o results.xml -e Http200Check -e StrictTransportSecurityPresent -u https://addons-dev.allizom.org
2012-02-23 23:51:38,029 DEBUG Scanner initialized.
2012-02-23 23:51:38,371 DEBUG [target]: https://addons-dev.allizom.org
2012-02-23 23:51:38,371 DEBUG Added Garmr.corechecks.Http200Check to active tests.
2012-02-23 23:51:38,371 DEBUG Added Garmr.corechecks.WebTouch to active tests.
2012-02-23 23:51:38,371 DEBUG Added Garmr.corechecks.StrictTransportSecurityPresent to passive tests.
2012-02-23 23:51:38,371 DEBUG Added Garmr.corechecks.XFrameOptionsPresent to passive tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.StsRedirectCheck to active tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.HttpOnlyAttributePresent to passive tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.SecureAttributePresent to passive tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.HttpsLoginForm to passive tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.HttpsResourceOnHttpsLink to passive tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.InlineJS to passive tests.
2012-02-23 23:51:38,372 DEBUG Added Garmr.corechecks.CSPHeaderCheck to active tests.
2012-02-23 23:51:38,372 DEBUG	Http200Check disabled.
2012-02-23 23:51:38,372 DEBUG	StrictTransportSecurityPresent disabled.
2012-02-23 23:51:38,372 INFO [https://addons-dev.allizom.org] scanning:
2012-02-23 23:51:38,373 INFO	[Skip] [Garmr.corechecks.Http200Check] (reason: disabled)
2012-02-23 23:51:38,896 INFO	[Garmr.corechecks.WebTouch] Pass The request returned an HTTP 200 response.
2012-02-23 23:51:38,896 INFO	[Garmr.corechecks.StrictTransportSecurityPresent] Pass Strict-Transport-Security header present.
2012-02-23 23:51:38,897 INFO	[Garmr.corechecks.XFrameOptionsPresent] Pass X-Frame-Options header present.
2012-02-23 23:51:38,897 INFO	[Garmr.corechecks.HttpOnlyAttributePresent] Skip No cookie is set by this response.
2012-02-23 23:51:38,897 INFO	[Garmr.corechecks.SecureAttributePresent] Skip No cookie is set by this response.
2012-02-23 23:51:40,262 INFO	[Garmr.corechecks.HttpsLoginForm] Skip There are no login forms on this page
2012-02-23 23:51:41,832 INFO	[Garmr.corechecks.HttpsResourceOnHttpsLink] Pass All external resources are https
2012-02-23 23:51:43,105 INFO	[Garmr.corechecks.InlineJS] Pass No inline JavaScript found
2012-02-23 23:51:43,105 INFO	[Skip] [Garmr.corechecks.StsRedirectCheck] (reason: insecure_only)
2012-02-23 23:51:43,260 INFO	[Garmr.corechecks.CSPHeaderCheck] Pass CSP Header present and points to a policy file
2012-02-23 23:51:43,260 INFO	[Garmr.corechecks.StrictTransportSecurityPresent] Pass Strict-Transport-Security header present.
2012-02-23 23:51:43,260 INFO	[Garmr.corechecks.XFrameOptionsPresent] Pass X-Frame-Options header present.
2012-02-23 23:51:43,260 INFO	[Garmr.corechecks.HttpOnlyAttributePresent] Skip No cookie is set by this response.
2012-02-23 23:51:43,260 INFO	[Garmr.corechecks.SecureAttributePresent] Skip No cookie is set by this response.
2012-02-23 23:51:43,262 ERROR Traceback (most recent call last):
File "build/bdist.macosx-10.7-intel/egg/Garmr/scanner.py", line 227, in run_scan
results[target] = self.scan_target(target)
File "build/bdist.macosx-10.7-intel/egg/Garmr/scanner.py", line 206, in scan_target
self.results[testclass] = self.do_active_scan(testclass, is_ssl, target)
File "build/bdist.macosx-10.7-intel/egg/Garmr/scanner.py", line 189, in do_active_scan
result["passive"][passive_testclass] = self.do_passive_scan(passive_testclass, is_ssl, response)
File "build/bdist.macosx-10.7-intel/egg/Garmr/scanner.py", line 135, in do_passive_scan
passive_result = passive.analyze(response)
File "build/bdist.macosx-10.7-intel/egg/Garmr/scanner.py", line 96, in analyze
soup = BeautifulSoup(response.content)
File "/Users/dhunt/.virtualenvs/95f0fbad3a5e9852/lib/python2.7/site-packages/BeautifulSoup.py", line 1522, in __init__
BeautifulStoneSoup.__init__(self, *args, **kwargs)
File "/Users/dhunt/.virtualenvs/95f0fbad3a5e9852/lib/python2.7/site-packages/BeautifulSoup.py", line 1147, in __init__
self._feed(isHTML=isHTML)
File "/Users/dhunt/.virtualenvs/95f0fbad3a5e9852/lib/python2.7/site-packages/BeautifulSoup.py", line 1171, in _feed
smartQuotesTo=self.smartQuotesTo, isHTML=isHTML)
File "/Users/dhunt/.virtualenvs/95f0fbad3a5e9852/lib/python2.7/site-packages/BeautifulSoup.py", line 1773, in __init__
self._detectEncoding(markup, isHTML)
File "/Users/dhunt/.virtualenvs/95f0fbad3a5e9852/lib/python2.7/site-packages/BeautifulSoup.py", line 1918, in _detectEncoding
'^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(xml_data)
TypeError: expected string or buffer