<div dir="ltr">Thanks, Karsten, for the code review! I decided to take a long weekend so was able to address all of it...<br><br>> Yes, I agree that we should have your script start sending results to<br>> the mailing list.  Want to set that up?  Not sure if your mails will<br>
> bounce until somebody approves your sender address, but I guess we'll<br>> find out.<br><br>Nope, not getting through. Asking for my addresses to be whitelisted....<br><br><a href="https://trac.torproject.org/projects/tor/ticket/9537">https://trac.torproject.org/projects/tor/ticket/9537</a><br>
<br>> 1. Do the authorities voting on BadExit agree about relays they assign<br>> this flag to?  The warning might contain the diff of relay fingerprints<br>> they voted or didn't vote BadExit on.  We'll probably want to rate-limit<br>
> this warning to every 6 or 12 hours.<br><br>Done...<br><br><a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/e6d378a">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/e6d378a</a><br>
<br>Btw, it looks like they presently *are* out of sync...<br><br>NOTICE: Authorities disagree about the BadExit flag for 7E6A3AA70A156167E7AE543E50EF54321EC80AF0 (with flag: Faravahar, without flag: tor26, moria1)<br>NOTICE: Authorities disagree about the BadExit flag for ADF62D3A1305F0B5404D41EEDADA68ECD294FC60 (with flag: Faravahar, without flag: tor26, moria1)<br>
<br>> 2. Do the bandwidth authorities report roughly the same number of<br>> Measured lines, or do these numbers diverge beyond a given threshold<br>> (say, 20%)?  This warning should probably be rate-limited to every 24<br>
> hours, because new bandwidth authorities take some time to measure the<br>> network.<br><br>Also done...<br><br><a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/975b0ae">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/975b0ae</a><br>
<br>> How about we start a new thread on this list discussing only the part<br>> where we're planning to kill the website and move everything to the<br>> status emails?<br><br>Personally I don't see value in forking this thread, but I don't care strongly either.<br>
<br>> ... I still disagree with you about Pepper Jack<br>> being tasty cheese and that I can highly recommend Muenster cheese.<br><br>Blasphemy!!!<br><br>> - Can you add a license to your script?<br><br>Done, opting for 3-clause BSD like DocTor...<br>
<br><a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/93b699f">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/93b699f</a><br><br>> - Your rate-limiting logic seems to work only with full hours (and<br>
> days).  This may lead to unexpected results if two script executions<br>> don't start at the exact minute and second of an hour.  In one case a<br>> message might be suppressed, in another case it might not.  That's why I<br>
> defined all rate-limiting intervals as X:30 hours.  Maybe simply add or<br>> subtract 30 minutes from all intervals just to be sure, or add a minutes<br>> parameter with a default of 30.<br><br>Good catch. Fixed...<br>
<br><a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/ce68dab">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/ce68dab</a><br><br>> - DocTor produces two output files containing warnings, one with new<br>
> warnings and one with all warnings (which is empty if there are zero new<br>> warnings).  New warnings are sent to the IRC bot and all warnings are<br>> sent to the mailing list.  I agree that this approach is somewhat<br>
> complicated, so maybe it's sufficient to just send the new warnings to<br>> both the IRC bot and the mailing list.  Unless you didn't realize there<br>> was such a distinction and think it's worth adding to your script.  Up<br>
> to you.<br><br>I've ignored the IRC bot notifications since I'm both unfamiliar with it and presently lack a mechanism to provide it with notifications.<br><br>I take it as if the bot periodically reads files from disk then dumps the contents into an IRC channel? Who maintains the bot and might we switch it to another notification mechanism? Maybe it should read tor-consensus-health@ instead?<br>
<br>Alternatively I can change my send() function to do whatever the bot maintainer wants, though dumping files to disk seems a bit odd to me.<br><br>> - Are old warnings ever removed from your last_notified.cfg?  Not sure<br>
> if it matters though.<br><br>Nope. When the suppression expires and the issue goes into alarm again it replaces the value.<br><br>> - Is the %is in `<a href="http://log.info">log.info</a>("Suppressing %s, time remaining is %is"`<br>
> supposed to be a %s?<br><br>Nope. It's logging an integer value with an extra 's' for seconds (ex, "45s"). Logging seconds here is pretty less-than-useful so swapped it to hours.<br><br>> - Your rule about not downloading a vote from an authority that didn't<br>
> provide a consensus before seems quite strict.  In theory, we could ask<br>> another authority for that first authority's vote.  Maybe the first<br>> authority just didn't want to talk to us but was happy to talk to all<br>
> other authorities.  We should probably learn about problems with that<br>> authority's vote (or the absence of problems) even if it doesn't talk to<br>> us.  I'm aware that this will make the download logic somewhat more complex.<br>
<br>Actually, this makes it a little cleaner. The 'only download vote if we got a consensus' thing was to avoid redundant notices when an authority goes down (ie. both "unable to download consensus from X" and "unable to download vote from X"). With this fallback logic I don't really need to do this...<br>
<br><a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/5e200e9">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/5e200e9</a><br><br>... on a side note think I'll move the authority fingerprint and v3ident into stem later. Other scripts will likely want them too.<br>
<br>> - Typo in `unknown_consensus_parameteres`.<br>> - Typo in `incompatable_authorities`.<br><br>Nice catches. Fixed.<br><br>> - In `certificate_expiration`, is your check that a vote has exactly<br>> one authority really necessary?  Wouldn't stem complain if this were not<br>
> the case?<br><br>Nope, when reading the dir-spec it didn't cross my mind to assert that about votes. Now that you mention it though I agree that this belongs in stem - done...<br><br><a href="https://gitweb.torproject.org/stem.git/commitdiff/4863c22">https://gitweb.torproject.org/stem.git/commitdiff/4863c22</a><br>
<a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/9fab9f8">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/9fab9f8</a><br><br>> - Speaking of stem complaining about invalid votes or consensuses: what<br>
> does your script do in such a case?<br><br>Invalid documents are treated in a similar fashion to failing to be download, except that they state the validation issue.<br><br>> - I wonder if your check in `has_expected_fingerprints` would complain<br>
> if somebody set up a fake "moria1".  It probably shouldn't.  That's why<br>> I added IP address and port to checkAuthorityRelayIdentityKeys.<br><br>Ahhh, I was wondering why DocTor did that. Good point, addressing this by also looking for the Named flag.<br>
<br>> - Maybe I missed them while reading your code, but did you add checks<br>> for checkContainedVotes and checkConsensusSignatures?  Both checks are<br>> quite important, because even if an authority claims to add a vote, it<br>
> may not have become part of the consensus, or the authority may not have<br>> signed the consensus that it contributed a vote to before.<br><br>Huh, wonder how I missed those. Added...<br><br><a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/0982060">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/0982060</a><br>
<a href="https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/c97d71e">https://gitweb.torproject.org/atagar/tor-utils.git/commitdiff/c97d71e</a><br><br>Cheers! -Damian<br><br><div class="gmail_extra">PS. A couple other things that need to be addressed at some point are:<br>
<br></div><div class="gmail_extra">* Running this on a TPO host rather than my desktop, and maybe also use a TPO address to send the emails too.<br></div><div class="gmail_extra">* Moving these scripts to a real repository rather than my 'tor-utils' user repo. Not sure though if we should keep the name 'DocTor' or opt for something more descriptive like 'DescriptorMonitors'.<br>
</div></div>