<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Exotic Security</title><link href="https://xo.tc/" rel="alternate"></link><link href="https://xo.tc/feeds/all.atom.xml" rel="self"></link><id>https://xo.tc/</id><updated>2021-08-05T08:00:00+08:00</updated><entry><title>Migrating to GitHub Pages</title><link href="https://xo.tc/migrating-to-github-pages.html" rel="alternate"></link><published>2021-08-05T08:00:00+08:00</published><updated>2021-08-05T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2021-08-05:/migrating-to-github-pages.html</id><summary type="html">&lt;p&gt;Over the last few years I have not been updating this blog, it's for all the usual reasons to do with time and commitments. Along with that, I'd gotten pretty lax about patching the server it was running on. It had Debian &lt;a href="https://xo.tc/automatic-updates-for-debian.html"&gt;unattended upgrades&lt;/a&gt; switched on, but really I should …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Over the last few years I have not been updating this blog, it's for all the usual reasons to do with time and commitments. Along with that, I'd gotten pretty lax about patching the server it was running on. It had Debian &lt;a href="https://xo.tc/automatic-updates-for-debian.html"&gt;unattended upgrades&lt;/a&gt; switched on, but really I should have been taking more care of it. &lt;/p&gt;
&lt;p&gt;I think it's irresponsible to leave an unmaintained server running on the internet and so over the last weekend I've migrated everything to &lt;a href="https://pages.github.com/"&gt;GitHub Pages&lt;/a&gt;. I've been using &lt;a href="https://blog.getpelican.com/"&gt;Pelican&lt;/a&gt; to generate HTML from markdown for the site so uploading that into a git repo was pretty seamless.&lt;/p&gt;
&lt;p&gt;It does mean I can't run this site &lt;a href="https://xo.tc/alternative-networks-for-this-site-tor.html"&gt;as a .onion site&lt;/a&gt; any more, that was a fun experiment while it lasted but again it's not something that I was activity maintaining.&lt;/p&gt;</content><category term="Posts"></category><category term="Hosting"></category><category term="GitHub"></category></entry><entry><title>How to mount a VHD file on linux</title><link href="https://xo.tc/how-to-mount-a-vhd-file-on-linux.html" rel="alternate"></link><published>2018-11-15T08:00:00+08:00</published><updated>2018-11-15T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-11-15:/how-to-mount-a-vhd-file-on-linux.html</id><summary type="html">&lt;h2 id="how-to-do-it"&gt;How to do it&lt;/h2&gt;
&lt;p&gt;Install &lt;a href="http://libguestfs.org/"&gt;libguestfs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;Debian and Ubuntu&lt;/strong&gt; this is pretty easy&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;libguestfs&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For &lt;strong&gt;Red Hat, Centos, Fedora&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;yum&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;libguestfs&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For &lt;strong&gt;Arch Linux&lt;/strong&gt; (my distro of choice) you need to install 3 packages from the AUR&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://aur …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;h2 id="how-to-do-it"&gt;How to do it&lt;/h2&gt;
&lt;p&gt;Install &lt;a href="http://libguestfs.org/"&gt;libguestfs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;Debian and Ubuntu&lt;/strong&gt; this is pretty easy&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;libguestfs&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For &lt;strong&gt;Red Hat, Centos, Fedora&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;yum&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;libguestfs&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For &lt;strong&gt;Arch Linux&lt;/strong&gt; (my distro of choice) you need to install 3 packages from the AUR&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://aur.archlinux.org/hivex.git
git clone https://aur.archlinux.org/perl-sys-virt.git
git clone https://aur.archlinux.org/libguestfs.git

cd hivex
makepkg -si
cd ../perl-sys-virt
makepkg -si
cd ../libguestfs
makepkg -si
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once you have libguestfs as a normal user (not root / sudo) run guestmount&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;guestmount --add old_server_backup.vhd --ro /mnt/vhd/ -m /dev/sda1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--add&lt;/code&gt; option is for the image you want to access&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--ro&lt;/code&gt; sets to read only, alternatively you could use &lt;code&gt;--rw&lt;/code&gt; for read / write&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/mnt/vhd&lt;/code&gt; the path where you want to mount the drive&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-m /dev/sda1&lt;/code&gt; specify which partition within the .vhd file you want to mount.  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enjoy :-)&lt;/p&gt;
&lt;h2 id="my-rant"&gt;My Rant&lt;/h2&gt;
&lt;p&gt;So I recently had to mount a backup of an old VM that was saved as a .vhd file and so I googled "How to mount a VHD on Linux" and the first result that came up was a Ubuntu forumns post where someone had asked the question and the top reply was someone else telling that person to go off and use a search engine. Followed by a link to Stack Overflow which didn't actually answer the question.&lt;/p&gt;
&lt;p&gt;Some support forums and Stack Overflow in particular can be quite toxic to new comers (and even toxic to experienced veterans) and it's very infuriating when the top result on google is someone being told to just search google for the answer.&lt;/p&gt;
&lt;p&gt;I know it can be annoying when simple questions come up over an over again but at the very least try to link to a useful article and if possible quote the relevant bit.&lt;/p&gt;
&lt;p&gt;Anyway I hope my instructions saved someone the frustration that I went through.&lt;/p&gt;</content><category term="Posts"></category><category term="Linux"></category><category term="How to"></category><category term="VHD"></category></entry><entry><title>Wordfence reivew</title><link href="https://xo.tc/wordfence-reivew.html" rel="alternate"></link><published>2018-11-08T08:00:00+08:00</published><updated>2018-11-08T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-11-08:/wordfence-reivew.html</id><summary type="html">&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; I tried the free version, I like it.&lt;/p&gt;
&lt;p&gt;Amongst other things I do in my day job, I administer a WordPress site. We had a security audit and one of the findings was that our site was misconfigured to show a different failure message for a login when the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; I tried the free version, I like it.&lt;/p&gt;
&lt;p&gt;Amongst other things I do in my day job, I administer a WordPress site. We had a security audit and one of the findings was that our site was misconfigured to show a different failure message for a login when the username exists to when it doesn't. This allows for user enumeration which makes brute-forcing easier because you don't waste time trying to brute force accounts which don't exist.&lt;/p&gt;
&lt;p&gt;My first thought was that the auditors had made a mistake, we were running very vanilla WordPress on the latest version and I thought surely that's something the WordPress team would have patched if it was an issue with the default install.&lt;/p&gt;
&lt;p&gt;It turns out I was wrong, I couldn't find any definitive statement from the WordPress team but it seems they don't think user enumeration is an issue&lt;sup id="fnref:not-an-issue"&gt;&lt;a class="footnote-ref" href="#fn:not-an-issue"&gt;1&lt;/a&gt;&lt;/sup&gt;. Along with different log in prompts, there are several other places in WordPress that leak usernames such as appending &lt;code&gt;?author=1&lt;/code&gt; to the URL of the site.&lt;/p&gt;
&lt;p&gt;So I went looking for a way looking for a way to patch that and found &lt;a href="https://www.wordfence.com/"&gt;Wordfence&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After installing it I checked the password failure message and that was fixed. Then I started looking through some of the other features and was impressed with the brute force protection, they have sensible defaults and fairly good metrics.&lt;/p&gt;
&lt;p&gt;I also saw they had a scanner which checks the integrity of the WordPress core files which is a good idea.&lt;/p&gt;
&lt;p&gt;The plugin can also provide two-factor authentication which is a great idea but that's a paid feature.&lt;/p&gt;
&lt;p&gt;Over all, I'd say it's a good plugin and I will be installing it on any WordPress sites I'm responsible for in the future.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:not-an-issue"&gt;
&lt;p&gt;To be clear, this is not an unreasonable view to hold. It's more of an information disclosure than a real security threat. It really depends on what type of site you are running as to how serious this is.&amp;#160;&lt;a class="footnote-backref" href="#fnref:not-an-issue" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="WordPress"></category><category term="bruteforce"></category><category term="web application firewall"></category></entry><entry><title>The right to repair</title><link href="https://xo.tc/the-right-to-repair.html" rel="alternate"></link><published>2018-11-01T08:00:00+08:00</published><updated>2018-11-01T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-11-01:/the-right-to-repair.html</id><summary type="html">&lt;p&gt;&lt;a href="https://www.ifixit.com/Manifesto"&gt;&lt;img alt="Self Repair Manifesto" src="https://xo.tc/images/self_repair_manifesto_en_final.jpg"&gt;&lt;/a&gt;
&lt;em&gt;The Self Repari Manifesto by iFixit&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Recently a mate of mine blogged about how &lt;a href="https://bscable.info/macbooks-can-only-be-repaired-by-apple-technicians/"&gt;Macbooks can only be repaired by apple technicians&lt;/a&gt;. This is a story that sort of passed me by but it's becoming increasing common.&lt;/p&gt;
&lt;p&gt;I wouldn't have got into IT or learnt anywhere near as much as …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.ifixit.com/Manifesto"&gt;&lt;img alt="Self Repair Manifesto" src="https://xo.tc/images/self_repair_manifesto_en_final.jpg"&gt;&lt;/a&gt;
&lt;em&gt;The Self Repari Manifesto by iFixit&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Recently a mate of mine blogged about how &lt;a href="https://bscable.info/macbooks-can-only-be-repaired-by-apple-technicians/"&gt;Macbooks can only be repaired by apple technicians&lt;/a&gt;. This is a story that sort of passed me by but it's becoming increasing common.&lt;/p&gt;
&lt;p&gt;I wouldn't have got into IT or learnt anywhere near as much as I have if I hadn't been able to tinker with things. I'm a tinkerer by nature and that's how I learn.&lt;/p&gt;
&lt;p&gt;It seems many companies now days are going out of their way to make it hard to open up their product and understand how things works. This isn't just Macbooks, it's everything from lawnmowers to electronic doorbells.&lt;/p&gt;</content><category term="Posts"></category><category term="Repair"></category><category term="rant"></category></entry><entry><title>My predictions about autonomous vehicles</title><link href="https://xo.tc/my-predictions-about-autonomous-vehicles.html" rel="alternate"></link><published>2018-10-25T08:00:00+08:00</published><updated>2018-10-25T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-10-25:/my-predictions-about-autonomous-vehicles.html</id><summary type="html">&lt;p&gt;No one can predict the future, so I'm going to try. Maybe it will be fun to come back to this post in 10 years and see how laughably wrong I was.&lt;/p&gt;
&lt;h2 id="traffic-will-become-less-hectic-not-more"&gt;Traffic will become less hectic, not more&lt;/h2&gt;
&lt;p&gt;CGP Grey posted a great video &lt;a href="https://youtu.be/iHzzSao6ypE"&gt;The Simple Solution to Traffic …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;No one can predict the future, so I'm going to try. Maybe it will be fun to come back to this post in 10 years and see how laughably wrong I was.&lt;/p&gt;
&lt;h2 id="traffic-will-become-less-hectic-not-more"&gt;Traffic will become less hectic, not more&lt;/h2&gt;
&lt;p&gt;CGP Grey posted a great video &lt;a href="https://youtu.be/iHzzSao6ypE"&gt;The Simple Solution to Traffic&lt;/a&gt; which shows cars &lt;a href="https://youtu.be/iHzzSao6ypE?t=3m51s"&gt;weaving in and out&lt;/a&gt; at rates that would only be possible with self-driving cars that all know what everyone else will do.&lt;/p&gt;
&lt;p&gt;But I don't believe we will ever get to this level of automation.  Or at least not for an incredibly long time, I see three problems standing in the way of this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cooperation&lt;/strong&gt; - Will Ford cars talk to Toyota and Tesla talk to Chevy?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt; - Let's say we get cross-vendor communication going, how do we secure that communication so you don't get bored hackers jamming up traffic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other things on the road&lt;/strong&gt; - The biggest blockers I see is other stuff on the road. That person who still wants to drive their vintage &lt;a href="https://en.wikipedia.org/wiki/Ford_Model_T"&gt;Ford Model T&lt;/a&gt; and even if we passed a law to ban all non-autonomous vehicles, what about cars that have broken down or that little kid who ran onto the road chasing their ball.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From what I've read current autonomous cars feel like being in a car with an overly cautious driver and I expect that trend to continue.&lt;/p&gt;
&lt;h2 id="private-ownership-of-vehicles-will-end"&gt;Private ownership of vehicles will end&lt;/h2&gt;
&lt;p&gt;This isn't really my theory, I stole it from a talk by &lt;a href="https://www.youtube.com/watch?v=0op6Wucdv7E"&gt;Paul Fenwick&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you buy a self-driving car and it drops you off at work in the morning, why pay for parking in the city? why even drive it home and park it there? Why not put it to work doing taxi rides while you're at work? as long as it's back to pick you up in the afternoon you might as well make a profit from it while you're not using it.&lt;/p&gt;
&lt;p&gt;But then if you extend that if your car is spending more time working as a taxi than being used by you, why not always rent a corporate-owned car when you need it and not need to deal with maintenance and insurance and such.&lt;/p&gt;
&lt;h2 id="cars-will-chain-together-like-trucks-with-trailers"&gt;Cars will chain together like trucks with trailers&lt;/h2&gt;
&lt;p&gt;Achieving something between a bus and a car I can imagine cars that have tow bars on the front and the back and will link up. If four cars are going in the same general route why not link them until they need to split up, it saves on fuel. It might not quite achieve the crazy traffic mentioned above but would act much as trucks and buses do in current traffic.&lt;/p&gt;
&lt;h2 id="my-kids-will-never-learn-to-driver"&gt;My kids will never learn to driver&lt;/h2&gt;
&lt;p&gt;I don't have kids yet, but I am optimistic about timelines and I'd like to believe I'll be able to take an autonomous taxi ride within the next 10 years.&lt;/p&gt;
&lt;h2 id="paid-parking-lots-will-be-a-thing-of-the-past"&gt;Paid parking lots will be a thing of the past&lt;/h2&gt;
&lt;p&gt;I guess this might be an obvious one, but why pay for parking at work or at the airport when you can just get the car to drop you off and drive away.&lt;/p&gt;</content><category term="Posts"></category><category term="Autonomous Vehicles"></category><category term="predictions"></category></entry><entry><title>The internet reaction threshold</title><link href="https://xo.tc/the-internet-reaction-threshold.html" rel="alternate"></link><published>2018-10-18T08:00:00+08:00</published><updated>2018-10-18T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-10-18:/the-internet-reaction-threshold.html</id><summary type="html">&lt;p&gt;&lt;img alt="Internet Reaction Threshold" src="https://xo.tc/images/internet-reaction-threshold.png"&gt;&lt;/p&gt;
&lt;p&gt;I've noticed a lot of the sites I hang out on are getting more an more vitriolic, there are lots of theories about why this is and I'd like to add the Internet Reaction Threshold to the mix.&lt;/p&gt;
&lt;p&gt;Say someone posts a controversial video to YouTube. I like &lt;a href="https://www.youtube.com/watch?v=LeoklwonIMQ"&gt;one&lt;/a&gt; by …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="Internet Reaction Threshold" src="https://xo.tc/images/internet-reaction-threshold.png"&gt;&lt;/p&gt;
&lt;p&gt;I've noticed a lot of the sites I hang out on are getting more an more vitriolic, there are lots of theories about why this is and I'd like to add the Internet Reaction Threshold to the mix.&lt;/p&gt;
&lt;p&gt;Say someone posts a controversial video to YouTube. I like &lt;a href="https://www.youtube.com/watch?v=LeoklwonIMQ"&gt;one&lt;/a&gt; by Matt Gray and Tom Scott where Tom presents the idea that lettuce is just used as a cheap filler vegetable as a wildly controversial view and the later in the video says "&lt;a href="https://youtu.be/LeoklwonIMQ?t=2m58s"&gt;kids are basically small little tornados of destruction&lt;/a&gt;" as though it's just an accepted fact.&lt;/p&gt;
&lt;p&gt;Let's go with the lettuce thing although if it helps you feel free to mentally replace "lettuce" with anything that's genuinely controversial, guns, abortion, systemd, politics, whatever.&lt;/p&gt;
&lt;p&gt;Say someone posts a video about lettuce, 95% of the people watching will either agree or disagree but can't be bothered adding their comment. It takes a lot of effort to write "Sure, I prefer spinach, but lettuce is cheaper and easier to grow, I guess it's all down to what your willing to pay for, let's all get along." and if people don't care that much they just go off and watch the next cat video.&lt;/p&gt;
&lt;p&gt;Only the people with really strong feelings will take the time to comment, and so the comment thread becomes polarised.&lt;/p&gt;
&lt;p&gt;The Internet Reaction Threshold coupled with the fact that posts which get the most reactions are promoted creates a horrible feedback loop. People who post neutral feelings about lettuce don't get as much attention as those who are super-pro-lettuce or super-anti-lettuce.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Graph made with &lt;a href="http://xkcdgraphs.com/"&gt;xkcdgraphs&lt;/a&gt;.&lt;/p&gt;</content><category term="Posts"></category><category term="Theory"></category><category term="Internet Reaction Threshold"></category></entry><entry><title>What is yak shaving?</title><link href="https://xo.tc/what-is-yak-shaving.html" rel="alternate"></link><published>2018-10-11T08:00:00+08:00</published><updated>2018-10-11T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-10-11:/what-is-yak-shaving.html</id><summary type="html">&lt;p&gt;I know things like the &lt;a href="http://catb.org/jargon/html/"&gt;Jargon File&lt;/a&gt; exist, but I'm having fun writing this.&lt;/p&gt;
&lt;p&gt;There is a gif from Malcolm in the Middle that's been floating around the internet for years that explains Yak Shaving better than I ever could.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Yak Shaving" src="https://xo.tc/images/yackshaving-lightbulb.gif"&gt;&lt;/p&gt;
&lt;p&gt;It's basically when you need a series of often trivial …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I know things like the &lt;a href="http://catb.org/jargon/html/"&gt;Jargon File&lt;/a&gt; exist, but I'm having fun writing this.&lt;/p&gt;
&lt;p&gt;There is a gif from Malcolm in the Middle that's been floating around the internet for years that explains Yak Shaving better than I ever could.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Yak Shaving" src="https://xo.tc/images/yackshaving-lightbulb.gif"&gt;&lt;/p&gt;
&lt;p&gt;It's basically when you need a series of often trivial things before you can do your main goal. The way it was explained to me was:&lt;/p&gt;
&lt;p&gt;Your friend asks you to restore a WordPress site onto their server, it should take 5 minutes to do so you say sure.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You want to restore WordPress from a backup&lt;/li&gt;
&lt;li&gt;but to do that you need to update their PHP&lt;/li&gt;
&lt;li&gt;but to do that you need to fix a broken dependency on an old PHP package&lt;/li&gt;
&lt;li&gt;but to do that you need a library that has to be compiled from source&lt;/li&gt;
&lt;li&gt;but to do that you need to install a GCC&lt;/li&gt;
&lt;li&gt;but to do that you need to fix an issue with their apt-get&lt;/li&gt;
&lt;li&gt;but to do that you need to schedule a reboot&lt;/li&gt;
&lt;li&gt;but to do that you need to ...&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;li&gt;but to do &lt;em&gt;that&lt;/em&gt; you need to hike to the top of a Tibetan mountain and shave the hair off a Yak.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://commons.wikimedia.org/wiki/File:Bos_grunniens_at_Yundrok_Yumtso_Lake.jpg"&gt;&lt;img alt="Tibetan Yak" src="https://xo.tc/images/Bos_grunniens_at_Yundrok_Yumtso_Lake.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="Posts"></category><category term="Language"></category><category term="Yak Shaving"></category></entry><entry><title>What is bikeshedding?</title><link href="https://xo.tc/what-is-bikeshedding.html" rel="alternate"></link><published>2018-10-04T08:00:00+08:00</published><updated>2018-10-04T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-10-04:/what-is-bikeshedding.html</id><summary type="html">&lt;p&gt;If you have spent much time hanging out on technical email lists or forums you might have come across the term "bikesheding" essentially it means to spend time talking about the little details which everyone has an opinion on and to some degree ignoring the important things.&lt;/p&gt;
&lt;p&gt;It comes from …&lt;/p&gt;</summary><content type="html">&lt;p&gt;If you have spent much time hanging out on technical email lists or forums you might have come across the term "bikesheding" essentially it means to spend time talking about the little details which everyone has an opinion on and to some degree ignoring the important things.&lt;/p&gt;
&lt;p&gt;It comes from a book called &lt;a href="https://books.google.com/books/about/Parkinson_s_Law_Or_the_Pursuit_of_Progre.html?id=zcSqQwAACAAJ"&gt;Parkinson's Law: Or the Pursuit of Progress&lt;/a&gt; which is responsible for many economic theories but in particular the &lt;a href="https://en.wikipedia.org/wiki/Law_of_triviality"&gt;Law of triviality&lt;/a&gt; which talks about a committee approving a massive nuclear power plant and none of them really understand nuclear reactors so they approve it without comment.&lt;/p&gt;
&lt;p&gt;But when it comes time to build the bike shed at the power plant for the employees to park their bikes everyone has an opinion on what material it should be made from, wood, fiberglass, tin and what colour the shed should be painted and so that gets discussed for hours.&lt;/p&gt;
&lt;p&gt;Recently one of the technologists I admire most, Guido van Rossum, the inventor of Python &lt;a href="https://lwn.net/Articles/759654/"&gt;stepped down&lt;/a&gt; after a change to the Python language that was made &lt;a href="https://lwn.net/Articles/757713/"&gt;particularly difficult&lt;/a&gt; by the fact that everyone had an opinion. It was ultimately a fairly small change, but very controversial.&lt;/p&gt;
&lt;p&gt;I've been in meetings about websites I'm working on where I've thought, I don't really like that font, or I don't really like that particular shade of red. But I've held my tongue because I know that if I start the conversation, everyone will have an opinion about the colour scheme. The thing is, as long as the colours are not so bad that they will cause accessibility issues, it's far more important to focus on content and functionality.&lt;/p&gt;</content><category term="Posts"></category><category term="Language"></category><category term="bikeshedding"></category><category term="python"></category></entry><entry><title>People will ignore warnings that were wrong in the past.</title><link href="https://xo.tc/people-will-ignore-warnings-that-were-wrong-in-the-past.html" rel="alternate"></link><published>2018-09-27T08:00:00+08:00</published><updated>2018-09-27T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-09-27:/people-will-ignore-warnings-that-were-wrong-in-the-past.html</id><summary type="html">&lt;p&gt;This is basically a &lt;a href="https://en.wikipedia.org/wiki/The_Boy_Who_Cried_Wolf"&gt;boy who cried wolf&lt;/a&gt; story.&lt;/p&gt;
&lt;p&gt;I was recently on a road trip through Newfoundland in Canada, and as we were driving along. I was driving and I saw a sign that said construction ahead. Followed by a sign warning that the speed limit would soon change …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is basically a &lt;a href="https://en.wikipedia.org/wiki/The_Boy_Who_Cried_Wolf"&gt;boy who cried wolf&lt;/a&gt; story.&lt;/p&gt;
&lt;p&gt;I was recently on a road trip through Newfoundland in Canada, and as we were driving along. I was driving and I saw a sign that said construction ahead. Followed by a sign warning that the speed limit would soon change to 50 kph. That was closely followed by a sign that said up to $1,500 fine for speeding in a construction area.&lt;/p&gt;
&lt;p&gt;I didn't want to get a $1,500 fine so I dutifully slowed down from 100 kph to 50 ... Yes, I was &lt;em&gt;that&lt;/em&gt; guy with a string of cars behind me. After about 2 or 3 km with not a single sign of construction, I passed a "construction ends" sign and speed up again.&lt;/p&gt;
&lt;p&gt;We changed drivers a few times along the trip and went through several more "construction zones" which didn't have the slightest sign of construction and eventually began to just ignore them like everyone else was doing.&lt;/p&gt;
&lt;p&gt;Then sometime after the 30th zone we suddenly came across a bunch of people working on the road and had to brake sharply because we weren't expecting them.&lt;/p&gt;
&lt;p&gt;It's the same with things like SSL warning messages, I've lost count of the number of times I've seen SSL warning messages when connecting to wireless networks which have captive portals. I know that it's not because they are trying to man-in-the-middle my banking details, but they are trying to redirect me to their site so I can agree to their terms and conditions.&lt;/p&gt;
&lt;p&gt;Accepting that captive portals are a thing that won't go away, Android and Firefox on Linux have a solution where they try to reach out known site over HTTP and if the connection gets redirected then they pop up with a little warning message that says "This network requires a sign in..." and takes the user to the sign in page.&lt;/p&gt;
&lt;p&gt;I assume other OS and Browsers have similar features. While I wish captive portals didn't exist, I also accept they are not going away. A little "sign in" pop up is better than training people to click through SSL warnings whenever they connect to an open wireless network.&lt;/p&gt;</content><category term="Posts"></category><category term="SSL"></category><category term="warnings"></category></entry><entry><title>The one-time pad is not a perfect cipher</title><link href="https://xo.tc/the-one-time-pad-is-not-a-perfect-cipher.html" rel="alternate"></link><published>2018-09-20T08:00:00+08:00</published><updated>2018-09-20T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-09-20:/the-one-time-pad-is-not-a-perfect-cipher.html</id><summary type="html">&lt;p&gt;A little bit of knowledge is a dangerous thing.&lt;/p&gt;
&lt;p&gt;This will come as no surprise to professional cryptographers but it's a mistake that I see armature cryptographers make over and over again.&lt;/p&gt;
&lt;p&gt;When you do crypto 101 you learn that one-time pad provides "Perfect Secrecy" and that it's provably secure …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A little bit of knowledge is a dangerous thing.&lt;/p&gt;
&lt;p&gt;This will come as no surprise to professional cryptographers but it's a mistake that I see armature cryptographers make over and over again.&lt;/p&gt;
&lt;p&gt;When you do crypto 101 you learn that one-time pad provides "Perfect Secrecy" and that it's provably secure, it's mathematically impossible to break it.&lt;/p&gt;
&lt;p&gt;But while the one time pad provides perfect &lt;strong&gt;secrecy&lt;/strong&gt; it does &lt;em&gt;not provide&lt;/em&gt; &lt;strong&gt;integrity&lt;/strong&gt;. It is therefore vulnerable to a known plaintext attack.&lt;/p&gt;
&lt;p&gt;If you know what the message is, you can change it without the change being detected. Consider the following scenario;&lt;/p&gt;
&lt;p&gt;In the army Alice has a messenger boy called Malroy who she suspects of being a spy, she wants to send the message to Bob, the General of the army, but she can't trust her messenger. So she writes the message "Execute Malroy Immediately" encrypts it with the one time pad she has shared with Bob and hands Malroy his own (encrypted) death warrant.&lt;/p&gt;
&lt;p&gt;As it happens Alice was right, Malroy was a spy and as it happens he knows what the message says and decides he wants to change it to "Promote Malroy Immediately"&lt;/p&gt;
&lt;p&gt;Malroy can simply xor "Execute Malroy Immediately" with "Promote Malroy Immediately" and then xor that with the encrypted message to change its continence.&lt;/p&gt;
&lt;p&gt;That might seem like a contrived example, and to a degree it is. But known plaintext attacks are a real problem and crop up more often than you might expect. There was a recent &lt;a href="https://alter-attack.net/#active"&gt;attack on LTE&lt;/a&gt; which was using AES-CTR which also doesn't provide authenticated encryption. The cryptographers figured out where in the packet the IP address of the DNS server was and they could inject the IP address of their own DNS server without breaking the encryption, and then use their own DNS server to get man-in-the-middle access to phones.&lt;/p&gt;</content><category term="Posts"></category><category term="Cryptography"></category><category term="One Time Pad"></category></entry><entry><title>A simple hack to get around VPN IP conflicts</title><link href="https://xo.tc/a-simple-hack-to-get-around-vpn-ip-conflicts.html" rel="alternate"></link><published>2018-09-13T08:00:00+08:00</published><updated>2018-09-13T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-09-13:/a-simple-hack-to-get-around-vpn-ip-conflicts.html</id><summary type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo ip route add 192.168.1.2 dev ppp0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Recently my Aunty had some problems with her backup software at her business and asked if I could help. I could connect in to their VPN but their network was on the &lt;code&gt;192.168.1.1/24&lt;/code&gt; subnet and I …&lt;/p&gt;</summary><content type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo ip route add 192.168.1.2 dev ppp0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Recently my Aunty had some problems with her backup software at her business and asked if I could help. I could connect in to their VPN but their network was on the &lt;code&gt;192.168.1.1/24&lt;/code&gt; subnet and I was on a hotel WiFi that was also on the &lt;code&gt;192.168.1.1/24&lt;/code&gt; subnet.&lt;/p&gt;
&lt;p&gt;The best solution would be to change the subnets, but I couldn't really ask the hotel to change their network and my Aunty wasn't about to change either.&lt;/p&gt;
&lt;p&gt;There are some ways you can make it work with DNS and NAT but that's a lot of work to set up and I really just wanted to access one server quickly.&lt;/p&gt;
&lt;p&gt;Instead in Linux you can use the ip command to tell it that you want to route packets via a specific interface so I was able to force all packets for &lt;code&gt;192.168.1.2&lt;/code&gt; over the VPN.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo ip route add 192.168.1.2 dev ppp0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I was able to access the server and fix the backups. It's not a good long term solution because it will break other things, but it's a neat little hack that can get you out of a pinch.&lt;/p&gt;</content><category term="Posts"></category><category term="VPN"></category><category term="Networking"></category><category term="Linux"></category></entry><entry><title>Rediscovering F-Droid</title><link href="https://xo.tc/rediscovering-f-droid.html" rel="alternate"></link><published>2018-09-06T08:00:00+08:00</published><updated>2018-09-06T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-09-06:/rediscovering-f-droid.html</id><summary type="html">&lt;p&gt;I recently bought a Nokia 6.1 and I've been &lt;a href="https://xo.tc/nokia-61-review.html"&gt;Loving it&lt;/a&gt; but it's running stock Android and one of the best ways to secure your Android device is to not install random apps that you don't trust, and especially not to install untrusted apps that didn't come from the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently bought a Nokia 6.1 and I've been &lt;a href="https://xo.tc/nokia-61-review.html"&gt;Loving it&lt;/a&gt; but it's running stock Android and one of the best ways to secure your Android device is to not install random apps that you don't trust, and especially not to install untrusted apps that didn't come from the Google Play store.&lt;/p&gt;
&lt;p&gt;On my old Samsung Galaxy S4, I ran Lineage OS (previously CyanogenMod). On my Nexus 6P it was a mix, so on my Nokia 6.1, I tried to just use to Play Store for a while. However, I trust the F-Droid store and I wanted a couple of apps that are not in the Play Store so I installed it.&lt;/p&gt;
&lt;p&gt;I'm not sure when Android made the change&lt;sup id="fnref:change"&gt;&lt;a class="footnote-ref" href="#fn:change"&gt;1&lt;/a&gt;&lt;/sup&gt; but now instead of having a single "Allow unknown apps" switch in the settings, there is one per App, so when I downloaded the F-Droid APK I was asked to allow Firefox to install unknown apps.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android Firefox untrusted apps" src="https://xo.tc/images/firefox-install-untrusted-apps.png"&gt;&lt;/p&gt;
&lt;p&gt;Then after that, I was asked to allow F-Droid to install untrusted apps. Once I'd allowed that I went back and removed the permission from Firefox:&lt;/p&gt;
&lt;p&gt;Long press on Firefox icon &amp;gt; App Info (Drag it to the top) &amp;gt; Install unknown apps (scroll to the bottom)&lt;/p&gt;
&lt;p&gt;Now I've got the F-Droid store on there I'm much happier, they have updated the &lt;abbr title="User Interface"&gt;UI&lt;/abbr&gt; and it's much cleaner, but more importantly, the F-Droid store just has much less horrible junk apps.&lt;/p&gt;
&lt;p&gt;Very, very few of the Apps in the F-Droid store contain advertisements, and fewer still contain in-app purchases.&lt;/p&gt;
&lt;p&gt;The official Google Play store is filled with ad-supported apps and it provides almost no way to filter them, for example, I'd love a search function where you could restrict it to only Apps that don't have ads and don't push in-app purchases.&lt;/p&gt;
&lt;p&gt;A classic example is when you search for "Flashlight" the top result that comes up contains both ads, and in-app purchases.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Flashlight with ads" src="https://xo.tc/images/flashlight-ads.png"&gt;&lt;/p&gt;
&lt;p&gt;and on top of that, it requires access to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Location&lt;ul&gt;
&lt;li&gt;approximate location (network-based)&lt;/li&gt;
&lt;li&gt;precise location (GPS and network-based)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Photos / Media / Files&lt;ul&gt;
&lt;li&gt;read the contents of your USB storage&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Storage&lt;ul&gt;
&lt;li&gt;read the contents of your USB storage&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Camera&lt;ul&gt;
&lt;li&gt;take pictures and videos&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Other&lt;ul&gt;
&lt;li&gt;view network connections&lt;/li&gt;
&lt;li&gt;full network access&lt;/li&gt;
&lt;li&gt;control vibration&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's a lot of permissions for something that's just going to switch the LED light on and off.&lt;/p&gt;
&lt;p&gt;As a counterexample when you search "Flashlight" in the F-Droid the &lt;a href="https://f-droid.org/en/packages/com.simplemobiletools.flashlight/"&gt;first result&lt;/a&gt; that comes up has no ads or in-app purchases and only needs camera&lt;sup id="fnref:camera"&gt;&lt;a class="footnote-ref" href="#fn:camera"&gt;2&lt;/a&gt;&lt;/sup&gt; and flashlight permissions which seems reasonable.&lt;/p&gt;
&lt;p&gt;For a while I toyed with the idea of creating a web crawler and indexing the Play Store to create a site which provides advanced search of apps on the Play Store to filter out the junk but that seems like a lot of work to build and maintain for very little gain when the F-Droid store contains a great repository of nicely curated open source apps.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:change"&gt;
&lt;p&gt;I suspect it was between Android 7.0 Nougat and Android 8.0 Oreo.&amp;#160;&lt;a class="footnote-backref" href="#fnref:change" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:camera"&gt;
&lt;p&gt;From what I can tell the camera permission is needed because some builds of Android won't allow access to the LED without camera access.&amp;#160;&lt;a class="footnote-backref" href="#fnref:camera" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Android"></category><category term="F-Droid"></category><category term="Google Play"></category><category term="Open Source"></category></entry><entry><title>Making #FFFFFF brighter</title><link href="https://xo.tc/making-ffffff-brighter.html" rel="alternate"></link><published>2018-08-30T08:00:00+08:00</published><updated>2018-08-30T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-08-30:/making-ffffff-brighter.html</id><summary type="html">&lt;p&gt;Years ago I used to occasionally read a site called "Clients from hell" basically a page where people (generally freelance graphic designers) could post funny stories about horrible clients and misunderstandings.&lt;/p&gt;
&lt;p&gt;Generally, the stories went along the lines of:&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: I want you to do X work for me.&lt;br&gt;
&lt;strong&gt;Freelance …&lt;/strong&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;Years ago I used to occasionally read a site called "Clients from hell" basically a page where people (generally freelance graphic designers) could post funny stories about horrible clients and misunderstandings.&lt;/p&gt;
&lt;p&gt;Generally, the stories went along the lines of:&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: I want you to do X work for me.&lt;br&gt;
&lt;strong&gt;Freelance graphic designer&lt;/strong&gt;: Sure that will cost Y dollars.&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: Oh, I didn't think I'd have to pay you for that, it's just pictures and stuff.  &lt;/p&gt;
&lt;p&gt;or the ever popular misunderstandings of how technology works&lt;br&gt;
&lt;strong&gt;Freelance web designer&lt;/strong&gt;: I've updated the site with the changes you wanted.&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: Really? Because the paper copy I printed out last week hasn't changed.  &lt;/p&gt;
&lt;p&gt;However there was one story that came up over and over that always annoyed me, it runs along the lines of;&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: Can you make X thing brighter?&lt;br&gt;
&lt;strong&gt;Freelance graphic designer&lt;/strong&gt;: No, it's #FFFFFF, it's impossible, it is as bright as it can be.&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: Please, just a little brighter would make it look better.&lt;br&gt;
&lt;strong&gt;Freelance graphic designer&lt;/strong&gt;: &lt;em&gt;changes nothing&lt;/em&gt; ... Sure there you go, it's brighter now.&lt;br&gt;
&lt;strong&gt;Client&lt;/strong&gt;: Ok, thanks.&lt;br&gt;
&lt;strong&gt;Freelance graphic designer&lt;/strong&gt;: &lt;em&gt;Posts on Clients from Hell about how dumb the client is.&lt;/em&gt;*  &lt;/p&gt;
&lt;p&gt;The thing is, it's not the client that's at fault there, it's the designer.&lt;/p&gt;
&lt;p&gt;I'm sure many people would have seen the &lt;a href="https://en.wikipedia.org/wiki/Checker_shadow_illusion"&gt;checker shadow illusion&lt;/a&gt; before.&lt;/p&gt;
&lt;p&gt;&lt;img alt="checker shadow illusion" src="https://xo.tc/images/grey-square-optical-illusion.png"&gt;&lt;/p&gt;
&lt;p&gt;for those of you that haven't, the squares A and B are the same colour. This can be verified by using your favourite image editing tool or even with Firefox press F12, select the eyedropper tool and you will see they are both #787877&lt;/p&gt;
&lt;p&gt;&lt;img alt="Firefox eyedropper tool" src="https://xo.tc/images/firefox-eyedropper-tool.png"&gt;&lt;/p&gt;
&lt;p&gt;When the client is saying "Make it brighter" what they probably mean is "Make it &lt;em&gt;appear&lt;/em&gt; brighter" and as a graphic designer, it's their job to explain that maybe we can make the background darker and that will make the foreground look brighter.&lt;/p&gt;
&lt;p&gt;It's the same in IT security, our job as professionals to interpret what the client is asking for. When a client asks for "A website that's impossible to hack" as a security professional, you can't guarantee there will never be any 0 day in Apache or Nginx or whatever you use. But you can explain to the client that maybe what they are really looking for is a static website hosted on GitHub or whatever is appropriate for their situation.&lt;/p&gt;</content><category term="Posts"></category><category term="Graphic design"></category><category term="Client focus"></category></entry><entry><title>Nokia 6.1 Review</title><link href="https://xo.tc/nokia-61-review.html" rel="alternate"></link><published>2018-08-23T08:00:00+08:00</published><updated>2018-08-23T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-08-23:/nokia-61-review.html</id><summary type="html">&lt;h2 id="tldr"&gt;TLDR&lt;/h2&gt;
&lt;p&gt;I bought a Nokia 6.1, I've used it for 3 months, I think it's brilliant. My wife's old phone needed replacing, I was so happy with my phone that I suggested she get a Nokia 6.1 too.&lt;/p&gt;
&lt;h2 id="some-context"&gt;Some context&lt;/h2&gt;
&lt;p&gt;In May 2018 I bought a Nokia 6 …&lt;/p&gt;</summary><content type="html">&lt;h2 id="tldr"&gt;TLDR&lt;/h2&gt;
&lt;p&gt;I bought a Nokia 6.1, I've used it for 3 months, I think it's brilliant. My wife's old phone needed replacing, I was so happy with my phone that I suggested she get a Nokia 6.1 too.&lt;/p&gt;
&lt;h2 id="some-context"&gt;Some context&lt;/h2&gt;
&lt;p&gt;In May 2018 I bought a Nokia 6.1 because my Nexus 6P died. I managed to get the 64GB storage / 4GB RAM / Dual Sim version for just $300 AUD. So it's a mid-range priced phone, it's less than a third of the price of the latest iPhone or Google Pixel which each retail for over $1,000 AUD in Australia.&lt;/p&gt;
&lt;p&gt;The thing is despite being a technology enthusiast who runs Arch Linux to get the latest and greatest I'm actually quite minimalist. Both on my phone and my laptop I only install the packages I need and despise bloat.&lt;/p&gt;
&lt;p&gt;As such I wanted to get a phone that ran &lt;a href="https://www.android.com/one/"&gt;Android One&lt;/a&gt; so I would get as close to the stock Android experience as possible without all the vendor bloat. I remember when I got my Samsung Galaxy S4, it came from Telstra (Australia's largest telco) and came pre-installed with about 30 junk apps like the "AFL Footie scores" or the "Samsung Store" and "Crayon Physics" which could not be removed until I wiped the whole phone and put on CyanogenMod.&lt;/p&gt;
&lt;p&gt;Similarly, as a security professional, I wanted a phone that was guaranteed to receive regular security updates for at least two years&lt;sup id="fnref:guaranteed"&gt;&lt;a class="footnote-ref" href="#fn:guaranteed"&gt;1&lt;/a&gt;&lt;/sup&gt;. Again that meant a phone that was in the &lt;a href="https://www.android.com/one/"&gt;Android One&lt;/a&gt; program.&lt;/p&gt;
&lt;p&gt;Lastly with new phones that come out each year, for the last 5 years or more there has really been nothing other than a &lt;a href="https://xo.tc/fingerprint-readers-on-phones.html"&gt;Fingerprint reader&lt;/a&gt; that I've thought was a huge improvement.&lt;/p&gt;
&lt;p&gt;Every year it's the same black glass brick with no buttons. Maybe this year's model has rounded corners and last year's had square, or maybe this year's phone's CPU is 5~10% faster or has a little more ram, or has slightly more pixels, slightly better battery life or whatever. But it's always just a small improvement over last year's phone. In fact, storage on most phones went down for a while, I had a Nokia N81 in 2007 with 8GB of storage. Later I got a Nokia N97 which had 32GB storage with an SD card slot which is better than many phones sold today.&lt;/p&gt;
&lt;p&gt;I don't play fancy games that need great 3D graphics or lots of CPU/RAM.&lt;/p&gt;
&lt;p&gt;What I'm saying is that I'm very happy with a low-end phone.&lt;/p&gt;
&lt;h2 id="the-actual-review"&gt;The actual review&lt;/h2&gt;
&lt;p&gt;In for what I need the Nokia 6.1 is if anything overkill. It's very snappy, all the apps open quickly, I've never noticed any lag, the one game I do play on my phone &lt;a href="http://supercell.com/en/games/clashofclans/"&gt;Clash of Clans&lt;/a&gt; run smoothly without a hitch.&lt;/p&gt;
&lt;p&gt;The camera could be a little better in low light conditions but it's still pretty good. Below are a few pictures taken on the Nokia 6.1, I have not added any filters or post-processing to correct the colours. Click on them to see the full picture with no metadata removed.&lt;sup id="fnref:metadata"&gt;&lt;a class="footnote-ref" href="#fn:metadata"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://xo.tc/images/nokia-6-1-atacama-full.jpg"&gt;&lt;img alt="Atacama Desert photo on Nokia 6.1" src="https://xo.tc/images/nokia-6-1-atacama-small.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://xo.tc/images/nokia-6-1-salta-full.jpg"&gt;&lt;img alt="Salta photo on Nokia 6.1" src="https://xo.tc/images/nokia-6-1-salta-small.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://xo.tc/images/nokia-6-1-sunset-full.jpg"&gt;&lt;img alt="Sunset from a moving bus on Nokia 6.1" src="https://xo.tc/images/nokia-6-1-sunset-small.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://xo.tc/images/nokia-6-1-sherborne-church-full.jpg"&gt;&lt;img alt="Church in Sherborne, UK on a Nokia 6.1" src="https://xo.tc/images/nokia-6-1-sherborne-church-small.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;In fairness, I've picked some of the best pictures, there were a lot of bad ones too, but it shows what can be done&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Physically it feels very solid. Some of the low-end phones can feel very plasticy (and there was some story about bending iPhones) but the Nokia 6.1 feels great. I've dropped my phone on cement and stone a few times (without a case) and it hasn't even scratched yet.&lt;/p&gt;
&lt;p&gt;The battery life is good, constant heavy uses playing games and watch movies on a plane with the screen on full brightness it lasts about 12~13 hours, if left in my pocket and just used to take the occasional photo or send WhatsApp messages I can easily go 48 hours or more on a single charge.&lt;/p&gt;
&lt;p&gt;The fingerprint reader is good but not quite as good as the one on my old Nexus 6P, occasionally I've needed to try a few times to unlock the phone especially with sweaty hands.&lt;/p&gt;
&lt;p&gt;From a software and security point of view, it's outstanding. As I've mentioned above it is part of the &lt;a href="https://www.android.com/one/"&gt;Android One&lt;/a&gt; program. Which means it gets security patches over the air every month and stays on the latest patch level. So far I've got the patches within a week or so of them being released.&lt;/p&gt;
&lt;p&gt;I only have two complaints one is that the battery is not replaceable so when it inevitably wears out I will need to get a whole new phone.&lt;/p&gt;
&lt;p&gt;The other is that I can't easily unlock the bootloader and reflash my phone which for 99% of people is not a problem anyway.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;After I'd had my phone for about 2 and a half months my Wife's phone (Sony Xperia Z5) started showing dead pixels and we decided it needed replacing. I was so happy with my Nokia 6.1 and my wife had used it a fair bit and liked it too so we decided to get a second one for her.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:guaranteed"&gt;
&lt;p&gt;Actually I think that there should be a law that phone manufacturers must support the devices they sell until a given date, see my rant on &lt;a href="https://xo.tc/expiry-dates-on-smart-phones-and-other-iot-devices.html"&gt;Expiry dates on smart phones and other IoT devices&lt;/a&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:guaranteed" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:metadata"&gt;
&lt;p&gt;I know this includes things like the GPS coordinates where the photo was taken, I'm fine with that.&amp;#160;&lt;a class="footnote-backref" href="#fnref:metadata" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Android"></category><category term="Patching"></category><category term="Nokia"></category></entry><entry><title>Live chat support on websites</title><link href="https://xo.tc/live-chat-support-on-websites.html" rel="alternate"></link><published>2018-08-16T08:00:00+08:00</published><updated>2018-08-16T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-08-16:/live-chat-support-on-websites.html</id><summary type="html">&lt;p&gt;I'll just come out and say it, I like those live chat support things on websites.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Image Name" src="https://xo.tc/images/live-chat-button.png"&gt;&lt;/p&gt;
&lt;p&gt;I feel like I should dislike them because they are usually clunky and often show as a popup at an inconvenient time rather than just an option on the contact us page. There are …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'll just come out and say it, I like those live chat support things on websites.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Image Name" src="https://xo.tc/images/live-chat-button.png"&gt;&lt;/p&gt;
&lt;p&gt;I feel like I should dislike them because they are usually clunky and often show as a popup at an inconvenient time rather than just an option on the contact us page. There are &lt;a href="https://www.cyberscoop.com/ticketmaster-inbenta-technologies-chat-app-accused-breach/"&gt;stories&lt;/a&gt; about websites getting compromised because the 3rd party JavaScript they added to get the chat tool has been compromised.&lt;/p&gt;
&lt;p&gt;But despite all their failings, I still like them. I think it's because when I need support on a website I don't want to send an email because I want support &lt;em&gt;now&lt;/em&gt; I don't want to wait hours for each response.&lt;/p&gt;
&lt;p&gt;I also don't like to pick up the phone and call. Maybe I'm unique in that but;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Calls are ephemeral and I like to have a record of what was said.&lt;/li&gt;
&lt;li&gt;I can't multi-task well while I'm on the phone. I can open a chat window then go to another tab and periodically check to see if I've got a reply (or wait for it to make a noise or whatever). If I got a reply 45 seconds ago, the support person is not going to mind that it took a minute for my reply. But when I'm on hold on the phone I feel like I need to be constantly attentive because if the support person says "Thanks for holding" and I don't reply for 45 seconds they might just hang up.&lt;/li&gt;
&lt;li&gt;There are no issues with accent, often people have issues understanding my Australian accent and I have issues understanding their accent. I've learned the phonetic alphabet and that helps but it's still a struggle sometimes.&lt;/li&gt;
&lt;li&gt;I can think about my reply and re-read what they said. This is kind of a mix of the two points above but I feel it's still distinct. If someone says "Do you have xyz reference number" I can spend a minute to look for it (probably copy and paste it from wherever it is) and send it back without all that "Ummm... yes, I've got it here somewhere just let me rummage through my papers...  ahh... here it is just let me read it out for you"&lt;/li&gt;
&lt;li&gt;I can use Google Translate. I've needed to contact an airline about a ticket and their support only spoke Spanish, it needed a bit of back and forth so chat worked better than email and I could just copy paste each of the messages into Google Translate. It wasn't perfect but it was pretty good and it got the job done.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Maybe I also like them because of the fact that as a teenager I spent several hours every night hanging out with my friends on MSN Messenger / IRC / Yahoo Chat / etc... so I'm just more comfortable with online chat.&lt;/p&gt;</content><category term="Posts"></category><category term="Support"></category><category term="Websites"></category></entry><entry><title>How many android patterns are there?</title><link href="https://xo.tc/how-many-android-patterns-are-there.html" rel="alternate"></link><published>2018-08-09T08:00:00+08:00</published><updated>2018-08-09T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-08-09:/how-many-android-patterns-are-there.html</id><summary type="html">&lt;p&gt;This is a post I've had kicking around in my drafts folder for just over 2 years now so I've decided to publish it as a partly complete problem.&lt;/p&gt;
&lt;p&gt;One of my favorite pastimes, when I'm bored, is solving the puzzles on &lt;a href="https://projecteuler.net/"&gt;Project Euler&lt;/a&gt;&lt;sup id="fnref:project-euler"&gt;&lt;a class="footnote-ref" href="#fn:project-euler"&gt;1&lt;/a&gt;&lt;/sup&gt;. I'm not very far through …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is a post I've had kicking around in my drafts folder for just over 2 years now so I've decided to publish it as a partly complete problem.&lt;/p&gt;
&lt;p&gt;One of my favorite pastimes, when I'm bored, is solving the puzzles on &lt;a href="https://projecteuler.net/"&gt;Project Euler&lt;/a&gt;&lt;sup id="fnref:project-euler"&gt;&lt;a class="footnote-ref" href="#fn:project-euler"&gt;1&lt;/a&gt;&lt;/sup&gt;. I'm not very far through but I've solved 56 at the time of this writing. It's as much about writing the code and learning the language, in my case Python, as it is about actually solving the problems.&lt;/p&gt;
&lt;p&gt;The questions are good because they look like there must be a simple way to calculate the answer but it's not immediately obvious&lt;sup id="fnref:immediately-obvious"&gt;&lt;a class="footnote-ref" href="#fn:immediately-obvious"&gt;2&lt;/a&gt;&lt;/sup&gt;. An interesting question that I think is worthy of Project Euler is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;How many possible Android lock screen patterns are there? And how would you calculate it for arbitrarily sized grids?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let's examine the standard size first, initially if we are just working with a 3 x 3 grid it might help to think of the positions as numbers from 1 to 9.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android 3 x 3 grid" src="https://xo.tc/images/android-pattern-3-3-grid.png"&gt;&lt;/p&gt;
&lt;p&gt;Initially, we might (incorrectly) think, there are 9 possible starting positions, then 8 remaining moves, then 7 and so on. So it would be 9!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;math&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;362880&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But then we can't use a pattern of fewer than 3 positions so if we remove all there digit options&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;362376&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;However this is not right for a few reasons, first 9! (362880) is only the number of combinations of length 9 so to get all the possible combinations&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;itertools&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;positions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# 362880&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# 362880&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# 181440&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# 60480&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# 15120&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itertools&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permutations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# 3024&lt;/span&gt;
&lt;span class="c1"&gt;# Total 985824&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Second now we know how many combinations there are, we see that not all combinations are valid, for example while we can have 1234.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android pattern 1-2-3-4" src="https://xo.tc/images/android-pattern-1-2-3-4.png"&gt;&lt;/p&gt;
&lt;p&gt;We can't have 1324 because there is no way to get from 1 to 3 without going through 2, even if you try to avoid it the line snaps to any positions it passes through.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android pattern 1-3" src="https://xo.tc/images/android-pattern-1-3.gif"&gt;&lt;/p&gt;
&lt;p&gt;I found a few incorrect solutions online which simply had a list of invalid moves such as from 1 to 3, from 7 to 9 and so on, but this is not correct either. We can't simply say that moving from 1 to 3 is always invalid because once a position has been used we can jump over it so we can have 2413 as a valid pattern which does go from 1 to 3.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android Pattern 2-4-1-3" src="https://xo.tc/images/android-pattern-2-4-1-3.png"&gt;&lt;/p&gt;
&lt;p&gt;This might be obvious, but just to clearly state it; While you can't jump over an unchecked position, you don't need to move to an adjacent position, for example, knights moves are valid, so we can have 1834&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android Pattern 1-8-3-4" src="https://xo.tc/images/android-pattern-1-8-3-4.png"&gt;&lt;/p&gt;
&lt;p&gt;But just when we think we are getting a handle on things, LineageOS (previously CyanogenMod) throws a spanner in the works by allowing grids up to 6 x 6. For a larger grid, I think it's easier to switch to a coordinate system instead of numbered positions.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android 6 x 6 grid" src="https://xo.tc/images/android-pattern-6-6-grid.png"&gt;&lt;/p&gt;
&lt;p&gt;This brings in a whole new range of moves, for example &lt;code&gt;[(0,3), (5,0), (2,5), (2,4), (2,3), (2,2), (2,1), (2,0), (5,5), (0,2)]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android Pattern 03 50 25 24 23 22 21 20 55 02" src="https://xo.tc/images/android-pattern-03-50-25-24-23-22-21-20-55-02.png"&gt;&lt;/p&gt;
&lt;p&gt;and it brings some new invalid moves, we can't go from &lt;code&gt;[(0,0), (4,2)]&lt;/code&gt; without passing through &lt;code&gt;(2,1)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Android Pattern 00 21 42" src="https://xo.tc/images/android-pattern-00-21-42.png"&gt;&lt;/p&gt;
&lt;p&gt;After banging my head on a wall for a while, I searched online for a solution and the &lt;a href="https://www.quora.com/Android-operating-system-How-many-combinations-does-Android-9-point-unlock-have"&gt;best answer&lt;/a&gt; I found was a 3 x 3 grid has &lt;strong&gt;389112&lt;/strong&gt; possible patterns.&lt;/p&gt;
&lt;p&gt;That's great, but every single correct solution I could find involved a brute force approach. Trying every possible combination and then discarding the invalid ones.&lt;/p&gt;
&lt;p&gt;When it's just a simple 3 x 3 grid with only 985824 combinations to check brute force is not a bad way to go.&lt;/p&gt;
&lt;p&gt;With a 4 x 4 grid (16 positions, over 4,000,000,000,000 combinations to check) brute force becomes incredibly hard but still within the realms of modern computers. By the time we get to 6 x 6 grids (36 positions, more than 2^128 combinations to check) it's downright impossible on current hardware.&lt;/p&gt;
&lt;p&gt;There are some things we can do to speed things up though, for example the last two lengths (e.g. on the 3 x 3 grid that combinations of length 8 and 9) will always have the same number of possible combinations because every combination of 8 positions has exactly one corresponding combination of 9 positions.&lt;/p&gt;
&lt;p&gt;So the problem that I haven't been able to crack is, can we design an &lt;em&gt;efficient&lt;/em&gt; algorithm that can calculate the number of possible moves on an arbitrarily sized grid? not just square grids, what about 3 x 9 for example.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;All pictures generated with &lt;a href="http://fossil.shick.xyz/lockpatterngenerator/index"&gt;Lock Pattern Generator&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;If you are a maths genius and you have a solution please get in touch. I'd love to know and I'll update this post with a link to your solution, michael at hybr dot id dot au&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:project-euler"&gt;
&lt;p&gt;I know what you must be thinking, and you're right! I &lt;em&gt;am&lt;/em&gt; great fun to sit next to at parties... Only I don't go out that much because who would want to be out with friends when you could be at home quietly solving maths problems!? All jokes aside I do enjoy Project Euler, it's like people who do sudoku or crossword to relax.&amp;#160;&lt;a class="footnote-backref" href="#fnref:project-euler" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:immediately-obvious"&gt;
&lt;p&gt;Or at least it's not immediately obvious to me.&amp;#160;&lt;a class="footnote-backref" href="#fnref:immediately-obvious" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Python"></category><category term="Project Euler"></category><category term="Android"></category><category term="Maths"></category></entry><entry><title>The value of instant feedback</title><link href="https://xo.tc/the-value-of-instant-feedback.html" rel="alternate"></link><published>2018-08-02T08:00:00+08:00</published><updated>2018-08-02T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-08-02:/the-value-of-instant-feedback.html</id><summary type="html">&lt;p&gt;I am a huge believer in the value of instant feedback within security. It's important to pick at what point you give feedback because you don't want to risk spamming users. It's been &lt;a href="https://www.schneier.com/blog/archives/2018/06/the_habituation.html"&gt;shown&lt;/a&gt; several times that if you show users warnings and they are regularly false alarms that people …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am a huge believer in the value of instant feedback within security. It's important to pick at what point you give feedback because you don't want to risk spamming users. It's been &lt;a href="https://www.schneier.com/blog/archives/2018/06/the_habituation.html"&gt;shown&lt;/a&gt; several times that if you show users warnings and they are regularly false alarms that people will tune out and ignore warnings.&lt;/p&gt;
&lt;p&gt;But given at the right time, and not too often, giving instant feedback to users on what they are doing can provide great security controls.&lt;/p&gt;
&lt;p&gt;Two examples of this are; user logins and important transactions.&lt;/p&gt;
&lt;p&gt;If you have ever used Duo Push or Google's "Google Sign-In for Android" whenever you try to log in you will get a message on your phone saying, "Is it you trying to sign in?" this more than just 2 Factor authentication. You can get 2 Factor from any TOTP app like Google Authenticator, but this also lets you know if someone has tried to log into your account.&lt;/p&gt;
&lt;p&gt;At work, all Administrators had two separate Active Directory logins, one administrative account, and a regular account. Most of the work could be done with just the regular account but if you ever logged in to a server with a domain admin account you would receive an email instantly. It didn't provide 2 Factor, but it gave feedback so if an account was compromised we would know about it.&lt;/p&gt;
&lt;p&gt;Another great example was I have a Citibank credit card, and with the Citibank app, I can get push notifications every time there is a transaction. I think it's a great feature, sure someone could still use my card fraudulently once but I'd get a notification and contact the bank straight away rather than waiting until I check my statement.&lt;/p&gt;
&lt;p&gt;Like I said at the top of the post, it's important not to spam people, but done right push notifications are a great security tool.&lt;/p&gt;</content><category term="Posts"></category><category term="Push Notifications"></category><category term="Android"></category><category term="Active Directory"></category></entry><entry><title>Don't put jokes in warnings</title><link href="https://xo.tc/dont-put-jokes-in-warnings.html" rel="alternate"></link><published>2018-07-26T08:00:00+08:00</published><updated>2018-07-26T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-07-26:/dont-put-jokes-in-warnings.html</id><summary type="html">&lt;p&gt;There is a vlog series I quite enjoy &lt;a href="https://www.youtube.com/channel/UCRUULstZRWS1lDvJBzHnkXA"&gt;Matt and Tom's park bench&lt;/a&gt; and one thing they have discussed a couple of times is that the London underground has a number of signs that are used for important information and warnings like "The Piccadilly line is not running today".&lt;/p&gt;
&lt;p&gt;But …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a vlog series I quite enjoy &lt;a href="https://www.youtube.com/channel/UCRUULstZRWS1lDvJBzHnkXA"&gt;Matt and Tom's park bench&lt;/a&gt; and one thing they have discussed a couple of times is that the London underground has a number of signs that are used for important information and warnings like "The Piccadilly line is not running today".&lt;/p&gt;
&lt;p&gt;But sometimes, particularity around holidays like Easter, Christmas, and New Years they put up jokes on the signs like "We wanted to make a joke about Easter but couldn't think of one that was very bunny."&lt;/p&gt;
&lt;p&gt;For someone who is fluent in English that might just be mildly annoying because you look up, see there is a notice on the LCD screen, worry that your train has been delayed, wait for it to scroll across before realising it's just a lame pun and then move on. For someone who is not fluent in English, it just adds to an already stressful situation.&lt;/p&gt;
&lt;p&gt;The same should apply to &lt;abbr title="User Interface"&gt;UI&lt;/abbr&gt; design and security systems. I love a bit of humor in life, and some projects get this right. Python, for example, has a great mix of humor and in-jokes in their documentation to stop it from being too dry. But they don't put jokes into the important parts of the documentation or in error messages because the last thing some poor newbie who is debugging wants to read is some witty jokes that don't help them fix the problem.&lt;/p&gt;
&lt;p&gt;It really shouldn't have to be said but:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When designing a system, don't put jokes in warnings or in functional bits of documentation.&lt;/p&gt;
&lt;/blockquote&gt;</content><category term="Posts"></category><category term="Philosophy"></category><category term="English"></category></entry><entry><title>Two new iPhone security features</title><link href="https://xo.tc/two-new-iphone-security-features.html" rel="alternate"></link><published>2018-07-19T08:00:00+08:00</published><updated>2018-07-19T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-07-19:/two-new-iphone-security-features.html</id><summary type="html">&lt;p&gt;I am at heart a bit of an open source hippy who sees the world through rose coloured glasses. I want to believe that Android&lt;sup id="fnref:Android"&gt;&lt;a class="footnote-ref" href="#fn:Android"&gt;1&lt;/a&gt;&lt;/sup&gt; is the best mobile operating system because it is at it's core open source and it gives users the freedom to run their own …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am at heart a bit of an open source hippy who sees the world through rose coloured glasses. I want to believe that Android&lt;sup id="fnref:Android"&gt;&lt;a class="footnote-ref" href="#fn:Android"&gt;1&lt;/a&gt;&lt;/sup&gt; is the best mobile operating system because it is at it's core open source and it gives users the freedom to run their own code and inspect the code running on their device without needing to pay licensing agreements or sign NDAs. Unlike the walled garden that Apple has built.&lt;/p&gt;
&lt;p&gt;However, if pushed I'd begrudgingly admit that if security is your priority Apple and the iPhone have the edge.&lt;/p&gt;
&lt;p&gt;Apple has released two new security features for their latest version of iOS and I think they are really interesting to look at from the point of view of threat modeling because they cater to almost polar opposites of the threat landscape.&lt;/p&gt;
&lt;p&gt;The two features are &lt;em&gt;USB Restricted mode&lt;/em&gt; and &lt;em&gt;"tools for generating strong passwords, storing them in the iCloud keychain, and automatically entering them into Safari and iOS apps across all of a user's devices."&lt;/em&gt; these two features nicely demonstrate what &lt;a href="https://www.schneier.com/blog/archives/2012/01/going_dark_vs_a.html"&gt;Bruce Schneier&lt;/a&gt; called
"Going Dark" vs. a "Golden Age of Surveillance"&lt;/p&gt;
&lt;p&gt;With USB restricted mode, if someone has an iPhone and they are picked up by police, the police can no longer access their phone to look for incriminating material&lt;sup id="fnref:incriminating-material"&gt;&lt;a class="footnote-ref" href="#fn:incriminating-material"&gt;2&lt;/a&gt;&lt;/sup&gt;. This is a great step forward and has privacy advocates cheering, but it's not something that most people have to worry about.&lt;/p&gt;
&lt;p&gt;While with the password generation an storage, this is something that will result in a greatly increased security for a huge number of people. People generally are bad at picking passwords, bad at storing passwords and absolutely terrible at not repeating the same password across numerous systems. Letting your iPhone generate a password for you and syncing that across all your Apple devices is going to be a hell of a lot better than what most people are currently doing. It's not only going to be more secure but it's going to be easier and people will always take the easy option, it's like LastPass but built into the operating system.&lt;/p&gt;
&lt;p&gt;If I had to give anyone the job of securing all that data I'd say companies like Apple and Google are about as good as you can get. &lt;em&gt;But&lt;/em&gt; if Apple are syncing the passwords across devices then they &lt;em&gt;must&lt;/em&gt; be storing the passwords in such a way that it's possible to recover the cleartext. That just opens up a whole can of worms, even Apple's best developers are still human, and humans make mistakes or can be bribed or threatened. There was a story no that long ago where some celebrity had their iCloud account password guessed and compromising photos leaked online, and that was a result of Apple forgetting to rate limit one of their services, so these things do happen.&lt;/p&gt;
&lt;p&gt;So &lt;strong&gt;TLDR&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;USB Restricted mode&lt;/strong&gt; Good for the ~1% of people who are political activist or being surveilled by intelligence agencies? yes. Good for the ~99% of people who just want to keep their Facebook account safe? it can't hurt I guess.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password generation and cloud storage&lt;/strong&gt;: Good for the ~1% of people who are political activist or being surveilled by intelligence agencies? maybe, it depends. Good for the ~99% of people who just want to keep their Facebook account safe? Yes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:Android"&gt;
&lt;p&gt;Actually, I still want to believe that in the future Maemo 5 from my old Nokia N900 or KDE Plasma Mobile will dominate the mobile market, but I'm at least somewhat in touch with reality, so Android it is.&amp;#160;&lt;a class="footnote-backref" href="#fnref:Android" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:incriminating-material"&gt;
&lt;p&gt;I feel like I'm flogging a dead horse here and I shouldn't need to say this but, just because something is incriminating or illegal doesn't mean it's immoral. There are still countries where it's illegal to be homosexual, a man could have pictures of him and his boyfriend kissing. Illegal yes, immoral no.&amp;#160;&lt;a class="footnote-backref" href="#fnref:incriminating-material" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Apple"></category><category term="Android"></category><category term="Surveillance"></category><category term="Passwords"></category></entry><entry><title>Creating Guest WiFi passwords</title><link href="https://xo.tc/creating-guest-wifi-passwords.html" rel="alternate"></link><published>2018-07-12T08:00:00+08:00</published><updated>2018-07-12T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-07-12:/creating-guest-wifi-passwords.html</id><summary type="html">&lt;p&gt;This is a &lt;a href="https://rachelbythebay.com/w/2018/02/25/food/"&gt;half-baked idea&lt;/a&gt; that's been knocking around in my mind for a couple of years now, I've never implemented it and maybe it's more of a solution in search of a problem, but I digress.&lt;/p&gt;
&lt;p&gt;I've seen several places where they have guest WiFi and they have had …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is a &lt;a href="https://rachelbythebay.com/w/2018/02/25/food/"&gt;half-baked idea&lt;/a&gt; that's been knocking around in my mind for a couple of years now, I've never implemented it and maybe it's more of a solution in search of a problem, but I digress.&lt;/p&gt;
&lt;p&gt;I've seen several places where they have guest WiFi and they have had all sorts of strange solutions for making sure their guest WiFi is only used by guests and not all and sundry. Often this boils down to some horrible man-in-the-middle proxy that asks you for some sort of detail like your hotel reservation code or your flight number or some number printed on your coffee receipt.&lt;/p&gt;
&lt;p&gt;So I thought about using a &lt;a href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm"&gt;Time-based One-time Password&lt;/a&gt; to generate a new code every day. The same way that the codes in Google Authenticator (or you 2FA app of choice) but instead of a 6 digit code numeric with a period of 30 seconds use a 12 digit base64 code and a period of 24 hours.&lt;/p&gt;
&lt;p&gt;Then use some sort of network management software (or python and requests cludged together) to set the code as the PSK for your Guest WiFi. And put that code up on an LCD screen or somewhere your customers can see it but not public.&lt;/p&gt;
&lt;p&gt;I did say this idea was half-baked, didn't I? To be honest the idea just interests me more because I think it would be an interesting application of ToTP codes to generate new random passwords every day rather than because I can think of any situations where it would actually be practical and useful.&lt;/p&gt;</content><category term="Posts"></category><category term="WiFi"></category><category term="Cryptography"></category><category term="TOTP"></category></entry><entry><title>Why I've gone off bitcoin a bit</title><link href="https://xo.tc/why-ive-gone-off-bitcoin-a-bit.html" rel="alternate"></link><published>2018-07-05T08:00:00+08:00</published><updated>2018-07-05T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-07-05:/why-ive-gone-off-bitcoin-a-bit.html</id><summary type="html">&lt;p&gt;I first heard about Bitcoin at a Perth Linux Users Group talk in 2012 at a &lt;a href="https://plug.org.au"&gt;Perth Linux Users Group&lt;/a&gt; talk, where I thought it was a great idea but didn't think it would really take off so I didn't really pursue it.&lt;/p&gt;
&lt;p&gt;But it kept coming up again an …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I first heard about Bitcoin at a Perth Linux Users Group talk in 2012 at a &lt;a href="https://plug.org.au"&gt;Perth Linux Users Group&lt;/a&gt; talk, where I thought it was a great idea but didn't think it would really take off so I didn't really pursue it.&lt;/p&gt;
&lt;p&gt;But it kept coming up again an again so finally I took a more serious interest. I still think it's a great idea but lately, I've gone a little off bitcoin for 3 reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Power Consumption&lt;/li&gt;
&lt;li&gt;Over-valuation&lt;/li&gt;
&lt;li&gt;Over-Hyped block-chain technology&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Power Consumption&lt;/strong&gt;
Power Consumption is an interesting one, I was listening to a Risky Business podcast about a year or two ago (I can't find the episode) and they discussed how much power was being used to run all the GPUs / ASICs that are mining bitcoin. They linked to an article which said bitcoin minding was using some ridiculous amount of power like &lt;a href="https://youtu.be/I5cYgRnfFDA?t=12s"&gt;1.21 Gigawatts&lt;/a&gt; their comments were (paraphrasing) "I think the numbers are a bit rubbery but the general idea is right."&lt;/p&gt;
&lt;p&gt;To mine bitcoin, you need compute power, and for that you need electricity, and for that people are burning fossil fuels.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Over-valuation&lt;/strong&gt;
There was a Last Week Tonight &lt;a href="https://www.youtube.com/watch?v=g6iDZspbRMg"&gt;episode&lt;/a&gt; where John Oliver called cryptocurrencies a giant ponzi scheme. I'd love to get angry and defensive about that, but unfortunately, for the most part, he is right.&lt;/p&gt;
&lt;p&gt;Most buyers of bitcoin are buying it as an investment, and that's really not the point of a currency. Sure, some people trade in currency for a living, but for most people, you would only by Vietnamese Dong if you were going to go to Vietnam and expected to buy something with the currency.&lt;/p&gt;
&lt;p&gt;With bitcoin, people buy it to hold on to it because the price is going up, but the price is only going up because people are buying it as an investment. I'm not sure if the bubble will burst or what will happen in the future, but right now most bitcoin is not being used to facilitate trade.&lt;sup id="fnref:facilitate-trade"&gt;&lt;a class="footnote-ref" href="#fn:facilitate-trade"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I'd love for this to change, but I don't know if it will&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Over-Hyped block-chain technology&lt;/strong&gt;
I feel like people will invest in anything that got the word block-chain in it right now, Extra Credits even did an episode "&lt;a href="https://www.youtube.com/watch?v=ywvTIM_eOVI"&gt;Can Blockchain Technology be a Game Mechanic?&lt;/a&gt;" and they talked about how they could use the blockchain to track a weapon throughout the game. They say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Okay, picture this: You start a game using a simple iron sword, you progress and level, and eventually use it to slay a boss named "Grillmig The Orc". Suddenly your simple iron sword becomes "Grillmig's bane", and with the name changed, it gains some extra stats.&lt;/p&gt;
&lt;p&gt;Eventually, like all gear, you'll outgrow it and decide to sell it. Some upcoming player buys it and as they level they farm a ton of ghouls. And now it becomes: "Ghoul Slayer, the bane of Grill Mig". It gains more stats, but eventually this player too out grows it.&lt;/p&gt;
&lt;p&gt;The weapon passes from player to player each time accruing new heroic associated with it, or unlocking achievements that no single player could ever do alone. Eventually, it becomes one of the most coveted swords in the game because its unique.&lt;/p&gt;
&lt;p&gt;And any player who examines it can see the name of all the players who ever wielded it and what deeds they did. And if the designers were really clever, the sword would also benefit from having been used by characters that later did heroic deeds.&lt;/p&gt;
&lt;p&gt;So when your character slays that final raid boss god dragon of nightmares, all of the sudden your first training sword no matter who currently has it, levels up and becomes the heirloom of the Great &lt;insert your character name here&gt;.  &lt;/p&gt;
&lt;p&gt;That's Awesome, and it's something that blockchain lets us easily do. "&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, first of all, that's an amazing game mechanic and a really cool idea, but one of the top comments said:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why does Blockchain make those MMO weapon concepts easier than any other methods? Would that not work with a standard database on a server?﻿&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And that was my thoughts exactly. A blockchain solves the problem where you have a distributed system the users don't trust one another but want to build trust into their system. But the key word there is &lt;strong&gt;distributed&lt;/strong&gt; if you already have a central authority that everyone trusts then a blockchain simply becomes a lot of work for no gain. If you trust the game company running the servers to keep an accurate history of the scores you don't need a distributed blockchain.&lt;/p&gt;
&lt;p&gt;And in fact, if you have a central authority it solves one of the "problems" with a blockchain which is that you can undo a transaction if it's malicious or accidental. What if in the example above someone found an exploit in the game and managed to kill all the bosses in the game at once, now their weapon has that stat and if you had a distributed ledger, you can't undo.&lt;/p&gt;
&lt;p&gt;People are human, they make mistakes, having an undo button is a great thing.&lt;/p&gt;
&lt;p&gt;Another way I've seen blockchain over-hyped and used in the wrong way was some article&lt;sup id="fnref:banks-and-blockchain"&gt;&lt;a class="footnote-ref" href="#fn:banks-and-blockchain"&gt;2&lt;/a&gt;&lt;/sup&gt; about a bank that was going to start using it for tracking their transactions. It was still at the R&amp;amp;D stage and probably just a puff piece with no substance. But the idea was it would be used by one bank, by them self, internally, tracking transactions but if it's just one bank why bother?&lt;/p&gt;
&lt;p&gt;They can always go back and edit their internal blockchain to change some historical transaction and then just recalculate all the future transactions again after that. Who is going to stop them? Sure it might take some extra compute power to catch back up but they can do it. If their blockchain was running on 3 servers before just get an extra 300 servers onto it until you catch up again.&lt;/p&gt;
&lt;p&gt;There are existing cryptographic tools that would do a better job with significantly less overhead in that situation, like &lt;a href="https://xo.tc/time-stamp-with-openssl-an-curl.html"&gt;time stamps&lt;/a&gt;. Make a file with all your transactions, calculate a SHA256 sum of the file and get it timestamped by an external trusted authority. It would give you a ledger that's much harder to alter.&lt;/p&gt;
&lt;p&gt;The blockchain was a genius idea. It solves a very specific problem, but it's often being applied in situations where it's not appropriate. It makes me think of a kid who uses a VPN to log into Facebook and then make a derogatory comment about a teacher and later says "But I thought a VPN would make me anonymous"&lt;/p&gt;
&lt;p&gt;All that's not to say that I don't like bitcoin, I do like it, I just think it's worth looking at the bad as well as the good.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:facilitate-trade"&gt;
&lt;p&gt;There are obviously some counterexamples to this, one of my friends has some bitcoin that he is using pay for things like a &lt;abbr title="Virtual Private Server"&gt;VPS&lt;/abbr&gt; directly with bitcoin.&amp;#160;&lt;a class="footnote-backref" href="#fnref:facilitate-trade" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:banks-and-blockchain"&gt;
&lt;p&gt;I can't remember the exact article I was reading but just Google "Bank blockchain" and you will find hundreds of similar ones.&amp;#160;&lt;a class="footnote-backref" href="#fnref:banks-and-blockchain" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Bitcoin"></category><category term="Blockchain"></category><category term="Cryptography"></category><category term="Games"></category><category term="Rant"></category></entry><entry><title>The best long haul flight tip I've got, bring an empty bottle</title><link href="https://xo.tc/the-best-long-haul-flight-tip-ive-got-bring-an-empty-bottle.html" rel="alternate"></link><published>2018-06-28T08:00:00+08:00</published><updated>2018-06-28T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-06-28:/the-best-long-haul-flight-tip-ive-got-bring-an-empty-bottle.html</id><summary type="html">&lt;p&gt;An IT Security focused blog is not really the right place to give out travel tips, but it's my blog so here we go.&lt;/p&gt;
&lt;p&gt;I've received lots of great travel tips over the years but one of the best ones was for any flight you go on, especially long haul …&lt;/p&gt;</summary><content type="html">&lt;p&gt;An IT Security focused blog is not really the right place to give out travel tips, but it's my blog so here we go.&lt;/p&gt;
&lt;p&gt;I've received lots of great travel tips over the years but one of the best ones was for any flight you go on, especially long haul flights was:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can bring an empty bottle with you through customs and then fill it up and drink plenty of water on the flight.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There are many bad things about long flight, but I feel like most of these things are exasperated by being dehydrated. Airlines give out small amount of water in tiny cups infrequently. Also I think&lt;sup id="fnref:think"&gt;&lt;a class="footnote-ref" href="#fn:think"&gt;1&lt;/a&gt;&lt;/sup&gt; that the air-conditioning in planes is set to a very low humidity which drys my skin.&lt;/p&gt;
&lt;p&gt;Even through you can't bring more than 100ml of liquids through customs you can bring an empty water bottle and most airports will have water fountains (usually located near the toilets) that you can use to refill your bottle.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Filling up my water bottle" src="https://xo.tc/images/water-bottle.png"&gt;
&lt;em&gt;Filling up my trusty water bottle at Leonardo da Vinci–Fiumicino Airport, Rome, Italy&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I know that should be obvious that you can bring an empty bottles through but I've seen a lot of people throw out bottles at customs rather than just emptying them. Alternatively you could just buy a bottle of water after passing through customs but if your travelling a lot that's a lot of wasted bottles and do you really want to pay $5 for a small bottle of water?&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:think"&gt;
&lt;p&gt;I know nothing about the air-conditioning settings of planes, or it's effect on skin, it's purely anecdotal, and could be completely wrong.&amp;#160;&lt;a class="footnote-backref" href="#fnref:think" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Off topic"></category><category term="travel"></category></entry><entry><title>Are loot boxes gambling?</title><link href="https://xo.tc/are-loot-boxes-gambling.html" rel="alternate"></link><published>2018-06-21T08:00:00+08:00</published><updated>2018-06-21T08:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2018-06-21:/are-loot-boxes-gambling.html</id><summary type="html">&lt;p&gt;First of all, always read the disclaimer&lt;sup id="fnref:disclaimer"&gt;&lt;a class="footnote-ref" href="#fn:disclaimer"&gt;1&lt;/a&gt;&lt;/sup&gt;. I was watching an episode of &lt;a href="https://www.youtube.com/watch?v=-Uha5c7hJdA"&gt;Extra Credits&lt;/a&gt; a while ago and they were addressing loot boxes in games. At &lt;a href="https://youtu.be/-Uha5c7hJdA?t=4m42s"&gt;4:22&lt;/a&gt; in the video the question of whether loot boxes are gambling comes up, they say that more research is required …&lt;/p&gt;</summary><content type="html">&lt;p&gt;First of all, always read the disclaimer&lt;sup id="fnref:disclaimer"&gt;&lt;a class="footnote-ref" href="#fn:disclaimer"&gt;1&lt;/a&gt;&lt;/sup&gt;. I was watching an episode of &lt;a href="https://www.youtube.com/watch?v=-Uha5c7hJdA"&gt;Extra Credits&lt;/a&gt; a while ago and they were addressing loot boxes in games. At &lt;a href="https://youtu.be/-Uha5c7hJdA?t=4m42s"&gt;4:22&lt;/a&gt; in the video the question of whether loot boxes are gambling comes up, they say that more research is required but that the only study they could find found that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Both legally and psychologically, there's an important distinction between gambling and non gambling and that is the ability to cash out. Because you can't take your rare Overwatch skin and sell it back to Blizzard for actual spending money, the experience affects us differently. Video game loot boxes are less like craps and roulette and are more akin to a crane game, or a blind box, or the raffle for prizes at the county fair.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And I take issue with that&lt;sup id="fnref:issue"&gt;&lt;a class="footnote-ref" href="#fn:issue"&gt;2&lt;/a&gt;&lt;/sup&gt;, because I think that the way we define currency needs to change. The Oxford English Dictionary &lt;a href="https://en.oxforddictionaries.com/definition/currency"&gt;defines&lt;/a&gt; currency as:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A system of money in general use in a particular country.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But I think a better definition would be something along the lines of&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Anything that is used to facilitation trade&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In fact Extra credits did a brilliant series on &lt;a href="https://www.youtube.com/watch?v=-nZkP2b-4vo"&gt;The History of Paper Money&lt;/a&gt; where they discus things like large rocks that were used as currency.&lt;/p&gt;
&lt;p&gt;All sorts of things have been used as currencies, there are stories of cigarettes being used as currency after World War II, even by people who don't smoke. Consider bitcoin, I would argue that bitcoin and other cryptocurrencies are currencies.&lt;/p&gt;
&lt;p&gt;If you search online you will find plenty of stories of the gold in World of Warcraft (WoW gold) being worth more than some or other countries currency&lt;sup id="fnref:wow-gold"&gt;&lt;a class="footnote-ref" href="#fn:wow-gold"&gt;3&lt;/a&gt;&lt;/sup&gt;, and people who make full time jobs farming WoW gold and then selling online to change it back to their local currency.&lt;/p&gt;
&lt;p&gt;You could argue that WoW gold is not a "real" currency because you can only buy things in Wold of Warcraft with it, and to buy things outside you need to convert it into another currency, but I would say that is true to some degrees of all currencies.&lt;/p&gt;
&lt;p&gt;Even if you take what I assume&lt;sup id="fnref:assume"&gt;&lt;a class="footnote-ref" href="#fn:assume"&gt;4&lt;/a&gt;&lt;/sup&gt; to be the most widely recognised and accepted currency, the US Dollar, you still can't use it to buy anything anywhere without converting it first. If you walk into McDonald's, the most American store I can think of, in Australia and try to buy a Big Mac with US Dollars you will be politely asked to go away and come back with real money. There is no currency that is universally accepted everywhere without the need to exchange it into another currency.&lt;/p&gt;
&lt;p&gt;So, I believe that currencies in games, in particular games which allow players to trade with each other and therefore create an easy market for people to sell their in game items are "real" currencies. And by extension I believe extension loot boxes &lt;em&gt;are&lt;/em&gt; gambling because you &lt;em&gt;can&lt;/em&gt; cash out.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:disclaimer"&gt;
&lt;p&gt;I am so not qualified to talk about this, I'm not a psychologist, I'm not a finance expert, I'm not even a game designer. Information Technology is my area of expertise, and specifically IT Security. However, this is the internet, I have opinions and a blog so here we are.&amp;#160;&lt;a class="footnote-backref" href="#fnref:disclaimer" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:issue"&gt;
&lt;p&gt;To be clear here, I don't take issue with Extra Credits for citing that study, they are pretty up front about the fact that it's an area that needs much more in depth research and at least they tried to use a scientific study rather than just going on gut feel.&amp;#160;&lt;a class="footnote-backref" href="#fnref:issue" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:wow-gold"&gt;
&lt;p&gt;For example from a quick Google search I found that 1 USD buys 6,300 WoW Gold, and currently 1 USD gets 22,700 Vietnamese Dong (VND). You would be hard pressed to find anything 1 VND, in fact a cheap Bánh Mì is about 10,000 VND. So I guess you could say a Bánh Mì in Vietnam costs about 3,000 WoW gold.&amp;#160;&lt;a class="footnote-backref" href="#fnref:wow-gold" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:assume"&gt;
&lt;p&gt;This is completely anecdotal.&amp;#160;&lt;a class="footnote-backref" href="#fnref:assume" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Off topic"></category><category term="Games"></category><category term="Gambling"></category></entry><entry><title>Where in the world is Michael Van Delft?</title><link href="https://xo.tc/where-in-the-world-is-michael-van-delft.html" rel="alternate"></link><published>2017-12-28T07:00:00+08:00</published><updated>2017-12-28T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-12-28:/where-in-the-world-is-michael-van-delft.html</id><summary type="html">&lt;p&gt;In August 2015, I set myself the goal of publishing one post per week on this site for at least a year. I've managed that goal, this will be my 124th post and so far I've had great fun writing.&lt;/p&gt;
&lt;p&gt;By the time this post gets published I will have …&lt;/p&gt;</summary><content type="html">&lt;p&gt;In August 2015, I set myself the goal of publishing one post per week on this site for at least a year. I've managed that goal, this will be my 124th post and so far I've had great fun writing.&lt;/p&gt;
&lt;p&gt;By the time this post gets published I will have been married to my beautiful fiancée and have left Perth for our honeymoon an almost 12-month long trip backpacking around the world.&lt;/p&gt;
&lt;p&gt;I have no idea if I will continue to update this blog, or just leave it. Although I suspect that if I do continue with it, my posts will not be as regular.&lt;/p&gt;
&lt;p&gt;Here's to a good life.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A good life" src="https://xo.tc/images/a-good-life.png"&gt;&lt;/p&gt;</content><category term="Posts"></category><category term="Good Bye"></category></entry><entry><title>Simple Windows SMTP relay</title><link href="https://xo.tc/simple-windows-smtp-relay.html" rel="alternate"></link><published>2017-12-21T07:00:00+08:00</published><updated>2017-12-21T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-12-21:/simple-windows-smtp-relay.html</id><summary type="html">&lt;p&gt;In a recent post I mentioned that I had survived an Office 365 migration with only minimal scarring. We run HPE Content Manager which is "Enterprise Software". Just like the large government agencies that Content Manager is designed for it's big, slow, resistant to change, expensive, bureaucratic but yet incredibly …&lt;/p&gt;</summary><content type="html">&lt;p&gt;In a recent post I mentioned that I had survived an Office 365 migration with only minimal scarring. We run HPE Content Manager which is "Enterprise Software". Just like the large government agencies that Content Manager is designed for it's big, slow, resistant to change, expensive, bureaucratic but yet incredibly despite all it's failings, it's occasionally capable of achieving great things like landing on the moon.&lt;/p&gt;
&lt;p&gt;Anyway HPE Content Manager hasn't gotten around to implementing TLS before authentication for it's mail processing yet so it can't talk to office 365. So I was looking for a way to setup a mail relay but didn't want to setup a whole new VM just to relay mail.&lt;/p&gt;
&lt;p&gt;I was surprised to find that Windows offers a mail relay built in to IIS.&lt;/p&gt;
&lt;h2 id="installing"&gt;Installing&lt;/h2&gt;
&lt;p&gt;Go to server manager and select Manage &amp;gt; Add Roles and Features&lt;/p&gt;
&lt;p&gt;&lt;img alt="Manager" src="https://xo.tc/images/smtp-relay-01-add-roles.png"&gt;&lt;/p&gt;
&lt;p&gt;Skip past the before you begin page&lt;/p&gt;
&lt;p&gt;&lt;img alt="Before you begin" src="https://xo.tc/images/smtp-relay-02-before-you-begin.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick "Role-based or Feature-based installation"&lt;/p&gt;
&lt;p&gt;&lt;img alt="Installation Type" src="https://xo.tc/images/smtp-relay-03-installation-type.png"&gt;&lt;/p&gt;
&lt;p&gt;Select the local server&lt;/p&gt;
&lt;p&gt;&lt;img alt="Server Selection" src="https://xo.tc/images/smtp-relay-04-server-selection.png"&gt;&lt;/p&gt;
&lt;p&gt;Add the "SMTP Server"&lt;/p&gt;
&lt;p&gt;&lt;img alt="Add Features" src="https://xo.tc/images/smtp-relay-05-features.png"&gt;&lt;/p&gt;
&lt;p&gt;This will also install IIS 6.0&lt;/p&gt;
&lt;p&gt;&lt;img alt="Add Features" src="https://xo.tc/images/smtp-relay-06-add-features.png"&gt;&lt;/p&gt;
&lt;p&gt;Confirm the setting and install&lt;/p&gt;
&lt;p&gt;&lt;img alt="Confirm settings" src="https://xo.tc/images/smtp-relay-07-confirmation.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Confirm settings" src="https://xo.tc/images/smtp-relay-08-results.png"&gt;&lt;/p&gt;
&lt;h2 id="settings"&gt;Settings&lt;/h2&gt;
&lt;p&gt;Once the SMTP Server is installed open IIS 6.0. If you have a website on your server (such as HPE Content Manager Web Client) you will see two versions of IIS.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IIS 6" src="https://xo.tc/images/smtp-relay-09-IIS-6.png"&gt;&lt;/p&gt;
&lt;p&gt;Right click on the SMTP Virtual Server and go to Properties&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server" src="https://xo.tc/images/smtp-relay-10-virtual-server.png"&gt;&lt;/p&gt;
&lt;p&gt;Under the Access tab select Authentication.&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Access Tab" src="https://xo.tc/images/smtp-relay-11-access-tab.png"&gt;&lt;/p&gt;
&lt;p&gt;On the Authentication window, check that Anonymous access is available&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Authentication" src="https://xo.tc/images/smtp-relay-12-authentication.png"&gt;&lt;/p&gt;
&lt;p&gt;Next from the Access Tab select the Connections window and ensure that only the IP address you want can connect.&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Connections" src="https://xo.tc/images/smtp-relay-13-connection.png"&gt;&lt;/p&gt;
&lt;p&gt;Then from the Access Tab select the Relay window and again ensure that only the IP address you want will be allowed.&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Relay" src="https://xo.tc/images/smtp-relay-14-relay.png"&gt;&lt;/p&gt;
&lt;p&gt;Then go to the delivery tab, we are going to need the three buttons across the bottom.&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Delivery Tab" src="https://xo.tc/images/smtp-relay-15-delivery-tab.png"&gt;&lt;/p&gt;
&lt;p&gt;Under Outbound Security enter the user name and password and tick TLS encryption.&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Outbound Security" src="https://xo.tc/images/smtp-relay-16-outbound-security.png"&gt;&lt;/p&gt;
&lt;p&gt;Under Outbound Connections change the port to 587.&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Outbound Connections" src="https://xo.tc/images/smtp-relay-17-outbound-connections.png"&gt;&lt;/p&gt;
&lt;p&gt;Finally under advanced set the smart host to SMTP.office365.com&lt;/p&gt;
&lt;p&gt;&lt;img alt="SMTP Virtual Server - Outbound Connections" src="https://xo.tc/images/smtp-relay-18-advanced.png"&gt;&lt;/p&gt;
&lt;h2 id="point-mail-to-the-relay"&gt;Point Mail to the relay&lt;/h2&gt;
&lt;p&gt;Now you can point HPE Content Manager or whatever it is that you need to relay mail for, to your server.&lt;/p&gt;
&lt;p&gt;&lt;img alt="HPE Content Manger - Mail Settings" src="https://xo.tc/images/smtp-relay-19-hpe-cm.png"&gt;&lt;/p&gt;</content><category term="Posts"></category><category term="Windows"></category><category term="email"></category><category term="SMTP"></category><category term="Office365"></category><category term="TLS"></category></entry><entry><title>The importance of open standards</title><link href="https://xo.tc/the-importance-of-open-standards.html" rel="alternate"></link><published>2017-12-14T07:00:00+08:00</published><updated>2017-12-14T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-12-14:/the-importance-of-open-standards.html</id><summary type="html">&lt;p&gt;I recently looked through my archives and was surprised to find that I hadn't blogged about this before as it's something I get quite passionate about.&lt;/p&gt;
&lt;p&gt;Many companies try to set up proprietary standards in IT in an attempt to control the market. It's a horrible practice and needs to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently looked through my archives and was surprised to find that I hadn't blogged about this before as it's something I get quite passionate about.&lt;/p&gt;
&lt;p&gt;Many companies try to set up proprietary standards in IT in an attempt to control the market. It's a horrible practice and needs to be stopped. Imagine if you bought a HP laptop, and then you wanted to connect a printer to it, and instead of a USB port, you needed to buy a printer with a specific HP-Connection. And that type of connector was different from a Dell connection, or Lenovo, or Toshiba, or Sony, or Acer, or ...&lt;/p&gt;
&lt;p&gt;Having one standard type of connection benefits everyone. It makes life easier for the consumers and makes the IT industry as a whole develop faster.&lt;/p&gt;
&lt;p&gt;A great example of this is things like Firewire vs USB. Many people would argue that Firewire was a better design but there were several &lt;a href="https://en.wikipedia.org/wiki/IEEE_1394#Intellectual_property_considerations"&gt;patent issues&lt;/a&gt; as well as some weird copyright issues around the name leading to some companies calling it i.LINK, Lynx, or the generic IEEE 1394. Ultimately Firewire did not take off.&lt;/p&gt;
&lt;p&gt;It shocks me that even though the EU passed a law that all phones sold in Europ must have a Micro USB (or later USB-C) charger, Apple blatantly flaunts this issue and continues to sell phones with their own proprietary connector.&lt;/p&gt;
&lt;p&gt;I've lost count of the number of times people have asked me if I've got a phone charger. I've got Micro USB and USB-C and that will fit any phone made in the last 8 years, except the iPhone. It's not because I don't like Apple, it's because Apple refuses to support open standards. People wouldn't be as surprised if I didn't have the charger for a Nokia N-Gage, or an Ericsson T28 they would accept that it's an unusual phone and I can't hold every type of charger.&lt;/p&gt;
&lt;p&gt;The next iPhone whatever version number that might be, would be no less great a phone if it was to come with USB-C.&lt;/p&gt;
&lt;p&gt;Embrace open standard, it makes life easier for everyone.&lt;/p&gt;</content><category term="Posts"></category><category term="Standards"></category><category term="rant"></category></entry><entry><title>Hang Gliding Over Hell, 3 drives die in a 6 drive NAS</title><link href="https://xo.tc/hang-gliding-over-hell-3-drives-die-in-a-6-drive-nas.html" rel="alternate"></link><published>2017-12-07T07:00:00+08:00</published><updated>2017-12-07T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-12-07:/hang-gliding-over-hell-3-drives-die-in-a-6-drive-nas.html</id><summary type="html">&lt;p&gt;A while ago I wrote about &lt;a href="https://xo.tc/learning-from-failure.html"&gt;learning from failure&lt;/a&gt;. This is a story of failure; Hardware failure, failure of design and failure of my self (The systems administrator) to not correct the issues earlier. It's hard to write about, but I believe that stories of failure can teach us just …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A while ago I wrote about &lt;a href="https://xo.tc/learning-from-failure.html"&gt;learning from failure&lt;/a&gt;. This is a story of failure; Hardware failure, failure of design and failure of my self (The systems administrator) to not correct the issues earlier. It's hard to write about, but I believe that stories of failure can teach us just as much, if not more, than stories of successes.&lt;/p&gt;
&lt;p&gt;I inherited a system where a number of VMs were running on top of two Hyper-V hosts, with a single NAS hosting a .VHD file that was shared as an iSCSI target for the storage of the .VHDs that were the VM disks.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Hyper-V Failover Cluster" src="https://xo.tc/images/Hyper-V-Failover-Cluster.png"&gt;&lt;/p&gt;
&lt;p&gt;Now, this design is not great for a number of reasons that will become apparent throughout this post, but a few that should immediately jump out is that the one NAS provides a single point of failure, and that using a .VHD file as the iSCSI target will not provide great performance, it would be better to use the disk directly.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID All ok" src="https://xo.tc/images/RAID-all-ok.png"&gt;&lt;/p&gt;
&lt;p&gt;So the first failure is that I never upgraded this setup to something more robust, I had ample time and the budget was available but I took an attitude of "If it's not broken, don't fix it". That is the wrong attitude to have, sure no one was complaining about the performance and it was running ok so but I could have fixed all of these issues before they even started, and I did not.&lt;/p&gt;
&lt;h2 id="2017-03-01-0300-drive-in-bay-1-dies"&gt;2017-03-01 03:00 Drive in Bay 1 dies&lt;/h2&gt;
&lt;p&gt;I'm blissfully asleep, maybe I rolled over and scratch my ear.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 1 dies" src="https://xo.tc/images/RAID-bay-1-dead.png"&gt;&lt;/p&gt;
&lt;h2 id="2017-03-01-0300-servers-blue-screen"&gt;2017-03-01 03:00 Servers blue screen&lt;/h2&gt;
&lt;p&gt;In theory, because the NAS has a RAID5 + Hot Spare, everything should keep ticking along even after one drive dies. However the server froze up for just long enough the iSCSI connection timed out and the servers could no longer read and write to their disks, so all the VMs crashed.&lt;/p&gt;
&lt;p&gt;Critically this includes the Exchange server, so the email alert about a failed disk that the HP ILO should have sent goes nowhere.&lt;/p&gt;
&lt;h2 id="2017-03-01-0830-i-get-to-work-and-reboot-servers"&gt;2017-03-01 08:30 I get to work, and reboot servers&lt;/h2&gt;
&lt;p&gt;I get to work and am immediately told that nothing is working, so I remote into the Hyper-V servers and reboot all the VMs. They come back up ok and I spend a bit of time trying to work out why they failed but somehow I completely miss the fact that one of the disks in the NAS has died. I think I assumed it was related to a bad Windows Update for Hyper-V or something.&lt;/p&gt;
&lt;h2 id="2017-03-01-2100-servers-blue-screen-again"&gt;2017-03-01 21:00 Servers blue screen again&lt;/h2&gt;
&lt;p&gt;The servers bluescreen again, due to read/write timeout. Only this time the nightly backups fail to run as well.&lt;/p&gt;
&lt;h2 id="2017-03-02-0830-i-replace-drive-in-bay-1"&gt;2017-03-02 08:30 I replace drive in bay 1&lt;/h2&gt;
&lt;p&gt;I get to work and for a second day, all the servers are down. I reboot them and then I finally I see that the drive in bay 1 of the NAS is dead.  We don't have a cold spare on site so I go down to the local computer shop and buy a new drive.&lt;/p&gt;
&lt;p&gt;Fortunately, It's a RAID 5 with Hot Spare array so it has already rebuilt into the hot spare.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 1 Replaced" src="https://xo.tc/images/RAID-bay-1-rebuilding.png"&gt;&lt;/p&gt;
&lt;h2 id="2017-03-02-0945-rebuilding-at-12-hot-spare-dies-rebuilding-starts-again-at-0"&gt;2017-03-02 09:45 Rebuilding at 12% Hot spare dies. Rebuilding starts again at 0%.&lt;/h2&gt;
&lt;p&gt;I'm sitting at my desk watching the array rebuild onto the drive in Bay 1 and then suddenly... The hot spare dies. I suspect that the hot spare had actually been dodgy for a while, but because we were using RAID 5 with a Hot Spare rather than RAID 6 the disk wasn't in use and so we never got alerted that it was bad.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 1 Replaced bay 6 dies" src="https://xo.tc/images/RAID-bay-1-rebuilding-bay-6-dies.png"&gt;&lt;/p&gt;
&lt;p&gt;Fortunately, we still have enough data on the 4 remaining disks to rebuild the array but now instead of a straight copy from the hot spare to the new disk, it's got to actually calculate the parity bits all over again. So the rebuild is not running much slower.&lt;/p&gt;
&lt;p&gt;I replace the hot spare with a new blank drive.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 1 Replaced bay 6 replaced" src="https://xo.tc/images/RAID-bay-1-rebuilding-bay-6-blank.png"&gt;&lt;/p&gt;
&lt;h2 id="2017-03-02-2000-rebuilding-at-80-drive-in-bay-3-marked-predicted-failure"&gt;2017-03-02 20:00 Rebuilding at 80%. Drive in bay 3 marked "predicted failure".&lt;/h2&gt;
&lt;p&gt;I spend the rest of the day not being very productive and checking the rebuild progress every 10 minutes or so. Then at about 20:00 when I log in to have a look, the drive in bay 3 is marked as predicted failure.&lt;/p&gt;
&lt;p&gt;Last night's backups failed, tonight's backups have not run yet because I've disabled them while the array is rebuilding. But if Disk 3 dies before Disk 1 is online we won't have enough disks left to rebuild the array.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 1 Replaced bay 6 replaced bay 3 warning" src="https://xo.tc/images/RAID-bay-1-rebuilding-bay-3-warning.png"&gt;&lt;/p&gt;
&lt;h2 id="2017-03-02-2130-rebuilding-hits-100"&gt;2017-03-02 21:30 Rebuilding hits 100%&lt;/h2&gt;
&lt;p&gt;The last few minutes were nail-bitingly intense. But finally, the array has rebuilt. I start the backups and go to bed, unfortunately, the backups fail again.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 3 warning" src="https://xo.tc/images/RAID-bay-3-warning.png"&gt;&lt;/p&gt;
&lt;h2 id="2017-03-03-1000-a-consultant-comes-in"&gt;2017-03-03 10:00 A consultant comes in&lt;/h2&gt;
&lt;p&gt;Where I work I'm essentially a one-person IT team, I've got a colleague who is very technical and good to bounce ideas off, but they are not in a full time IT role. But we have an external IT consultant that we use if I need help or to cover for me while I'm away on leave, so we called the consultant in for a bit of extra support.&lt;/p&gt;
&lt;h2 id="2017-03-03-1200-we-remove-the-drive-in-bay-3-nas-crashes-we-replace-the-drive-in-bay-3"&gt;2017-03-03 12:00 We remove the drive in bay 3. NAS crashes. We replace the drive in bay 3.&lt;/h2&gt;
&lt;p&gt;After some discussion, we decide that the next step is to remove the drive in bay 3. Rather than waiting until the end of the day, or for the predicted failure, let's just pull it and get the array rebuilding onto the hot spare as soon as possible.&lt;/p&gt;
&lt;p&gt;I've pulled drives out of servers with hardware RAID before and they have been fine. I'd just recently pulled drives out of this NAS before and had no issues. But as soon as I pulled the drive out from bay 3, the NAS bluescreened and wouldn't reboot despite the fact that the OS was on a separate RAID array.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 3 removed" src="https://xo.tc/images/RAID-bay-3-removed.png"&gt;&lt;/p&gt;
&lt;p&gt;Naturally, all the VMs bluescreened as well and people were displeased that all the systems had stopped working in the middle of the day. I replaced the faulty drive back into bay 3 and then NAS booted.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 3 warning" src="https://xo.tc/images/RAID-bay-3-warning.png"&gt;&lt;/p&gt;
&lt;p&gt;We decided not to touch the NAS again during working hours.  &lt;/p&gt;
&lt;h2 id="2017-03-03-1745-i-start-manually-copying-vhd-files-off-to-usb-drive"&gt;2017-03-03 17:45 I start manually copying VHD files off to USB drive.&lt;/h2&gt;
&lt;p&gt;At this point, it's a Friday afternoon and I don't have a successful backup since Tuesday night. Veeam is failing, so I start copying the VHD files (for the VMs) onto a USB hard drive.&lt;/p&gt;
&lt;h2 id="2017-03-04-2100-copying-the-file-server-d-drive-is-still-failing-i-shut-down-the-nas-and-put-a-new-drive-in-bay-3"&gt;2017-03-04 21:00 Copying the File Server D drive is still failing. I shut down the NAS and put a new drive in bay 3.&lt;/h2&gt;
&lt;p&gt;All the servers are backed up except the File Server D drive which won't copy, but I'm running out of time. So I shut down the NAS and replace the drive in bay 3 with a blank one and the server boot. I rebuild the array offline which is quicker than while it's running but still slow.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RAID bay 3 rebuilding" src="https://xo.tc/images/RAID-bay-3-rebuilding.png"&gt;&lt;/p&gt;
&lt;h2 id="2017-03-05-0800-array-is-rebuilt-file-server-d-drive-is-still-failing"&gt;2017-03-05 08:00 Array is rebuilt, File Server D drive is still failing&lt;/h2&gt;
&lt;p&gt;&lt;img alt="RAID All ok" src="https://xo.tc/images/RAID-all-ok.png"&gt;&lt;/p&gt;
&lt;p&gt;The array is back up and looking healthy. But Veeam is still failing to back up the fileserver D drive.&lt;/p&gt;
&lt;h2 id="2017-03-05-1900-chkdsk-f-file-server-d-overnight"&gt;2017-03-05 19:00 chkdsk /f File Server D overnight&lt;/h2&gt;
&lt;p&gt;I had to shut all the servers down, unmount the iSCSI drive and run &lt;code&gt;chkdsk /f&lt;/code&gt;, it runs over the whole night and finally finishes only to report no errors on NAS. But the Fileserver D drive backups are still failing.&lt;/p&gt;
&lt;h2 id="2017-03-06-0700-chkdsk-r-on-the-nas"&gt;2017-03-06 07:00 chkdsk /R on the NAS&lt;/h2&gt;
&lt;p&gt;Luckily Monday was a public holiday and I could continue to work leave the VMs shutdown and work on the NAS without causing interruptions to staff, so first thing in the morning I start &lt;code&gt;chkdsk /r&lt;/code&gt;. I wrote about &lt;a href="https://xo.tc/veeam-backup-errors-after-nas-hard-drive-failure.html"&gt;Veeam backup errors after NAS hard drive failure&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="2017-03-06-2000-chkdsk-finishes-i-boot-all-servers-and-start-a-backup"&gt;2017-03-06 20:00 chkdsk finishes. I boot all servers and start a backup.&lt;/h2&gt;
&lt;p&gt;Finally chkdsk finishes and reports that it's fixed a number of issues. I still don't know for sure that I've fixed the issue with the backups but I'm feeling a little better.&lt;/p&gt;
&lt;h2 id="2017-03-07-0600-file-server-d-finishes-the-backup"&gt;2017-03-07 06:00 File server D finishes the backup.&lt;/h2&gt;
&lt;p&gt;Finally, I can breathe a huge sigh of relief after a full week of outages and issues everything seems to be running normally again.&lt;/p&gt;
&lt;h2 id="over-the-next-few-months"&gt;Over the next few months&lt;/h2&gt;
&lt;p&gt;Over the new few months, I worked to decommission this setup and move to a more robust design, including shutting down our VMs and migrating many of our services to the cloud. This system is now thankfully no longer in use and I can sleep easier knowing I will never again need to go through that ordeal.&lt;/p&gt;
&lt;p&gt;Also importantly, I've learned the hard way about the importance of proactive maintenance and not having a single point of failure. Fortunately, in this case, there was no data loss, but it came far too close for comfort.&lt;/p&gt;</content><category term="Posts"></category><category term="Failure"></category><category term="Storage"></category><category term="Windows"></category><category term="Backups"></category><category term="Veeam"></category></entry><entry><title>The bicycle side channel</title><link href="https://xo.tc/the-bicycle-side-channel.html" rel="alternate"></link><published>2017-11-30T07:00:00+08:00</published><updated>2017-11-30T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-11-30:/the-bicycle-side-channel.html</id><summary type="html">&lt;p&gt;There is a problem with most cryptographic systems, it's not new and it affects most systems.&lt;/p&gt;
&lt;p&gt;Most formal definitions of a "Perfect security" within cryptography (think One Time Pads) still allow for a few things to be leaked; the size of the messages, the sender and receiver of the messages …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a problem with most cryptographic systems, it's not new and it affects most systems.&lt;/p&gt;
&lt;p&gt;Most formal definitions of a "Perfect security" within cryptography (think One Time Pads) still allow for a few things to be leaked; the size of the messages, the sender and receiver of the messages, and the frequency and number of the messages. These are generally considered out of scope and seen as a protocol problem, not a cryptography one.&lt;/p&gt;
&lt;p&gt;When I was first introduced to this problem it was called the "The bicycle side channel". Imagine that Alice and Bob have brought their daughter Eve a bicycle for Christmas along with some other presents. They have wrapped all the gifts up in wrapping paper and placed them Christmas tree.&lt;/p&gt;
&lt;p&gt;Eve is curious about what gifts might be coming for Christmas but doesn't want to tear the wrapping paper because then her parents will find out that she has peaked. But she can count the number of presents, and she can look at the labels to see who they are from and who they are for, and with one gift she can tell from the shape that it's a bicycle. Maybe she can't tell what colour it is, or which brand, but even wrapped in paper it still looks like a bike.&lt;/p&gt;
&lt;p&gt;Consider the image below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Image Name" src="https://xo.tc/images/giftwrapped-airliner.png"&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt;   &lt;a href="https://commons.wikimedia.org/wiki/File:Alliance_Airlines_Fokker_F70_wrapped_up_at_Brisbane_Airport_%28cropped%29.jpg"&gt;Brisbane Airport, Photographer Sarah Whyte&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Despite the fact that it's entirely gift wrapped, even with a little bow around it. I think most people can still work out that it's an airliner. Those of you who know a lot about aviation might even be able to work out that it's a Fokker F70 based on things like the shape and height of the wings. Sure you might not be able to read the registration number on the tail but you still know what it is.&lt;/p&gt;
&lt;p&gt;To bring this metaphor back to cryptosystems imagine the Tor network is just starting off and there are only 5 users currently connected. Four are reading Wikipedia articles, and one is watching YouTube. If you saw a graph of how much traffic was going to and from each node, you could easily work out which user was watching YouTube.&lt;/p&gt;
&lt;p&gt;As the size of the network grows this get more complex but there was some serious research into decloaking Tor users with nothing more than &lt;a href="https://blog.torproject.org/traffic-correlation-using-netflows"&gt;Cisco NetFlow&lt;/a&gt;. There was another great &lt;a href="https://guidovranken.files.wordpress.com/2015/12/https-bicycle-attack.pdf"&gt;paper&lt;/a&gt; that looked at the information leaked by HTTPS connections just based on the size of the messages.&lt;/p&gt;
&lt;p&gt;Some networks such as &lt;a href="https://geti2p.net/"&gt;I2P&lt;/a&gt; do take this into account and try to send fixed size (padded) messages at a fixed interval so while the I2P router is running it will be relaying messages or just sending and receiving junk to make it hard to tell when a connection is actively being used let alone who is doing what. Of course, this is a trade-off between performance of the network and secrecy and in system design, you need to choose do you try to foil metadata analysis or do you try for maximum performance.&lt;/p&gt;</content><category term="Posts"></category><category term="Cryptography"></category><category term="Tor"></category><category term="I2P"></category><category term="metadata"></category></entry><entry><title>Installing Duplicati on an Arch Linux Laptop</title><link href="https://xo.tc/installing-duplicati-on-an-arch-linux-laptop.html" rel="alternate"></link><published>2017-11-23T07:00:00+08:00</published><updated>2017-11-23T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-11-23:/installing-duplicati-on-an-arch-linux-laptop.html</id><summary type="html">&lt;p&gt;For this setup I'm using &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt; to backup to &lt;a href="https://www.backblaze.com"&gt;Backblaze&lt;/a&gt;. In a previous post I've written some &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="installing"&gt;Installing&lt;/h2&gt;
&lt;p&gt;To install Duplicati simply run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://aur.archlinux.org/duplicati-latest.git
cd duplicati-latest
makepkg -si
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then enable and start the service&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl enable duplicati …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;For this setup I'm using &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt; to backup to &lt;a href="https://www.backblaze.com"&gt;Backblaze&lt;/a&gt;. In a previous post I've written some &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="installing"&gt;Installing&lt;/h2&gt;
&lt;p&gt;To install Duplicati simply run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://aur.archlinux.org/duplicati-latest.git
cd duplicati-latest
makepkg -si
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then enable and start the service&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl enable duplicati.service
sudo systemctl start duplicati.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="setup-backups"&gt;Setup Backups&lt;/h2&gt;
&lt;p&gt;Once duplicati has started browse to &lt;a href="http://localhost:8200"&gt;http://localhost:8200&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The first message I got on Arch was asking if duplicati would be running on a multi-user system. I picked "No, my machine only has a single account".&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch Multi-User" src="https://xo.tc/images/duplicati-arch-01-multi-user.png"&gt;&lt;/p&gt;
&lt;p&gt;Now click on Add Backup &amp;gt; Configure a new backup &amp;gt; Next&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch New Backup" src="https://xo.tc/images/duplicati-arch-02-new-backup.png"&gt;&lt;/p&gt;
&lt;p&gt;Give your backups a name, you don't need to use encryption but I'd highly recommend it, and I'd also recommend using their password generator and saving the password in a password manager.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch Setup General" src="https://xo.tc/images/duplicati-arch-03-settings-general.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick B2 Cloud Storage, put in your Bucket Name, a folder path, your account ID and your application key (from the &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;). It's also a good idea to test your connection before continuing.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch Setup Destination" src="https://xo.tc/images/duplicati-arch-04-settings-destination.png"&gt;&lt;/p&gt;
&lt;p&gt;Select your source data&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch Setup Source Data" src="https://xo.tc/images/duplicati-arch-05-settings-source-data.png"&gt;&lt;/p&gt;
&lt;p&gt;Setup a schedule that works for you, the default on of once a day is pretty reasonable for most personal backups.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch Setup Schedule" src="https://xo.tc/images/duplicati-arch-06-settings-schedule.png"&gt;&lt;/p&gt;
&lt;p&gt;Unless you have a reason to change them I'd leave the default options.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Arch Setup Options" src="https://xo.tc/images/duplicati-arch-07-settings-options.png"&gt;&lt;/p&gt;
&lt;p&gt;And your done, you can hit Run now to start the backups or just wait for the schedule to kick in.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup" src="https://xo.tc/images/duplicati-arch-08-finished.png"&gt;&lt;/p&gt;
&lt;p&gt;It's that easy.&lt;/p&gt;</content><category term="Posts"></category><category term="Duplicati"></category><category term="Backblaze"></category><category term="Backups"></category><category term="Cloud"></category><category term="Linux"></category><category term="Arch Linux"></category></entry><entry><title>Installing Duplicati on a headless Debian Linux server</title><link href="https://xo.tc/installing-duplicati-on-a-headless-debian-linux-server.html" rel="alternate"></link><published>2017-11-16T07:00:00+08:00</published><updated>2017-11-16T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-11-16:/installing-duplicati-on-a-headless-debian-linux-server.html</id><summary type="html">&lt;p&gt;For this setup I'm using &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt; to backup to &lt;a href="https://www.backblaze.com"&gt;Backblaze&lt;/a&gt;. In a previous post I've written some &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="ssh-into-the-server"&gt;SSH into the server&lt;/h2&gt;
&lt;p&gt;The first thing we have to do is to SSH into the server, because Duplicati will be running as a web service on port …&lt;/p&gt;</summary><content type="html">&lt;p&gt;For this setup I'm using &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt; to backup to &lt;a href="https://www.backblaze.com"&gt;Backblaze&lt;/a&gt;. In a previous post I've written some &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="ssh-into-the-server"&gt;SSH into the server&lt;/h2&gt;
&lt;p&gt;The first thing we have to do is to SSH into the server, because Duplicati will be running as a web service on port 8200 we need to forward connections to that port. Because I've already got Duplicati running on my desktop port 8200 is already taken so I'm going to be forwarding port 8000 on my desktop to port 8200 on the headless Linux server.&lt;/p&gt;
&lt;p&gt;In PuTTY open go to Connections &amp;gt; SSH &amp;gt; Tunnels&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Putty Forwarding Ports" src="https://xo.tc/images/duplicati-debian-01-putty-setup.png"&gt;&lt;/p&gt;
&lt;p&gt;Set the source port to &lt;code&gt;8000&lt;/code&gt; and the destination to &lt;code&gt;localhost:8200&lt;/code&gt; then hit Add&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Putty Forwarding Ports" src="https://xo.tc/images/duplicati-debian-02-putty-setup.png"&gt;&lt;/p&gt;
&lt;p&gt;Or if your SSHing in from a Linux desktops then use &lt;code&gt;ssh example.com -L 8000:localhost:8200&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="installing"&gt;Installing&lt;/h2&gt;
&lt;p&gt;Head over to the &lt;a href="https://www.duplicati.com/download"&gt;Duplicati download page&lt;/a&gt; and copy the link to the Debian installer (in Firefox you can right click &amp;gt; copy link location)&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati download" src="https://xo.tc/images/duplicati-debian-03-link-location.png"&gt;&lt;/p&gt;
&lt;p&gt;Then download the file on the server&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;wget&lt;span class="w"&gt; &lt;/span&gt;https://updates.duplicati.com/beta/duplicati_2.0.2.1-1_all.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then run the installer using apt (not &lt;code&gt;apt-get&lt;/code&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;apt&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;./duplicati_2.0.2.1-1_all.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you don't already have Mono installed this will bring a lot of dependencies with it.&lt;/p&gt;
&lt;p&gt;Finally enable and start the service&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;systemctl&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;enable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;duplicati.service
sudo&lt;span class="w"&gt; &lt;/span&gt;systemctl&lt;span class="w"&gt; &lt;/span&gt;start&lt;span class="w"&gt; &lt;/span&gt;duplicati.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I found I needed to wait about 45 seconds for the service to start accepting connections.&lt;/p&gt;
&lt;h2 id="setup-backups"&gt;Setup Backups&lt;/h2&gt;
&lt;p&gt;Once Duplicati is installed open your web browser and go to &lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian Home" src="https://xo.tc/images/duplicati-debian-04-setup-home.png"&gt;&lt;/p&gt;
&lt;p&gt;Click on Add Backup &amp;gt; Configure a new backup &amp;gt; Next&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian New Backup" src="https://xo.tc/images/duplicati-debian-05-setup-new-backup.png"&gt;&lt;/p&gt;
&lt;p&gt;Give your backups a name, you don't need to use encryption but I'd highly recommend it, and I'd also recommend using their password generator and saving the password in a password manager.&lt;/p&gt;
&lt;p&gt;&lt;img alt="uplicati Debian Setup General" src="https://xo.tc/images/duplicati-debian-06-setup-general.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick B2 Cloud Storage, put in your Bucket Name, a folder path, your account ID and your application key (from the &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;). It's also a good idea to test your connection before continuing.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian Setup Destination" src="https://xo.tc/images/duplicati-debian-07-setup-destination.png"&gt;&lt;/p&gt;
&lt;p&gt;Select your source data&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian Setup Source Data" src="https://xo.tc/images/duplicati-debian-08-setup-source-data.png"&gt;&lt;/p&gt;
&lt;p&gt;Setup a schedule that works for you, the default on of once a day is pretty reasonable for most personal backups.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian Setup Schedule" src="https://xo.tc/images/duplicati-debian-09-setup-schedule.png"&gt;&lt;/p&gt;
&lt;p&gt;Unless you have a reason to change them I'd leave the default options.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian Setup Options" src="https://xo.tc/images/duplicati-debian-10-setup-options.png"&gt;&lt;/p&gt;
&lt;p&gt;And your done, you can hit Run now to start the backups or just wait for the schedule to kick in.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Debian Setup Finished" src="https://xo.tc/images/duplicati-debian-11-finished.png"&gt;&lt;/p&gt;
&lt;p&gt;It's that easy.&lt;/p&gt;</content><category term="Posts"></category><category term="Duplicati"></category><category term="Backblaze"></category><category term="Backups"></category><category term="Cloud"></category><category term="Windows"></category><category term="PuTTY"></category><category term="Linux"></category><category term="Debian"></category></entry><entry><title>Installing Duplicati on Windows 10</title><link href="https://xo.tc/installing-duplicati-on-windows-10.html" rel="alternate"></link><published>2017-11-09T07:00:00+08:00</published><updated>2017-11-09T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-11-09:/installing-duplicati-on-windows-10.html</id><summary type="html">&lt;p&gt;For this setup I'm using &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt; to backup to &lt;a href="https://www.backblaze.com"&gt;Backblaze&lt;/a&gt;. In a previous post I've written some &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="install"&gt;Install&lt;/h2&gt;
&lt;p&gt;First head on over to &lt;a href="https://www.duplicati.com/download"&gt;Duplicati&lt;/a&gt; and download the latest version for Windows (at the time of this writing that's 2.0.2.1)&lt;/p&gt;
&lt;p&gt;Start the installer …&lt;/p&gt;</summary><content type="html">&lt;p&gt;For this setup I'm using &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt; to backup to &lt;a href="https://www.backblaze.com"&gt;Backblaze&lt;/a&gt;. In a previous post I've written some &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="install"&gt;Install&lt;/h2&gt;
&lt;p&gt;First head on over to &lt;a href="https://www.duplicati.com/download"&gt;Duplicati&lt;/a&gt; and download the latest version for Windows (at the time of this writing that's 2.0.2.1)&lt;/p&gt;
&lt;p&gt;Start the installer&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Installer" src="https://xo.tc/images/duplicati-windows-01-installer.png"&gt;&lt;/p&gt;
&lt;p&gt;Accept the GPL License&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows License" src="https://xo.tc/images/duplicati-windows-02-gpl-license.png"&gt;&lt;/p&gt;
&lt;p&gt;Accept the default setup&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup" src="https://xo.tc/images/duplicati-windows-03-setup.png"&gt;&lt;/p&gt;
&lt;p&gt;Click on Install&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Install" src="https://xo.tc/images/duplicati-windows-04-install.png"&gt;&lt;/p&gt;
&lt;p&gt;Hit Finish to launch Duplicati&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Install" src="https://xo.tc/images/duplicati-windows-05-install-finished.png"&gt;&lt;/p&gt;
&lt;h2 id="launch"&gt;Launch&lt;/h2&gt;
&lt;p&gt;Duplicati should automatically launch in your default web browser after installing. If it doesn't, simply open your web browser and go to &lt;a href="http://localhost:8200/ngax/index.html"&gt;http://localhost:8200/ngax/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Home" src="https://xo.tc/images/duplicati-windows-06-home.png"&gt;&lt;/p&gt;
&lt;h2 id="setup-backups"&gt;Setup backups&lt;/h2&gt;
&lt;p&gt;Click on Add Backup &amp;gt; Configure a new backup &amp;gt; Next&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows New Backup" src="https://xo.tc/images/duplicati-windows-07-add-backup.png"&gt;&lt;/p&gt;
&lt;p&gt;Give your backups a name, you don't need to use encryption but I'd highly recommend it, and I'd also recommend using their password generator and saving the password in a password manager.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup General" src="https://xo.tc/images/duplicati-windows-08-setup-general.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick B2 Cloud Storage, put in your Bucket Name, a folder path, your account ID and your application key (from the &lt;a href="https://xo.tc/setting-up-backblaze-for-duplicati.html"&gt;instructions on setting up Backblaze&lt;/a&gt;). It's also a good idea to test your connection before continuing.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup Destination" src="https://xo.tc/images/duplicati-windows-09-setup-destination.png"&gt;&lt;/p&gt;
&lt;p&gt;Select your source data&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup Source Data" src="https://xo.tc/images/duplicati-windows-10-setup-source-data.png"&gt;&lt;/p&gt;
&lt;p&gt;Setup a schedule that works for you, the default on of once a day is pretty reasonable for most personal backups.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup Schedule" src="https://xo.tc/images/duplicati-windows-11-setup-schedule.png"&gt;&lt;/p&gt;
&lt;p&gt;Unless you have a reason to change them I'd leave the default options.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup Options" src="https://xo.tc/images/duplicati-windows-12-setup-options.png"&gt;&lt;/p&gt;
&lt;p&gt;And your done, you can hit Run now to start the backups or just wait for the schedule to kick in.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup" src="https://xo.tc/images/duplicati-windows-13-setup-run-now.png"&gt;&lt;/p&gt;
&lt;p&gt;It's that easy.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Duplicati Windows Setup Finished" src="https://xo.tc/images/duplicati-windows-14-running.png"&gt;&lt;/p&gt;</content><category term="Posts"></category><category term="Duplicati"></category><category term="Backblaze"></category><category term="Backups"></category><category term="CrashPlan"></category><category term="Cloud"></category><category term="Windows"></category></entry><entry><title>Setting up Backblaze for Duplicati</title><link href="https://xo.tc/setting-up-backblaze-for-duplicati.html" rel="alternate"></link><published>2017-11-02T07:00:00+08:00</published><updated>2017-11-02T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-11-02:/setting-up-backblaze-for-duplicati.html</id><summary type="html">&lt;p&gt;I've been &lt;a href="https://xo.tc/crashplan-personal-is-shutting-down.html"&gt;looking&lt;/a&gt; for new backup software for a few months and I've found &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt;. I'm absolutely stoked with it, it does everything I want from backup software.&lt;/p&gt;
&lt;p&gt;Duplicati can backup to a number of different locations and there are several cloud options but I've chosen to go with &lt;a href="https://www.backblaze.com/"&gt;Backblaze …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've been &lt;a href="https://xo.tc/crashplan-personal-is-shutting-down.html"&gt;looking&lt;/a&gt; for new backup software for a few months and I've found &lt;a href="https://www.duplicati.com/"&gt;Duplicati&lt;/a&gt;. I'm absolutely stoked with it, it does everything I want from backup software.&lt;/p&gt;
&lt;p&gt;Duplicati can backup to a number of different locations and there are several cloud options but I've chosen to go with &lt;a href="https://www.backblaze.com/"&gt;Backblaze&lt;/a&gt;. I like them because they are extremely open with the design of their &lt;a href="https://www.backblaze.com/b2/storage-pod.html"&gt;Storage Pods&lt;/a&gt;. Not just on how they work but releasing all the information you need to go and actually build one yourself.&lt;/p&gt;
&lt;p&gt;It doesn't hurt that Backblaze are &lt;a href="https://www.backblaze.com/b2/cloud-storage-pricing.html"&gt;cheaper&lt;/a&gt; than Amazon S3&lt;sup id="fnref:cheaper"&gt;&lt;a class="footnote-ref" href="#fn:cheaper"&gt;1&lt;/a&gt;&lt;/sup&gt; and will &lt;a href="https://www.backblaze.com/restore.html"&gt;mail you&lt;/a&gt; a hard drive with your data. Something that CrashPlan &lt;a href="https://xo.tc/crashplan-no-longer-offer-restore-to-door-service.html"&gt;used to do&lt;/a&gt; until a few years ago.&lt;/p&gt;
&lt;h2 id="signing-up-to-backblaze"&gt;Signing up to Backblaze&lt;/h2&gt;
&lt;p&gt;So the first part of setting up Duplicati is setting somewhere to send your backups to, head over to the Backblaze B2 &lt;a href="https://www.backblaze.com/b2/cloud-storage.html"&gt;sign up page&lt;/a&gt; and click Sign up today&lt;/p&gt;
&lt;p&gt;&lt;img alt="Sign up to backblaze" src="https://xo.tc/images/backblaze-b2-signup-1.png"&gt;&lt;/p&gt;
&lt;p&gt;Put in a username and password&lt;sup id="fnref:password"&gt;&lt;a class="footnote-ref" href="#fn:password"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Sign up to backblaze - password" src="https://xo.tc/images/backblaze-b2-signup-2-username-and-password.png"&gt;&lt;/p&gt;
&lt;p&gt;I was told I needed a phone number&lt;/p&gt;
&lt;p&gt;&lt;img alt="Sign up to backblaze - phone" src="https://xo.tc/images/backblaze-b2-signup-3-phone-number.png"&gt;&lt;/p&gt;
&lt;p&gt;So I entered my phone number&lt;/p&gt;
&lt;p&gt;&lt;img alt="Sign up to backblaze - phone" src="https://xo.tc/images/backblaze-b2-signup-4-phone-number-code.png"&gt;&lt;/p&gt;
&lt;p&gt;and enabled 2-factor authentication&lt;/p&gt;
&lt;p&gt;&lt;img alt="Sign up to backblaze - 2-factor authentication" src="https://xo.tc/images/backblaze-b2-signup-5-two-factor.png"&gt;&lt;/p&gt;
&lt;h2 id="create-a-bucket"&gt;Create a bucket&lt;/h2&gt;
&lt;p&gt;Next go to Buckets &amp;gt; Create a Bucket&lt;/p&gt;
&lt;p&gt;&lt;img alt="backblaze - Create Bucket" src="https://xo.tc/images/backblaze-b2-create-bucket.png"&gt;&lt;/p&gt;
&lt;p&gt;Once the bucket is created click on "Show Account ID and Application Key" then "Create Application Key".&lt;/p&gt;
&lt;p&gt;&lt;img alt="backblaze - Account ID and Application Key" src="https://xo.tc/images/backblaze-b2-account-id-and-application-key.png"&gt;&lt;/p&gt;
&lt;p&gt;Record this Application Key and keep it safe, we will need it to setup Duplicati&lt;/p&gt;
&lt;p&gt;Now we are ready to install Duplicati. Over the next few weeks I'm going to do posts on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installing Duplicati on Windows 10&lt;/li&gt;
&lt;li&gt;Installing Duplicati on a headless Debian Linux server&lt;/li&gt;
&lt;li&gt;Installing Duplicati on an Arch Linux Laptop&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:cheaper"&gt;
&lt;p&gt;and the same price as Amazon Glacier in Sydney&amp;#160;&lt;a class="footnote-backref" href="#fnref:cheaper" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:password"&gt;
&lt;p&gt;I found that passwords are limited to 50 characters, which isn't great but it's not too restrictive.&amp;#160;&lt;a class="footnote-backref" href="#fnref:password" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Duplicati"></category><category term="Backblaze"></category><category term="Backups"></category><category term="CrashPlan"></category><category term="Cloud"></category></entry><entry><title>Just use subdomains</title><link href="https://xo.tc/just-use-subdomains.html" rel="alternate"></link><published>2017-10-26T07:00:00+08:00</published><updated>2017-10-26T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-10-26:/just-use-subdomains.html</id><summary type="html">&lt;p&gt;Recently Brian Krebs &lt;a href="https://krebsonsecurity.com/2017/10/dell-lost-control-of-key-customer-support-domain-for-a-month-in-2017/"&gt;ran a story&lt;/a&gt; about a domain that dell forgot to renew and lost control of for a period of time.&lt;/p&gt;
&lt;p&gt;One thing that I noticed from the story was that the domain was DellBackupAndRecoveryCloudStorage.com.&lt;/p&gt;
&lt;p&gt;I have no idea why large organisations insist on registering new domains …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently Brian Krebs &lt;a href="https://krebsonsecurity.com/2017/10/dell-lost-control-of-key-customer-support-domain-for-a-month-in-2017/"&gt;ran a story&lt;/a&gt; about a domain that dell forgot to renew and lost control of for a period of time.&lt;/p&gt;
&lt;p&gt;One thing that I noticed from the story was that the domain was DellBackupAndRecoveryCloudStorage.com.&lt;/p&gt;
&lt;p&gt;I have no idea why large organisations insist on registering new domains like that, DellBackupAndRecoveryCloudStorage.com could so easily be part of a command and control system just trying to stay stealthy. I remember the recent launch of AmazonLightsail.com, my first though was "is this a phishing domain"? Anyone could have registered these domains, it could be Jo from down the street.&lt;/p&gt;
&lt;p&gt;Why not setup BackupAndRecoveryCloudStorage.dell.com or use lightsail.aws.amazon.com? That way it's clear who controls the domain, and makes life easier for network admins that want whitelist, filter or inspect traffic.&lt;/p&gt;</content><category term="Posts"></category><category term="DNS"></category></entry><entry><title>Email addresses with apostrophes and mail loops</title><link href="https://xo.tc/email-addresses-with-apostrophes-and-mail-loops.html" rel="alternate"></link><published>2017-10-19T07:00:00+08:00</published><updated>2017-10-19T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-10-19:/email-addresses-with-apostrophes-and-mail-loops.html</id><summary type="html">&lt;p&gt;Recently we encountered an issue sending an email from one domain, hosted on Office 365 to another domain also hosted on Office 365. The destination email address had an apostrophe e.g. tim.o'reilly@example.org and we were getting the error message. &lt;code&gt;554 5.4.14 Hop count exceeded …&lt;/code&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently we encountered an issue sending an email from one domain, hosted on Office 365 to another domain also hosted on Office 365. The destination email address had an apostrophe e.g. tim.o'reilly@example.org and we were getting the error message. &lt;code&gt;554 5.4.14 Hop count exceeded - possible mail loop&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When we removed the apostrophe from the email address the email got through ok.&lt;/p&gt;
&lt;p&gt;But the error message still didn't make sense to me. Firstly, while rare an email address with an apostrophe is &lt;a href="https://en.wikipedia.org/wiki/Email_address#Examples"&gt;technically valid&lt;/a&gt;. And secondly if an address doesn't exist I would expect a &lt;code&gt;550 5.1.10 Recipient not found&lt;/code&gt; or similar message rather than "Hop count exceeded".&lt;/p&gt;
&lt;p&gt;As it turned out the apostrophe was a red herring. The destination domain was a hybrid Office 365 deployment, and for any address where the local part did not exist Office 365, the mail was forwarded to the onsite server, which in turn would forward to the Office 365 server.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mail Loop" src="https://xo.tc/images/mail-loop.png"&gt;&lt;/p&gt;
&lt;p&gt;After getting this error, I tried a few different mail serves with apostrophes and that Office 365, Gmail, EXIM4 on Debian and Yahoo Mail all work ok with apostrophes.&lt;/p&gt;</content><category term="Posts"></category><category term="Email"></category><category term="Microsoft"></category><category term="Google"></category><category term="SMTP"></category><category term="Office 365"></category></entry><entry><title>A national identity system</title><link href="https://xo.tc/a-national-identity-system.html" rel="alternate"></link><published>2017-10-12T07:00:00+08:00</published><updated>2017-10-12T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-10-12:/a-national-identity-system.html</id><summary type="html">&lt;p&gt;A national identity system is something I've been thinking about a lot lately. No real answers here, just musings...&lt;/p&gt;
&lt;h2 id="the-problem"&gt;The Problem&lt;/h2&gt;
&lt;p&gt;There are many departments at all levels of Government that need to track people for various reasons, but each implements its own system and no system is universal;&lt;/p&gt;
&lt;h2 id="the-status-quo"&gt;The …&lt;/h2&gt;</summary><content type="html">&lt;p&gt;A national identity system is something I've been thinking about a lot lately. No real answers here, just musings...&lt;/p&gt;
&lt;h2 id="the-problem"&gt;The Problem&lt;/h2&gt;
&lt;p&gt;There are many departments at all levels of Government that need to track people for various reasons, but each implements its own system and no system is universal;&lt;/p&gt;
&lt;h2 id="the-status-quo"&gt;The status quo&lt;/h2&gt;
&lt;p&gt;In the United States of America, a Social Security is the de facto standard, CGP Grey made a great video &lt;a href="https://www.youtube.com/watch?v=Erp8IAUouus"&gt;Social Security Cards Explained&lt;/a&gt; which covers some of the problems with that.&lt;/p&gt;
&lt;p&gt;In Australia,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At the Federal level, there is the Australian Tax Office, with whom most people have a Tax File Number.&lt;/li&gt;
&lt;li&gt;At the State level, there are the Licensing Departments, with whom most people have a Drivers License (and specifically a drivers license number)&lt;/li&gt;
&lt;li&gt;At the Local level, there are the local councils, to whom homeowners pay council rates and each council has its own way of tracking people.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While things like a &lt;abbr title="Tax File Number"&gt;TFN&lt;/abbr&gt;, a passport or a drivers license number might cover 90% of the Australian adult population there will be many people that don't have these.&lt;/p&gt;
&lt;h2 id="the-ultimate-id-card"&gt;The ultimate ID card&lt;/h2&gt;
&lt;p&gt;I can imagine a national identity system where people get an ID card that is a veritable &lt;a href="https://en.wikipedia.org/wiki/Swiss_Army_knife"&gt;Swiss Army knife&lt;/a&gt; of modern identity.&lt;/p&gt;
&lt;p&gt;The card would have all the usual things on an ID card;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Photo&lt;/li&gt;
&lt;li&gt;Full Name&lt;/li&gt;
&lt;li&gt;Date of birth&lt;/li&gt;
&lt;li&gt;Unique ID number&lt;sup id="fnref:Unique-ID"&gt;&lt;a class="footnote-ref" href="#fn:Unique-ID"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Validity Dates&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But the card would also have NFC, with a certificate and private key stored on the card.&lt;/p&gt;
&lt;p&gt;The certificate would contain the same information that's visible on the card (e.g. Photo, name, etc...).&lt;/p&gt;
&lt;p&gt;Much like with TLS, the certificate would need to be signed by a trusted Certification Authority (e.g. The Federal Government) which would also need to publish a public Certificate Revocation List (&lt;abbr title="Certificate Revocation List"&gt;CRL&lt;/abbr&gt;) for things like lost or stolen cards.&lt;/p&gt;
&lt;h2 id="the-utopian-vision"&gt;The utopian vision&lt;/h2&gt;
&lt;p&gt;To make this vision truly utopian, the standards used by the card would all need to be fully open and public. That way anyone could make use of the cards, not just the Government.&lt;/p&gt;
&lt;p&gt;At the moment I've got about a dozen ID cards in my a wallet. An RFID card the building I work in, A Mifare card for our public transport system, my driver's license and so on.&lt;/p&gt;
&lt;p&gt;Imagine if I could just give my Unique ID number to my employer, who could add that into the system and I could use my Government issued ID card to open the doors at work. I could use that same card for public transport, my local library, my driver's license&lt;sup id="fnref:drivers-license"&gt;&lt;a class="footnote-ref" href="#fn:drivers-license"&gt;2&lt;/a&gt;&lt;/sup&gt;, or the Hackerspace down the road.&lt;/p&gt;
&lt;p&gt;Better yet if you're using a PC / laptop / smartphone with NFC, the card could act as a &lt;a href="https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html"&gt;universal second factor&lt;/a&gt;. You swipe your ID card over an NFC reader, which gives the "Something you have" and automatically populates your username, and then enter your password.&lt;/p&gt;
&lt;p&gt;There is no reason this would have to be just one country. If the standards were open and public any nation (or anyone at all) could start issuing compatible cards. Want your system to accept cards from Bangladesh? No problem just add their root CA. Don't trust "Honest Abe's Legitimate Card Issuing Authority"? not a problem, don't add their CA to your root trust.&lt;/p&gt;
&lt;p&gt;The possibilities are endless, software companies could build it into their system. What if Adobe Reader (or your PDF viewer of choice) added a way you could use your card to add a cryptographic signature to documents. Just click sign, wave your card over an NFC reader and you're done.&lt;/p&gt;
&lt;p&gt;Sure someone could steal your card an sign a document, but it's got to be better than the scanned image of pen on paper that we use now. And that segues nicely into...&lt;/p&gt;
&lt;h2 id="problems-with-this-system"&gt;Problems with this system&lt;/h2&gt;
&lt;p&gt;There are many problems with this system, but I feel they fall broadly into two main categories, &lt;strong&gt;Privacy implications&lt;/strong&gt; and &lt;strong&gt;Implementation issues&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id="implementation-issues"&gt;Implementation issues&lt;/h3&gt;
&lt;p&gt;I'm not going to dig too much into the implementation issues. Suffice to say implementing a system like this would be a herculean task, wouldn't trust commercial companies with vast resources and great expertise like Google or Apple to implement a system like this without at least some hiccups and flaws. Let alone a federal government agency where this sort of project would instantly become a political football and important bits get outsourced to the lowest bidder.&lt;/p&gt;
&lt;h3 id="privacy-implications"&gt;Privacy implications&lt;/h3&gt;
&lt;p&gt;More interesting to look at are the privacy implications. All through my utopian vision, I've assumed a benevolent government, one that builds roads, schools, hospitals, provides social services and support for people in need.&lt;/p&gt;
&lt;p&gt;But even if we have a benevolent government today, there is no guarantee we won't have a tyrannical dictator next year.&lt;/p&gt;
&lt;p&gt;A national identity card would be a very invasive, especially one that could be tracked each time you use it, by making a query back to base. It might not be quite as &lt;a href="https://en.wikipedia.org/wiki/Orwellian"&gt;Orwellian&lt;/a&gt; as rolling out a &lt;a href="https://www.efa.org.au/2017/10/07/no-safer-with-facial-recognition/"&gt;national facial recognition database&lt;/a&gt; but in the near future, we are going to have to ask ourselves.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Do we want to trade the privacy that comes with having many, simple, siloed identity systems; for the convenience and efficiency that could come from a unified digital identity system?&lt;/strong&gt;&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:Unique-ID"&gt;
&lt;p&gt;Actually I'm thinking that it would need two Unique ID's one on the front that says the same for the life of the cardholder, and one on the back that's unique for each card, and would be the fingerprint of the public key.&amp;#160;&lt;a class="footnote-backref" href="#fnref:Unique-ID" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:drivers-license"&gt;
&lt;p&gt;The idea here is you could read the NFC tag on a tablet which queries a license database (over a public API) and a screen pops up with my name, photo and what types of vehicles I'm allowed to drive. To stop people bulk querying the database, each query would need to be signed by the private key on the card it's looking for, so you would need physical access to the card to query the details.&amp;#160;&lt;a class="footnote-backref" href="#fnref:drivers-license" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Identity"></category><category term="Australia"></category></entry><entry><title>SEO spear spamming</title><link href="https://xo.tc/seo-spear-spamming.html" rel="alternate"></link><published>2017-10-05T07:00:00+08:00</published><updated>2017-10-05T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-10-05:/seo-spear-spamming.html</id><summary type="html">&lt;p&gt;I've recently started receiving a new type of spam&lt;sup id="fnref:new-type-of-spam"&gt;&lt;a class="footnote-ref" href="#fn:new-type-of-spam"&gt;1&lt;/a&gt;&lt;/sup&gt;. It's fairly targeted, so like spear phishing, I'd call this stuff spear spamming.&lt;/p&gt;
&lt;p&gt;Instead of regular spam which usually falls into categories like "Buy pills online", "Meet single ladies tonight" and "Open this malware laced attachment" this one is sent …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've recently started receiving a new type of spam&lt;sup id="fnref:new-type-of-spam"&gt;&lt;a class="footnote-ref" href="#fn:new-type-of-spam"&gt;1&lt;/a&gt;&lt;/sup&gt;. It's fairly targeted, so like spear phishing, I'd call this stuff spear spamming.&lt;/p&gt;
&lt;p&gt;Instead of regular spam which usually falls into categories like "Buy pills online", "Meet single ladies tonight" and "Open this malware laced attachment" this one is sent by someone trying to improve their search engine rankings or &lt;abbr title="Search Engine Optimization"&gt;SEO&lt;/abbr&gt;. The emails follow a fairly standard formula with a few deviations.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hi {Name}&lt;/p&gt;
&lt;p&gt;I just finished going through your article here: {url of a post I've written} Thanks for the resource!&lt;/p&gt;
&lt;p&gt;I noticed you mentioned {url of a competitors product, that I've linked to}.&lt;/p&gt;
&lt;p&gt;I've recently written up a comprehensive and up-to-date 3,000 word review of {general subject area} that I think your readers would be very interested in.&lt;/p&gt;
&lt;p&gt;Check out the post here {url of post looking for SEO}.&lt;/p&gt;
&lt;p&gt;Would you consider linking to it in the article of yours I mentioned above? I saw you liked to {competitors product} so I figured I'd see if you'd link to mine as well. Perhaps your visitors would find it helpful.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;{Name of Author of post looking for SEO}&lt;/p&gt;
&lt;p&gt;P.S. I respect the relationship you have with your readers, I wouldn't ask you to link to anything I didn't think was an excellent resource for you guys.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is then followed up by a second email exactly&lt;sup id="fnref:exactly"&gt;&lt;a class="footnote-ref" href="#fn:exactly"&gt;2&lt;/a&gt;&lt;/sup&gt; a week later;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hello again -&lt;/p&gt;
&lt;p&gt;I figured I'd try one more time :)&lt;/p&gt;
&lt;p&gt;Did you happen to get my last email? I imagine you are super busy and ...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I received one of these messages for a post I'd written about &lt;a href="https://xo.tc/tunneling-data-over-dns.html"&gt;Tunneling data over DNS&lt;/a&gt;, in the footnotes of that post I give credit saying "This network diagram was drawn with &lt;a href="https://www.draw.io/"&gt;draw.io&lt;/a&gt;" and I got an SEO email saying they were sure my readers would love to learn more about drawing and art.&lt;/p&gt;
&lt;p&gt;Google has been pretty open about the fact that the best way to increase a sites &lt;a href="https://en.wikipedia.org/wiki/PageRank"&gt;page rank&lt;/a&gt; is to get other websites to link to it. So it makes sense that people would scrape the web looking for sites that link to similar content and ask for a link to their site.&lt;/p&gt;
&lt;p&gt;The emails look very good but there are a few telltale signs that there automated. One of the emails I got had an unsubscribe link at the bottom. And all of the emails I've seen have been sent using Google's &lt;a href="https://developers.google.com/gmail/api/"&gt;Gmail API&lt;/a&gt; and have the header&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Received: from {random id} named unknown by gmailapi.google.com with HTTPREST;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:new-type-of-spam"&gt;
&lt;p&gt;By that, I mean new to me, this stuff has probably been around for years but I have only just started seeing it.&amp;#160;&lt;a class="footnote-backref" href="#fnref:new-type-of-spam" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:exactly"&gt;
&lt;p&gt;In my experience, it's always been within one hour of exactly 7 days.&amp;#160;&lt;a class="footnote-backref" href="#fnref:exactly" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Spam"></category><category term="Gmail"></category><category term="SEO"></category></entry><entry><title>Code reuse is good for security</title><link href="https://xo.tc/code-reuse-is-good-for-security.html" rel="alternate"></link><published>2017-09-28T07:00:00+08:00</published><updated>2017-09-28T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-09-28:/code-reuse-is-good-for-security.html</id><summary type="html">&lt;p&gt;I was listen to a podcast&lt;sup id="fnref:podcast"&gt;&lt;a class="footnote-ref" href="#fn:podcast"&gt;1&lt;/a&gt;&lt;/sup&gt; recently and &lt;a href="http://senr.io/team.html"&gt;Stephen Ridley from Senrio&lt;/a&gt; said "code reuse is vulnerability reuse" and I don't like that.&lt;/p&gt;
&lt;p&gt;I don't think Stephen is wrong, I think he is correct in a way and he is a very smart person. The problem is that you …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was listen to a podcast&lt;sup id="fnref:podcast"&gt;&lt;a class="footnote-ref" href="#fn:podcast"&gt;1&lt;/a&gt;&lt;/sup&gt; recently and &lt;a href="http://senr.io/team.html"&gt;Stephen Ridley from Senrio&lt;/a&gt; said "code reuse is vulnerability reuse" and I don't like that.&lt;/p&gt;
&lt;p&gt;I don't think Stephen is wrong, I think he is correct in a way and he is a very smart person. The problem is that you just can't squeeze a huge amount of subtlety and nuance into a three second soundbite.&lt;/p&gt;
&lt;p&gt;I believe we are better off overall when we do reuse code. For example I was recently working on a project where I had to take untrusted user input formatted as &lt;a href="http://commonmark.org/"&gt;CommonMark&lt;/a&gt; and render it as HTML. I could have tried to write my own parser to do that but instead I used the  &lt;a href="https://github.com/rtfd/CommonMark-py"&gt;CommonMark-py&lt;/a&gt; library to change the CommonMark to HTML and then used &lt;a href="https://github.com/mozilla/bleach"&gt;Mozilla bleach&lt;/a&gt; to whitelist only the HTML tags we want.&lt;/p&gt;
&lt;p&gt;Either of those libraries could have horror show bugs in them just waiting to be found and get me pwned, but I'd trust Mozilla to do a better job of sanitizing HTML than I can.&lt;/p&gt;
&lt;p&gt;Or in the specific example they were talking about on the podcast; A number of IoT devices were &lt;a href="http://blog.senr.io/blog/devils-ivy-flaw-in-widely-used-third-party-code-impacts-millions"&gt;using&lt;/a&gt; the &lt;a href="https://www.genivia.com/products.html"&gt;gSOAP&lt;/a&gt; library and there was a remote code execution bug in the library which affected millions of devices. That's bad. But I still think these devices were better off using an existing library than each different vendor trying to write their own SOAP library and getting it wrong in their own unique way&lt;sup id="fnref:unique"&gt;&lt;a class="footnote-ref" href="#fn:unique"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Importantly though you need a way to track and patch all your libraries quickly and painlessly when issues do inevitably come up.&lt;/p&gt;
&lt;p&gt;While code reuse &lt;em&gt;is&lt;/em&gt; vulnerability reuse, I'd rather be responsible for software with a large number of (well supported, actively tracked and easily patched) 3rd party libraries than need to look after software where everything is written in house.&lt;/p&gt;
&lt;p&gt;On balance I think that "code reuse is good for security"&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:podcast"&gt;
&lt;p&gt;&lt;a href="https://risky.biz/RB465/"&gt;Risky Business #465&lt;/a&gt; At 43:28 in.&amp;#160;&lt;a class="footnote-backref" href="#fnref:podcast" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:unique"&gt;
&lt;p&gt;Although this brings up another issue which is that monoculture is bad, because when a vulnerability does crop up it can spread like wild fire.&amp;#160;&lt;a class="footnote-backref" href="#fnref:unique" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Senrio"></category><category term="Philosophy"></category><category term="OpenSource"></category><category term="IoT"></category><category term="patching"></category></entry><entry><title>Looking through GitHub's DMCA takedowns</title><link href="https://xo.tc/looking-through-githubs-dmca-takedowns.html" rel="alternate"></link><published>2017-09-21T07:00:00+08:00</published><updated>2017-09-21T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-09-21:/looking-through-githubs-dmca-takedowns.html</id><summary type="html">&lt;p&gt;GitHub publish a copy of all the &lt;a href="https://github.com/github/dmca"&gt;DMCA takedown notices GitHub receives&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One thing I found very interesting was looking at their &lt;a href="https://github.com/github/dmca/graphs/contributors"&gt;graphs&lt;/a&gt; showing the number of commits over time.&lt;/p&gt;
&lt;p&gt;&lt;img alt="GitHub DMCA takedowns" src="https://xo.tc/images/github-dmca-takedowns.png"&gt;&lt;/p&gt;
&lt;p&gt;Of course, this doesn't necessarily mean that DMCA takedowns are being issued more often in general, it could simply be …&lt;/p&gt;</summary><content type="html">&lt;p&gt;GitHub publish a copy of all the &lt;a href="https://github.com/github/dmca"&gt;DMCA takedown notices GitHub receives&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One thing I found very interesting was looking at their &lt;a href="https://github.com/github/dmca/graphs/contributors"&gt;graphs&lt;/a&gt; showing the number of commits over time.&lt;/p&gt;
&lt;p&gt;&lt;img alt="GitHub DMCA takedowns" src="https://xo.tc/images/github-dmca-takedowns.png"&gt;&lt;/p&gt;
&lt;p&gt;Of course, this doesn't necessarily mean that DMCA takedowns are being issued more often in general, it could simply be a reflection of GitHub's own growth over time. Personally, I suspect it's a mix of the two, both that GitHub is becoming a more popular place to store things online, and that more and more DMCA takedown notices are being issued every day.&lt;/p&gt;
&lt;p&gt;I think that our copyright system is badly broken, in particular the approach that many sites (not specifically GitHub&lt;sup id="fnref:not-github"&gt;&lt;a class="footnote-ref" href="#fn:not-github"&gt;1&lt;/a&gt;&lt;/sup&gt;) are forced to take is very "guilty until proven innocent" where content is removed first with the option to appeal later, and there is little recourse against organisations that submit inaccurate takedown requests.&lt;/p&gt;
&lt;p&gt;However, I find it hard to get too worked up about the notices on GitHub, having looked through a few of them, most seem to be fairly tightly targeted and aimed at a single repository of clearly infringing content. In fact I was surprised how many of them were for .pdf copies of books and not for code at all.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:not-github"&gt;
&lt;p&gt;GitHub actually have the phrase "Users identified in the notices are presumed innocent until proven guilty", although I'm not sure exactly how that works. If they are getting less than 40 per day it's conceivable they have a real human being looking at each of the notices. Actioning the ones that are simple and investigating or flagging ones that might be a grey area.&amp;#160;&lt;a class="footnote-backref" href="#fnref:not-github" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="GitHub"></category><category term="Copyright"></category></entry><entry><title>Does Microsoft's Office 365 licensing model encourage poor security practices?</title><link href="https://xo.tc/does-microsofts-office-365-licensing-model-encourage-poor-security-practices.html" rel="alternate"></link><published>2017-09-14T07:00:00+08:00</published><updated>2017-09-14T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-09-14:/does-microsofts-office-365-licensing-model-encourage-poor-security-practices.html</id><summary type="html">&lt;p&gt;I've recently survived a migration to Office 365 with relatively few scars and coming out only slightly more cynical, bitter and twisted than I was when I when I started&lt;sup id="fnref:cynical-bitter-and-twisted"&gt;&lt;a class="footnote-ref" href="#fn:cynical-bitter-and-twisted"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;I remember speaking to a Microsoft sales rep at some conference or other, they said that in Office 365 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've recently survived a migration to Office 365 with relatively few scars and coming out only slightly more cynical, bitter and twisted than I was when I when I started&lt;sup id="fnref:cynical-bitter-and-twisted"&gt;&lt;a class="footnote-ref" href="#fn:cynical-bitter-and-twisted"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;I remember speaking to a Microsoft sales rep at some conference or other, they said that in Office 365 you only need to buy one license per users. That's it, and a user was unofficially defined as a living breathing bag of meat that has an Office 365 account.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No more worrying about buying CALs for printers and photocopiers&lt;/li&gt;
&lt;li&gt;No need to buy an extra license for users who had a regular account and an administrative account&lt;/li&gt;
&lt;li&gt;No extra CALs because someone wants their emails on their phone &lt;em&gt;and&lt;/em&gt; their laptop at the same time&lt;/li&gt;
&lt;li&gt;No need to license accounts used by system scripts and scheduled tasks.&lt;/li&gt;
&lt;li&gt;No worries about Per-Core vs Per-CPU licensing&lt;/li&gt;
&lt;li&gt;No need to license unused CPU cores because a VM could potentially be migrated in a failover situation.&lt;/li&gt;
&lt;li&gt;No weird definition of "User"&lt;sup id="fnref:who-is-a-user"&gt;&lt;a class="footnote-ref" href="#fn:who-is-a-user"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just one license per person. Simple. I was quite surprised.&lt;/p&gt;
&lt;p&gt;It turns out that's not quite correct, while you don't &lt;em&gt;have to&lt;/em&gt; license &lt;abbr title="Multifunction Devices (i.e. Photocopiers)"&gt;MFDs&lt;/abbr&gt;. In practice, if you want your photocopiers and scanners to be able to authenticate and send email using Office 365 they are going to need an account.&lt;/p&gt;
&lt;p&gt;There is a work around for this, I could setup a shared account scanner@example.com, shared accounts don't need a license. I could give my account Michael.VanDelft@example.com 'Send As' permission. Then I can then setup the photocopiers to authenticate with my credentials and send email as scanner@example.com. While that's totally ok from an Office 365 licensing perspective I'm left with my username and password stored in a bunch of poorly secured photocopiers and I can't change my password without breaking the scan to email function on all our photocopiers.&lt;/p&gt;
&lt;p&gt;There are some other &lt;a href="https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4"&gt;work arrounds&lt;/a&gt; for this, but they either involve direct send or running an SMTP relay and neither option is great.&lt;/p&gt;
&lt;p&gt;We have a plethora of things which send email, not just photocopiers but system monitoring tools, our backup software sends reports, several system scripts, our financial system, even our firewall emails alerts occasionally.&lt;/p&gt;
&lt;p&gt;If we want these all these things to send emails through Office 365 so we get DMARC, TLS, Authentication and all that other goodness that comes with a well-configured mail server we need to license them.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:cynical-bitter-and-twisted"&gt;
&lt;p&gt;Although it's possible that I've almost reached peak cynical saturation and simply couldn't have got any more bitter and twisted even if it had been a migration to Oracle's god-awful "Oracle Communications Messaging Server".&amp;#160;&lt;a class="footnote-backref" href="#fnref:cynical-bitter-and-twisted" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:who-is-a-user"&gt;
&lt;p&gt;We were once looking at Microsoft SQL server and we were told that if we had some software (e.g. accounting software) that used a single account to connect to the database, anyone who used that software was a "user" of the database, even if we only had one account setup in SQL server. Fair enough, I guess. But then they extrapolated that to say that if we used a CMS like WordPress with Microsoft SQL server as the back end, then we would need a license for everyone who viewed or commented on our website as they too would be a "user" of our database. Needless to say, we went with Per-Core licensing rather than per user. I've since been told that this is not correct by a number of "Microsoft Licensing Experts" however it's what we were told at the time by our reseller who was a "Microsoft Gold Certified Partner".&amp;#160;&lt;a class="footnote-backref" href="#fnref:who-is-a-user" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Office 365"></category><category term="Email"></category><category term="DMARC"></category><category term="Microsoft"></category></entry><entry><title>CrashPlan personal is shutting down</title><link href="https://xo.tc/crashplan-personal-is-shutting-down.html" rel="alternate"></link><published>2017-09-07T07:00:00+08:00</published><updated>2017-09-07T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-09-07:/crashplan-personal-is-shutting-down.html</id><summary type="html">&lt;p&gt;I’m currently using CrashPlan to back up my home server, desktop, laptop and a few computers for family members. I’ve been fairly happy with it and it ticks most of the boxes. But I recently got the email saying that &lt;a href="https://www.crashplan.com/en-us/consumer/nextsteps/"&gt;CrashPlan for home will be shutdown&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So now …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I’m currently using CrashPlan to back up my home server, desktop, laptop and a few computers for family members. I’ve been fairly happy with it and it ticks most of the boxes. But I recently got the email saying that &lt;a href="https://www.crashplan.com/en-us/consumer/nextsteps/"&gt;CrashPlan for home will be shutdown&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So now I'm on the hunt for some new backup software. The features I’m looking for are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Must be Cross Platform (Window and Linux, I don’t need Mac but it would be nice)&lt;/li&gt;
&lt;li&gt;Must be able to run on a headless Linux server&lt;/li&gt;
&lt;li&gt;Must be able to do incremental backups at the file level (e.g. If I’ve got a 20GB QCOW2 file and 100Mb of that changes I don’t want to reupload 20GB)&lt;/li&gt;
&lt;li&gt;Must be able to restore file revisions (not just the latest version like if I just used Rsync)&lt;/li&gt;
&lt;li&gt;Must be able to encrypt backups locally before uploading them&lt;/li&gt;
&lt;li&gt;Should be able to upload to some sort of “Cloud” offering. I don’t mind whether that’s the backup vendor’s infrastructure or something public like Amazon S3&lt;/li&gt;
&lt;li&gt;Should be able to do continuous backups (CrashPlan could run every 15 minutes, that's pretty good)&lt;/li&gt;
&lt;li&gt;Would be nice if it was also able to back up to a server I control or other desktops.&lt;/li&gt;
&lt;li&gt;Would be nice if it could backup to a physical drive (external USB hard drive)&lt;/li&gt;
&lt;li&gt;Would be nice if it was open source&lt;/li&gt;
&lt;li&gt;Would be nice if it also had a pretty GUI, although I’d take an ugly and difficult system that's set and forget over a pretty GUI that needs tending regularly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I realise that’s quite a long list but other than headless Linux support I think most of it is pretty mainstream requirements for a backup tool.&lt;/p&gt;</content><category term="Posts"></category><category term="Backup"></category><category term="CrashPlan"></category></entry><entry><title>Are outbound firewalls worthwhile?</title><link href="https://xo.tc/are-outbound-firewalls-worthwhile.html" rel="alternate"></link><published>2017-08-31T07:00:00+08:00</published><updated>2017-08-31T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-08-31:/are-outbound-firewalls-worthwhile.html</id><summary type="html">&lt;p&gt;I was recently setting up a server on Microsoft's Azure platform from work and by default Azure pick I high port number&lt;sup id="fnref:high-port-number"&gt;&lt;a class="footnote-ref" href="#fn:high-port-number"&gt;1&lt;/a&gt;&lt;/sup&gt; and NAT it to port 3389 for RDP. I must have spent a good hour trying to work out why I couldn't connect to the server when …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was recently setting up a server on Microsoft's Azure platform from work and by default Azure pick I high port number&lt;sup id="fnref:high-port-number"&gt;&lt;a class="footnote-ref" href="#fn:high-port-number"&gt;1&lt;/a&gt;&lt;/sup&gt; and NAT it to port 3389 for RDP. I must have spent a good hour trying to work out why I couldn't connect to the server when I finally realized that I hadn't unblocked the port I was trying to connect on in our outbound firewall.&lt;/p&gt;
&lt;p&gt;Now I'm &lt;a href="https://xo.tc/changing-ssh-from-port-22.html"&gt;skeptical&lt;/a&gt; of the value of changing port numbers to hide services anyway but also don't know how much value, if any our outbound firewall add either.&lt;/p&gt;
&lt;p&gt;On the one hand, we allow ports 22 and 443 outbound so it's easy for someone to tunnel over ssh or proxy through a HTTPS website. Basically, if someone wants to connect out of our network, the firewall not going to stop them.&lt;/p&gt;
&lt;p&gt;On the other hand, we don't open port 23 so if someone brought in a home route infected with Mirai and it tried to telnet out to infect others, or some other dumb worm that uses a port we don't have open then our firewall would at least block that.&lt;/p&gt;
&lt;p&gt;So like many defenses in depth things, by itself, it's not going to make much difference, but it's one more layer that malware needs to get around.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:high-port-number"&gt;
&lt;p&gt;I read somewhere that it's a random number in the range 49152-65535 but couldn't find official documentation to back that up.&amp;#160;&lt;a class="footnote-backref" href="#fnref:high-port-number" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Firewalls"></category><category term="Defence in Depth"></category></entry><entry><title>Review of Fatal Flight: The True Story of Britain's Last Great Airship</title><link href="https://xo.tc/review-of-fatal-flight-the-true-story-of-britains-last-great-airship.html" rel="alternate"></link><published>2017-08-24T07:00:00+08:00</published><updated>2017-08-24T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-08-24:/review-of-fatal-flight-the-true-story-of-britains-last-great-airship.html</id><summary type="html">&lt;p&gt;I've just finished listening to &lt;a href="http://www.engineerguy.com/airship/"&gt;Fatal Flight: The True Story of Britain's Last Great Airship&lt;/a&gt; and it is, in a word "Brilliant".&lt;/p&gt;
&lt;p&gt;When I started this blog I intended to put up several book reviews, a year and half later, this is my second book review.&lt;/p&gt;
&lt;p&gt;Bill Hammack is an …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've just finished listening to &lt;a href="http://www.engineerguy.com/airship/"&gt;Fatal Flight: The True Story of Britain's Last Great Airship&lt;/a&gt; and it is, in a word "Brilliant".&lt;/p&gt;
&lt;p&gt;When I started this blog I intended to put up several book reviews, a year and half later, this is my second book review.&lt;/p&gt;
&lt;p&gt;Bill Hammack is an incredibly eloquent author and can turn the most seemingly mundane of topics into a fascinating story.&lt;/p&gt;
&lt;p&gt;In the book, Bill explores the story of R101 "Britain's Last Great Airship" the people that built it and why it ultimately failed&lt;sup id="fnref:failed"&gt;&lt;a class="footnote-ref" href="#fn:failed"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;As an engineer, Bill is well equipped to look at the technical details, but he also does an outstanding job of examining the political reasons why airships failed, both for R101 specifically and British airships generally.&lt;/p&gt;
&lt;p&gt;While the book is not related to information security, in fact, it's not even related to information technology, it's one of those books that I think would enrich the knowledge of anyone working on large projects be they engineering or otherwise.&lt;/p&gt;
&lt;p&gt;Bill has generously released the audiobook as Creative Commons and I would encourage anyone to go over to his site and &lt;a href="http://www.engineerguy.com/airship/"&gt;download a copy&lt;/a&gt;.  &lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:failed"&gt;
&lt;p&gt;This was partly the inspiration for last weeks post on &lt;a href="https://xo.tc/learning-from-failure.html"&gt;learning from failure&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:failed" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Reviews"></category><category term="Review"></category><category term="Books"></category><category term="Engineering"></category></entry><entry><title>Learning from failure</title><link href="https://xo.tc/learning-from-failure.html" rel="alternate"></link><published>2017-08-17T07:00:00+08:00</published><updated>2017-08-17T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-08-17:/learning-from-failure.html</id><summary type="html">&lt;p&gt;Recently I watched a video by Tom Scott about a &lt;a href="https://www.youtube.com/watch?v=PfdBTsyrqaI"&gt;Museum of Failure&lt;/a&gt;. It's a fascinating video and well worth watching.&lt;/p&gt;
&lt;p&gt;Often there is a lot of emphases put on learning from the great successes, seeing what successful people or projects have done and trying to emulate them. But learning …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently I watched a video by Tom Scott about a &lt;a href="https://www.youtube.com/watch?v=PfdBTsyrqaI"&gt;Museum of Failure&lt;/a&gt;. It's a fascinating video and well worth watching.&lt;/p&gt;
&lt;p&gt;Often there is a lot of emphases put on learning from the great successes, seeing what successful people or projects have done and trying to emulate them. But learning from failure is just as important and often overlooked.&lt;/p&gt;
&lt;p&gt;Seeing where projects have gone wrong and how to avoid those weaknesses in the future can be incredibly beneficial.&lt;/p&gt;
&lt;p&gt;I remember being told once that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You never really understand the value in things like project management and it's easy to see them as needless overhead, until you have worked on a project that has failed.&lt;/p&gt;
&lt;/blockquote&gt;</content><category term="Posts"></category><category term="Failure"></category><category term="Philosophy"></category></entry><entry><title>Reuse before buy before build</title><link href="https://xo.tc/reuse-before-buy-before-build.html" rel="alternate"></link><published>2017-08-10T07:00:00+08:00</published><updated>2017-08-10T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-08-10:/reuse-before-buy-before-build.html</id><summary type="html">&lt;p&gt;Yesterday I was at a &lt;abbr title="Chief Information Officer"&gt;CIO&lt;/abbr&gt; forum and one of the presentations was about Enterprise Architecture Planning within the West Australian State Government. They were pushing the idea that government departments should work together as a single organisation rather than as separate and sometimes competing entities and they used the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Yesterday I was at a &lt;abbr title="Chief Information Officer"&gt;CIO&lt;/abbr&gt; forum and one of the presentations was about Enterprise Architecture Planning within the West Australian State Government. They were pushing the idea that government departments should work together as a single organisation rather than as separate and sometimes competing entities and they used the phrase:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reuse before buy before build.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think that's great.&lt;/p&gt;
&lt;p&gt;If there is existing software that you or another department has developed or have already licensed, or there is open source software available use that first.&lt;/p&gt;
&lt;p&gt;Only if reuse is not possible, then look at buying an off the shelf solution.&lt;/p&gt;
&lt;p&gt;Finally, if there is no existing open source solution and no off the shelf solution, then develop a new solution.&lt;/p&gt;</content><category term="Posts"></category><category term="Philosophy"></category></entry><entry><title>Installing software from the Arch User Repository</title><link href="https://xo.tc/installing-software-from-the-arch-user-repository.html" rel="alternate"></link><published>2017-08-03T07:00:00+08:00</published><updated>2017-08-03T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-08-03:/installing-software-from-the-arch-user-repository.html</id><summary type="html">&lt;p&gt;This is another &lt;a href="https://xo.tc/tag/note-to-self.html"&gt;note to self&lt;/a&gt;, it is very simple and I've done this a few times before but every single time I need to go back to the &lt;a href="https://wiki.archlinux.org/index.php/Arch_User_Repository"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this example I'll install &lt;a href="http://glassechidna.com.au/heimdall/"&gt;heimdall&lt;/a&gt; which is used for flashing new firmware onto samsung phones.&lt;/p&gt;
&lt;p&gt;First go to &lt;a href="https://aur.archlinux.org/"&gt;https …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is another &lt;a href="https://xo.tc/tag/note-to-self.html"&gt;note to self&lt;/a&gt;, it is very simple and I've done this a few times before but every single time I need to go back to the &lt;a href="https://wiki.archlinux.org/index.php/Arch_User_Repository"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this example I'll install &lt;a href="http://glassechidna.com.au/heimdall/"&gt;heimdall&lt;/a&gt; which is used for flashing new firmware onto samsung phones.&lt;/p&gt;
&lt;p&gt;First go to &lt;a href="https://aur.archlinux.org/"&gt;https://aur.archlinux.org/&lt;/a&gt; and type the name of the package into the package search box.&lt;/p&gt;
&lt;p&gt;This takes us to &lt;a href="https://aur.archlinux.org/packages/heimdall-git"&gt;https://aur.archlinux.org/packages/heimdall-git&lt;/a&gt; then copy the git clone url from the top. In my case I've got a folder setup for AUR installs because I like things to be organised but it's not necessary.&lt;/p&gt;
&lt;p&gt;clone the repository, &lt;code&gt;cd&lt;/code&gt; into it, then run &lt;code&gt;makepkg -si&lt;/code&gt;. makepkg should not be run as root, when root permissions are needed you will be prompted for your password if you have sudo or the root password otherwise.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://aur.archlinux.org/heimdall-git.git
cd heimdall-git
makepkg -si
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and that's it. It really is very simple.&lt;/p&gt;
&lt;p&gt;Then later to remove the package and it's dependancies you can run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo pacman -Rs heimdall-git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can also run &lt;code&gt;pacman -Qem&lt;/code&gt; to get a list of manually installed packages which for most people will be just the packages they have installed from AUR.&lt;/p&gt;</content><category term="Posts"></category><category term="Note to self"></category><category term="Arch Linux"></category></entry><entry><title>Veeam backup errors after NAS hard drive failure</title><link href="https://xo.tc/veeam-backup-errors-after-nas-hard-drive-failure.html" rel="alternate"></link><published>2017-07-27T07:00:00+08:00</published><updated>2017-07-27T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-07-27:/veeam-backup-errors-after-nas-hard-drive-failure.html</id><summary type="html">&lt;p&gt;We have a setup at work where we have two Hyper-V servers in a failover cluster mounting a VHD on a NAS&lt;sup id="fnref:on-a-nas"&gt;&lt;a class="footnote-ref" href="#fn:on-a-nas"&gt;1&lt;/a&gt;&lt;/sup&gt; as an iSCSI target running a number of VMs that get backed up by Veeam.&lt;/p&gt;
&lt;p&gt;Recently we had a hard drive failure in the NAS. The NAS …&lt;/p&gt;</summary><content type="html">&lt;p&gt;We have a setup at work where we have two Hyper-V servers in a failover cluster mounting a VHD on a NAS&lt;sup id="fnref:on-a-nas"&gt;&lt;a class="footnote-ref" href="#fn:on-a-nas"&gt;1&lt;/a&gt;&lt;/sup&gt; as an iSCSI target running a number of VMs that get backed up by Veeam.&lt;/p&gt;
&lt;p&gt;Recently we had a hard drive failure in the NAS. The NAS had RAID 5 with a hot spare&lt;sup id="fnref:hot-spare"&gt;&lt;a class="footnote-ref" href="#fn:hot-spare"&gt;2&lt;/a&gt;&lt;/sup&gt; so no problem, in this case, the drive died on a Friday so I shut the server down on the weekend, popped a new drive in and rebuilt the array offline.&lt;/p&gt;
&lt;p&gt;All looked good, the RAID controller said all drives were OK and the servers started back up fine, but the next night the Veeam backups failed with the error message.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="mi"&gt;2017&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Processing&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;HWFS1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Incorrect&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;\\&lt;span class="err"&gt;?&lt;/span&gt;\&lt;span class="n"&gt;GLOBALROOT&lt;/span&gt;\&lt;span class="n"&gt;Device&lt;/span&gt;\&lt;span class="n"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;8144&lt;/span&gt;&lt;span class="n"&gt;a28c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;459&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="n"&gt;a7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;a274&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;b03ae6a3d493&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="n"&gt;HWFS1_D&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vhd&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;\\&lt;span class="err"&gt;?&lt;/span&gt;\&lt;span class="n"&gt;GLOBALROOT&lt;/span&gt;\&lt;span class="n"&gt;Device&lt;/span&gt;\&lt;span class="n"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;8144&lt;/span&gt;&lt;span class="n"&gt;a28c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;459&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="n"&gt;a7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;a274&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;b03ae6a3d493&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="n"&gt;HWFS1_D&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vhd&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;upload&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;disk&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Agent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;DataTransfer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SyncDisk&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Exception&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Incorrect&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;\\&lt;span class="err"&gt;?&lt;/span&gt;\&lt;span class="n"&gt;GLOBALROOT&lt;/span&gt;\&lt;span class="n"&gt;Device&lt;/span&gt;\&lt;span class="n"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;8144&lt;/span&gt;&lt;span class="n"&gt;a28c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;459&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="n"&gt;a7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;a274&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;b03ae6a3d493&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="n"&gt;HWFS1_D&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vhd&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After some digging, I found events in the event view on the NAS that said.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;Logical&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;drive&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;configured&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;P212&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;located&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;slot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;returned&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;fatal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;during&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;read&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;volume&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;

&lt;span class="nx"&gt;Logical&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4123043672&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;were&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;taken&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;logical&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;I&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;O&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;

&lt;span class="nx"&gt;Array&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;P212&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;located&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;slot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;also&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;reporting&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;that&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;physical&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;drive&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;fatal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;associated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;this&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;logical&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;located&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bus&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So I ran &lt;code&gt;chkdsk /f e:&lt;/code&gt; on the server and it said&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Windows has checked the file system and found no problems.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But I was still seeing the error messages in event viewer. Then I tried &lt;code&gt;chkdsk /r e:&lt;/code&gt; which took several hours but eventually came back and reported that it had found and repaired (moved) several unreadable sectors.&lt;/p&gt;
&lt;p&gt;So even when every thing seems ok, and chkdsk reports no errors if you get a &lt;code&gt;Failed to read data from the file&lt;/code&gt; message from Veeam it could be bad sectors on the underlying disk.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:on-a-nas"&gt;
&lt;p&gt;This is not a good design for a number of reasons, we are migrating away from it, but that's a blog post for another time.&amp;#160;&lt;a class="footnote-backref" href="#fnref:on-a-nas" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:hot-spare"&gt;
&lt;p&gt;Also not great design.&amp;#160;&lt;a class="footnote-backref" href="#fnref:hot-spare" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Backups"></category><category term="Veeam"></category><category term="chkdsk"></category><category term="Windows"></category></entry><entry><title>A morbidly fascinating look at Australian causes of death</title><link href="https://xo.tc/a-morbidly-fascinating-look-at-australian-causes-of-death.html" rel="alternate"></link><published>2017-07-20T07:00:00+08:00</published><updated>2017-07-20T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-07-20:/a-morbidly-fascinating-look-at-australian-causes-of-death.html</id><summary type="html">&lt;p&gt;Recently a discussion came up on the &lt;a href="https://www.itpa.org.au/"&gt;ITPA&lt;/a&gt; discourse, where the Australian Federal Government is trying to get backdoor&lt;sup id="fnref:backdoor"&gt;&lt;a class="footnote-ref" href="#fn:backdoor"&gt;1&lt;/a&gt;&lt;/sup&gt; access to the content of encrypted messaging apps.&lt;/p&gt;
&lt;p&gt;This included a great quote&lt;sup id="fnref:quote"&gt;&lt;a class="footnote-ref" href="#fn:quote"&gt;2&lt;/a&gt;&lt;/sup&gt; from our esteemed leader Malcolm Turnbull:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"The laws of mathematics are very commendable but the only …&lt;/p&gt;&lt;/blockquote&gt;</summary><content type="html">&lt;p&gt;Recently a discussion came up on the &lt;a href="https://www.itpa.org.au/"&gt;ITPA&lt;/a&gt; discourse, where the Australian Federal Government is trying to get backdoor&lt;sup id="fnref:backdoor"&gt;&lt;a class="footnote-ref" href="#fn:backdoor"&gt;1&lt;/a&gt;&lt;/sup&gt; access to the content of encrypted messaging apps.&lt;/p&gt;
&lt;p&gt;This included a great quote&lt;sup id="fnref:quote"&gt;&lt;a class="footnote-ref" href="#fn:quote"&gt;2&lt;/a&gt;&lt;/sup&gt; from our esteemed leader Malcolm Turnbull:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"The laws of mathematics are very commendable but the only laws that apply in Australia is the law of Australia."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Patrick Gray has a &lt;a href="https://risky.biz/bannedmath/"&gt;great write-up&lt;/a&gt; where he suggests that what the Government are really after is a way to compel companies like Apple and Google to push a rogue update to targeted handsets that will allow law enforcement access to the decrypted communications on the device itself.&lt;/p&gt;
&lt;p&gt;Inevitably the question of whether all the recent anti-terror legislation passed by the Australian Federal Government was saving lives, and how many people had been killed by terrorism with one member stating more people had been killed by knives than by terrorism.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;yet we don't see the government trying to ban knives, or legislating that only blunt knives can be sold.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While I completely agree with the above, I thought it would be interesting to look through some hard data&lt;sup id="fnref:hard-data"&gt;&lt;a class="footnote-ref" href="#fn:hard-data"&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;I went to the Australian Bureau Statistics website where they publish ten years worth of &lt;a href="http://www.abs.gov.au/Causes-of-Death"&gt;cause of death data&lt;/a&gt; in Australia. I downloaded the &lt;a href="http://www.abs.gov.au/AUSSTATS/subscriber.nsf/log?openagent&amp;amp;3303_1%20underlying%20causes%20of%20death%20%28australia%29.xls&amp;amp;3303.0&amp;amp;Data%20Cubes&amp;amp;A601587C5EA0E34FCA25803B0017FA62&amp;amp;0&amp;amp;2015&amp;amp;28.09.2016&amp;amp;Latest"&gt;Underlying cause of death, All causes, Australia&lt;/a&gt; spread sheet and started reading through.&lt;/p&gt;
&lt;p&gt;Unsurprisingly ABS doesn't list "terrorism" as a cause of death, I suspect any terrorism related deaths would be under "CHAPTER XX External causes of morbidity and mortality (V01-Y98)", then under "Other external causes of mortality (X60-Y36)", then "Assault (X85-Y09)" and finally under whichever specific heading was relevant. For example "Assault by explosive material (X96)" or "Assault by rifle, shotgun and larger firearm discharge (X94)".&lt;/p&gt;
&lt;p&gt;Because I was unable to work out which deaths were from terrorism in the ABS statistics, I then found a fairly well sourced &lt;a href="https://en.wikipedia.org/wiki/Terrorism_in_Australia"&gt;Wikipedia article&lt;/a&gt; from which we get the following table&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: right;"&gt;Year&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Number of incidents&lt;sup id="fnref:incidents"&gt;&lt;a class="footnote-ref" href="#fn:incidents"&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Deaths&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Injuries&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2006&lt;/td&gt;
&lt;td style="text-align: right;"&gt;2&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2007&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2008&lt;/td&gt;
&lt;td style="text-align: right;"&gt;3&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2009&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2010&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2011&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2012&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2013&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2014&lt;/td&gt;
&lt;td style="text-align: right;"&gt;8&lt;/td&gt;
&lt;td style="text-align: right;"&gt;4&lt;/td&gt;
&lt;td style="text-align: right;"&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;2015&lt;/td&gt;
&lt;td style="text-align: right;"&gt;7&lt;/td&gt;
&lt;td style="text-align: right;"&gt;2&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;23&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Which gives us 6 deaths over the same 10 year period as the ABS statistics. Of the 1,454,112 deaths in that period that's about 0.0004% were from terrorism, it slips in just behind "Other disorders of penis (N48)" killing 7 people and "Inflammatory disorders of male genital organs, not elsewhere classified (N49)" taking the lives of 64 men between 2006 and 2015.&lt;/p&gt;
&lt;p&gt;Terrorism absolutely pales in comparison to our top category&lt;sup id="fnref:category"&gt;&lt;a class="footnote-ref" href="#fn:category"&gt;5&lt;/a&gt;&lt;/sup&gt; "CHAPTER IX Diseases of the circulatory system (I00-I99)" with a whopping 31.4% totaling 456,956 deaths over ten years.&lt;/p&gt;
&lt;p&gt;Not all, but many deaths from diseases of the circulatory system are preventable. Tens of thousands of lives, maybe even hundreds of thousands of lives over that same ten year period could have been saved with greater investment in Health Promotion&lt;sup id="fnref:health-promtion"&gt;&lt;a class="footnote-ref" href="#fn:health-promtion"&gt;6&lt;/a&gt;&lt;/sup&gt; and tougher laws&lt;sup id="fnref:tougher-laws"&gt;&lt;a class="footnote-ref" href="#fn:tougher-laws"&gt;7&lt;/a&gt;&lt;/sup&gt; on tobacco, alcohol and fastfood.  &lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:backdoor"&gt;
&lt;p&gt;They say they "don't want a backdoor", what they want is something different, and then proceed to describe &lt;a href="http://www.abc.net.au/news/8709654"&gt;a system&lt;/a&gt; that by any reasonable definition is a backdoor.&amp;#160;&lt;a class="footnote-backref" href="#fnref:backdoor" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:quote"&gt;
&lt;p&gt;In fairness to Malcolm, if you followed me around with a camera all day and made me do several press conferences on a number of different subjects, you wouldn't have to wait long for me to say something gobsmackingly stupid too.&amp;#160;&lt;a class="footnote-backref" href="#fnref:quote" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:hard-data"&gt;
&lt;p&gt;I fully admit that I went into this with a theory and was simply looking for data to back up what I already believed. So while this data is accurate, I didn't put much effort into looking for data which refuted my world view, you can take this with a grain of salt if you like.&amp;#160;&lt;a class="footnote-backref" href="#fnref:hard-data" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:incidents"&gt;
&lt;p&gt;Of course there is the question of when does something change from simply crime to terrorism? When does a boat become a ship? How long is a piece of string? but I'm happy to go with whats in the Wikipedia article.&amp;#160;&lt;a class="footnote-backref" href="#fnref:incidents" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:category"&gt;
&lt;p&gt;I know that "Diseases of the circulatory system" is a whole broad category of causes rather than a single cause, but I would say that "Terrorism" is a whole category too, it's not broken down into individual causes so it's a fair comparison.&amp;#160;&lt;a class="footnote-backref" href="#fnref:category" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:health-promtion"&gt;
&lt;p&gt;Full disclosure, I work for The West Australian Health Promotion Foundation. Also in case any readers lack common sense, &lt;em&gt;My views&lt;/em&gt; that &lt;em&gt;I express&lt;/em&gt; on &lt;em&gt;my personal blog&lt;/em&gt; are my own, and not those of my employer.&amp;#160;&lt;a class="footnote-backref" href="#fnref:health-promtion" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:tougher-laws"&gt;
&lt;p&gt;To be clear here, when I say "tougher laws" I don't support prohibition. If informed adults want to put something into their own body that's up to them. I'm talking about things like &lt;a href="https://en.wikipedia.org/wiki/Plain_tobacco_packaging"&gt;plain packaging&lt;/a&gt;, health warnings, advertising restrictions and higher taxes. The devil is in the details but I support the idea of a &lt;a href="https://greens.org.au/sugar-tax"&gt;sugar tax&lt;/a&gt; for example.&amp;#160;&lt;a class="footnote-backref" href="#fnref:tougher-laws" title="Jump back to footnote 7 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Australia"></category><category term="Backdoor"></category><category term="Layer 8"></category><category term="ITPA"></category></entry><entry><title>Crashplan no longer offer restore to door service</title><link href="https://xo.tc/crashplan-no-longer-offer-restore-to-door-service.html" rel="alternate"></link><published>2017-07-13T07:00:00+08:00</published><updated>2017-07-13T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-07-13:/crashplan-no-longer-offer-restore-to-door-service.html</id><summary type="html">&lt;p&gt;A while ago I got an email from someone who was Googling for &lt;code&gt;rsync crashplan&lt;/code&gt; and stumbled upon a previous blog post about &lt;a href="https://xo.tc/backing-up-a-remote-server-with-rsync.html"&gt;backing up servers with rsync&lt;/a&gt; then using Crashplan to backup those files.&lt;/p&gt;
&lt;p&gt;They were desperately looking for some kind of rsync-like solution to restore a lot of …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A while ago I got an email from someone who was Googling for &lt;code&gt;rsync crashplan&lt;/code&gt; and stumbled upon a previous blog post about &lt;a href="https://xo.tc/backing-up-a-remote-server-with-rsync.html"&gt;backing up servers with rsync&lt;/a&gt; then using Crashplan to backup those files.&lt;/p&gt;
&lt;p&gt;They were desperately looking for some kind of rsync-like solution to restore a lot of data from Crashplan over a bad connection.&lt;/p&gt;
&lt;p&gt;My initial thoughts were that Crashplan had a service where they would send you your backups on a hard disk. The old "never underestimate the bandwidth of a station wagon full of tapes" sort of thing.&lt;/p&gt;
&lt;p&gt;But after a bit of searching, I found that their &lt;a href="https://helpdesk.code42.com/hc/en-us/articles/114094194433-CrashPlan-for-Home-Restore-to-Door-Service-to-be-Discontinued-Jan-4-2016"&gt;Restore-to-Door&lt;/a&gt; service was discontinued in early 2016. I was frustrated that I was unable to help the person who had contacted me, but also a little worried that I might end up in the exact same situation.&lt;/p&gt;
&lt;p&gt;At the moment I've got a Family license for Crahsplan which for $165 AUD a year covers up to 10 computers. I've got it installed on my several of my computers as well as my mums, uncles, and fiancée. Some of those computers have over 300GB of stuff on them and to download all of that again over the dodgy ADSL we get in Perth would take the better part of a month.&lt;/p&gt;
&lt;p&gt;I'm not sure what I'm going to do, but I am seriously considering finding somewhere locally to host my own Crashplan server, that I can get physical access to and not paying for Crashplan's cloud offerings anymore.&lt;/p&gt;</content><category term="Posts"></category><category term="Backups"></category><category term="Crashplan"></category></entry><entry><title>Sleazy marketing</title><link href="https://xo.tc/sleazy-marketing.html" rel="alternate"></link><published>2017-07-06T07:00:00+08:00</published><updated>2017-07-06T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-07-06:/sleazy-marketing.html</id><summary type="html">&lt;p&gt;I was recently looking at a number of application whitelisting solutions and one of the ones I was looking at was &lt;a href="https://en.wikipedia.org/wiki/Carbon_Black_%28company%29"&gt;Carbon Black&lt;/a&gt;. I spent quite a bit of time on their website trying to see if they actually published any solid, useful, technical documentation about what it is they …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was recently looking at a number of application whitelisting solutions and one of the ones I was looking at was &lt;a href="https://en.wikipedia.org/wiki/Carbon_Black_%28company%29"&gt;Carbon Black&lt;/a&gt;. I spent quite a bit of time on their website trying to see if they actually published any solid, useful, technical documentation about what it is they actually do beyond their tagline "Stop the Most Attacks. See Every Threat. Compromise Nothing."&lt;/p&gt;
&lt;p&gt;A few days later I got a call from a sales person from Carbon Black saying that they saw I was interested in their product.&lt;/p&gt;
&lt;p&gt;I assume they have some algorithm on their website analytics that does a lookup on any IP address that spends more than a set amount of time on their site (I was there for about 10 minutes). If you do a PTR lookup on our gateway IP address or throw it into any Geo IP database like &lt;a href="http://ipinfo.io"&gt;ipinfo&lt;/a&gt; our organisation comes up. From there it's not hard to Google us, call reception and ask for whoever manages IT Security.&lt;/p&gt;
&lt;p&gt;I browse the web with &lt;a href="http://donottrack.us/"&gt;Do Not Track&lt;/a&gt; switched on, I understand that it's voluntary and websites can just ignore that flag. But tracking me shows a complete lack of respect for users privacy wishes and doesn't inspire me to install their products on all of the desktops I manage.&lt;/p&gt;
&lt;p&gt;Bruce Schneier blogged about something similar recently where websites were &lt;a href="https://www.schneier.com/blog/archives/2017/06/websites_grabbi.html"&gt;grabbing user form data before it's submitted&lt;/a&gt;. He says&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"This is important because it goes against what people expect"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Just like using javascript to grab from data, tracking users is not that technically difficult but it's not what people expect. Browsing someone's website is not the same as filling in the contact us form and you don't expect to get a call from one of their marketing people.&lt;/p&gt;</content><category term="Posts"></category><category term="Marketing"></category><category term="Application Whitelisting"></category></entry><entry><title>Setting Up Full Disk Encryption on Debian 9 Stretch</title><link href="https://xo.tc/setting-up-full-disk-encryption-on-debian-9-stretch.html" rel="alternate"></link><published>2017-06-29T07:00:00+08:00</published><updated>2017-06-29T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-06-29:/setting-up-full-disk-encryption-on-debian-9-stretch.html</id><summary type="html">&lt;p&gt;Previously I did a tutorial on Installing &lt;a href="https://xo.tc/setting-up-full-disk-encryption-on-debian-jessie.html"&gt;Debian 8 Jessie&lt;/a&gt; with full disk encryption, in that tutorial I went into a lot of detail about manually partitioning the disks. If for some reason you want to manually partition your disks I would reccomend that tutorial, it will still work for …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Previously I did a tutorial on Installing &lt;a href="https://xo.tc/setting-up-full-disk-encryption-on-debian-jessie.html"&gt;Debian 8 Jessie&lt;/a&gt; with full disk encryption, in that tutorial I went into a lot of detail about manually partitioning the disks. If for some reason you want to manually partition your disks I would reccomend that tutorial, it will still work for Debian 9 Stretch.&lt;/p&gt;
&lt;p&gt;However this tutorial is much more simplified I've used the grapical installer and gone with "Guided - use entire disk and set up encrypted LVM".&lt;/p&gt;
&lt;p&gt;As I've mentioned in all my tutorials on &lt;a href="https://xo.tc/full-disk-encryption-on-linux.html"&gt;Full Disk Encryption&lt;/a&gt; I say "Full" disk encryption but that's not entirely correct there is still a small partition &lt;code&gt;/boot&lt;/code&gt; that's unencrypted. That contains your kernel, grub config and initrd and needs to be unencrypted so we can start booting and decrypt the rest of the OS.&lt;/p&gt;
&lt;p&gt;So let's get started&lt;/p&gt;
&lt;h2 id="installing"&gt;Installing&lt;/h2&gt;
&lt;p&gt;Boot up your CD, USB flash drive, ISO file or install media of choice and select Graphical install.&lt;/p&gt;
&lt;p&gt;&lt;img alt="CD Boot" src="https://xo.tc/images/debian-stretch-01-cd-boot.png"&gt;&lt;/p&gt;
&lt;p&gt;Select your language.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Select a language" src="https://xo.tc/images/debian-stretch-02-select-a-language.png"&gt;&lt;/p&gt;
&lt;p&gt;Select your location.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Select a location" src="https://xo.tc/images/debian-stretch-03-select-your-location.png"&gt;&lt;/p&gt;
&lt;p&gt;Set your keyboard layout.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Configure the Keyboard" src="https://xo.tc/images/debian-stretch-04-configure-the-keyboard.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick a &lt;a href="https://xkcd.com/910/"&gt;name&lt;/a&gt; for your computer.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Configure the network" src="https://xo.tc/images/debian-stretch-05-configure-the-network.png"&gt;&lt;/p&gt;
&lt;p&gt;Set your local domain.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Configure the network" src="https://xo.tc/images/debian-stretch-06-configure-the-network.png"&gt;&lt;/p&gt;
&lt;p&gt;I personally leave the root password blank, this disables the root account and instead sets you up with a first user that can run &lt;code&gt;sudo&lt;/code&gt; to become root.&lt;/p&gt;
&lt;p&gt;&lt;img alt="set up users and passwords" src="https://xo.tc/images/debian-stretch-07-set-up-users-and-passwords.png"&gt;&lt;/p&gt;
&lt;p&gt;Enter your full name.&lt;/p&gt;
&lt;p&gt;&lt;img alt="set up users and passwords" src="https://xo.tc/images/debian-stretch-08-set-up-users-and-passwords.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick your username (the default is usually pretty good).&lt;/p&gt;
&lt;p&gt;&lt;img alt="set up users and passwords" src="https://xo.tc/images/debian-stretch-09-set-up-users-and-passwords.png"&gt;&lt;/p&gt;
&lt;p&gt;Set your password.&lt;/p&gt;
&lt;p&gt;&lt;img alt="set up users and passwords" src="https://xo.tc/images/debian-stretch-10-set-up-users-and-passwords.png"&gt;&lt;/p&gt;
&lt;p&gt;Set your timezone.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Configure the clock" src="https://xo.tc/images/debian-stretch-11-configure-the-clock.png"&gt;&lt;/p&gt;
&lt;h2 id="the-encryption"&gt;The encryption&lt;/h2&gt;
&lt;p&gt;This is where the magic happens, actually it's quite simple, we are going to pick "Guided - use entire disk and set up encrypted LVM" and then just go with the defaults. As I said before if for some reason you want to manually partition your disks I would reccomend a previous &lt;a href="https://xo.tc/setting-up-full-disk-encryption-on-debian-jessie.html"&gt;tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-12-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Select the volume to install Debian. (This will wipe whatever you have on that disk!!)&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-13-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick "All files in one partition (recommended for new users)".&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-14-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick 'Yes' to write the changes to the disks.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-15-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Now the disk will be writen with random data, this is to prevent analysis of the disk. This step can be skipped by pressing cancle but it's highly reccomend you wait it out. It could take several minutes to a few hours so now is an absolutely smashing time to go and have a cup of tea.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-16-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Now set a passphrase for your disk.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-17-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Select "Finish partitioning and write changes to disk"&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-18-partition-disks.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick 'Yes' to write the changes to the disks.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Partition disks" src="https://xo.tc/images/debian-stretch-19-partition-disks.png"&gt;&lt;/p&gt;
&lt;h2 id="continue-the-installation"&gt;Continue the installation&lt;/h2&gt;
&lt;p&gt;Now we continue the installation as per normal.&lt;/p&gt;
&lt;p&gt;Pick 'No' for any extra CDs.&lt;/p&gt;
&lt;p&gt;&lt;img alt="configure the package manager" src="https://xo.tc/images/debian-stretch-20-configure-the-package-manager.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick your country to find a local mirror .&lt;/p&gt;
&lt;p&gt;&lt;img alt="configure the package manager" src="https://xo.tc/images/debian-stretch-21-configure-the-package-manager.png"&gt;&lt;/p&gt;
&lt;p&gt;And pick your mirror of choice, often (at least in Australia) you will find your local ISP has a mirror and this will likely be fastest for you.&lt;/p&gt;
&lt;p&gt;&lt;img alt="configure the package manager" src="https://xo.tc/images/debian-stretch-22-configure-the-package-manager.png"&gt;&lt;/p&gt;
&lt;p&gt;Enter any proxy information (most times this will be blank)&lt;/p&gt;
&lt;p&gt;&lt;img alt="configure the package manager" src="https://xo.tc/images/debian-stretch-23-configure-the-package-manager.png"&gt;&lt;/p&gt;
&lt;p&gt;You are given the option to opt-in to Debian's &lt;a href="http://popcon.debian.org/"&gt;statistics&lt;/a&gt; collection.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Configure the popularity contest" src="https://xo.tc/images/debian-stretch-24-configure-the-popularity-contest.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick your software, I've gone with KDE as my desktop of choice but it's a matter of personal taste.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Debian Software Selection" src="https://xo.tc/images/debian-stretch-25-software-selection.png"&gt;&lt;/p&gt;
&lt;p&gt;Install GRUB&lt;/p&gt;
&lt;p&gt;&lt;img alt="Install the grub boot loader on a hard disk" src="https://xo.tc/images/debian-stretch-26-install-the-grub-boot-loader-on-a-hard-disk.png"&gt;&lt;/p&gt;
&lt;p&gt;Pick your boot disk.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Install the grub boot loader on a hard disk" src="https://xo.tc/images/debian-stretch-27-install-the-grub-boot-loader-on-a-hard-disk.png"&gt;&lt;/p&gt;
&lt;p&gt;and finish the installation.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Finish the installation" src="https://xo.tc/images/debian-stretch-28-finish-the-installation.png"&gt;&lt;/p&gt;
&lt;h2 id="boot-your-system"&gt;Boot your system&lt;/h2&gt;
&lt;p&gt;Now when you boot up you should presented with a prompt asking for the key to decrypt sda5_crypt (your encrypted volumne)&lt;/p&gt;
&lt;p&gt;Enter your passphrase (&lt;strong&gt;Note:&lt;/strong&gt; you won't see characters as you type)&lt;/p&gt;
&lt;p&gt;&lt;img alt="Finish the installation" src="https://xo.tc/images/debian-stretch-29-decrypt-the-disk.png"&gt;&lt;/p&gt;
&lt;p&gt;Now you can log in and enjoy your new Debian system&lt;/p&gt;
&lt;p&gt;&lt;img alt="Finish the installation" src="https://xo.tc/images/debian-stretch-30-log-in.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Finish the installation" src="https://xo.tc/images/debian-stretch-31-running.png"&gt;&lt;/p&gt;</content><category term="Posts"></category><category term="Cryptography"></category><category term="LUKS"></category><category term="Debian"></category><category term="Linux"></category><category term="Full Disk Encryption"></category></entry><entry><title>Installing OpenCanary on a Raspberry Pi</title><link href="https://xo.tc/installing-opencanary-on-a-raspberry-pi.html" rel="alternate"></link><published>2017-06-22T07:00:00+08:00</published><updated>2017-06-22T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-06-22:/installing-opencanary-on-a-raspberry-pi.html</id><summary type="html">&lt;p&gt;A few recent &lt;a href="http://risky.biz/"&gt;Risky Business&lt;/a&gt; podcasts have been sponsored by Thinkst and they have been plugging their &lt;a href="https://canary.tools/"&gt;Canary tools&lt;/a&gt;. Basically, little honeypots that sit on your network and sends an alert when something tries to access them. To me, the idea sounded pretty cool but when I looked at their …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A few recent &lt;a href="http://risky.biz/"&gt;Risky Business&lt;/a&gt; podcasts have been sponsored by Thinkst and they have been plugging their &lt;a href="https://canary.tools/"&gt;Canary tools&lt;/a&gt;. Basically, little honeypots that sit on your network and sends an alert when something tries to access them. To me, the idea sounded pretty cool but when I looked at their &lt;a href="https://canary.tools/#pricing"&gt;pricing&lt;/a&gt; it said&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For under $10k, you get 5 Canaries, a dedicated console, and 5 licences for alerts, support and maintenance.   &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While for some organisations $10,000&lt;sup id="fnref:ten-thousand"&gt;&lt;a class="footnote-ref" href="#fn:ten-thousand"&gt;1&lt;/a&gt;&lt;/sup&gt; might be chicken feed for me that's prohibitively expensive. So I looked around for open source alternatives and was surprised to find that Thinkst have released &lt;a href="https://github.com/thinkst/opencanary"&gt;OpenCanary&lt;/a&gt;. It doesn't seem to be getting a whole lot of love with only a few commits in over a year at the time of this writing but I did have a spare Raspberry Pi and it's open source so if something is missing I can make a pull request.&lt;/p&gt;
&lt;h2 id="grab-a-raspberry-pi-and-install-raspbian"&gt;Grab a Raspberry Pi and Install Raspbian&lt;/h2&gt;
&lt;p&gt;Download the &lt;a href="https://www.raspberrypi.org/downloads/raspbian/"&gt;Raspbian Jessie Lite&lt;/a&gt; image and SSH in. There are already hundreds of tutorials so I'm going to skip this step and just assume you have a fresh Raspbian install that you can SSH into.&lt;/p&gt;
&lt;p&gt;If you haven't already, update all your packages.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get dist-upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-the-prerequisites"&gt;Install the prerequisites&lt;/h2&gt;
&lt;p&gt;Install the packages needed to build OpenCanary.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;python-virtualenv&lt;span class="w"&gt; &lt;/span&gt;python-pip&lt;span class="w"&gt; &lt;/span&gt;python-dev&lt;span class="w"&gt; &lt;/span&gt;libssl-dev&lt;span class="w"&gt; &lt;/span&gt;libffi-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-a-virtual-environment"&gt;Install a virtual environment&lt;/h2&gt;
&lt;p&gt;It's recommended that you run OpenCanary in a virtual environment. It makes managing libraries easier but if the only thing your going to run on the Raspberry Pi is OpenCanary it's not strictly necessary.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;virtualenv -p python2 canary-env
source ./canary-env/bin/activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The versions of pip and setuptools that come with Debian's virtualenv are a little out dated and need to be upgraded for OpenCanary&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;upgrade&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;setuptools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="clone-the-git-repository"&gt;Clone the git repository&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;https://github.com/thinkst/opencanary
&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;opencanary
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-opencanary"&gt;Install OpenCanary&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;python setup.py install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I got some build errors with Jinja2 but it's a &lt;a href="https://github.com/pallets/jinja/issues/643"&gt;known issue&lt;/a&gt; and does not impact OpenCanary.&lt;/p&gt;
&lt;p&gt;Also building cryptography and the other dependencies took about 10 minutes on my Raspberry Pi so now is an absolutely smashing time to go and have a cup of tea.&lt;/p&gt;
&lt;h2 id="setup-config-and-start-opencanary"&gt;Setup config and start OpenCanary&lt;/h2&gt;
&lt;p&gt;OpenCanary does have a &lt;code&gt;--copyconfig&lt;/code&gt; option which creates a config file in your home directory, however, I found that sometimes OpenCanary misses the config file in the home directory. I tried debugging it but in the end found it more reliable (and logical) to save the config to &lt;code&gt;/etc/opencanaryd/opencanary.conf&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo mkdir /etc/opencanaryd
sudo cp opencanary/data/settings.json /etc/opencanaryd/opencanary.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For some reason when I installed OpenCanary the &lt;code&gt;opencanary.tac&lt;/code&gt; file did not copy across correctly and I kept getting an error&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;Unhandled&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;
&lt;span class="n"&gt;Traceback&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;most&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;recent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/application/app.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;642&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/scripts/twistd.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;runApp&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;_SomeApplicationRunner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/application/app.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;376&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createOrGetApplication&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/application/app.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;441&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;createOrGetApplication&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;getApplication&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;passphrase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;caught&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;here&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/application/app.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;452&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;getApplication&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loadApplication&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;passphrase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/application/service.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;405&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;loadApplication&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loadValueFromFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;application&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;passphrase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/lib/python2.7/dist-packages/Twisted-14.0.2-py2.7-linux-armv7l.egg/twisted/persisted/sob.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;loadValueFromFile&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;exec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fileObj&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/bin/opencanary.tac&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;__import__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;pkg_resources&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;opencanary==0.3.2&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;opencanary.tac&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/lib/python2.7/dist-packages/pkg_resources.py&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;531&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;run_script&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ns&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;__name__&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;exceptions&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;KeyError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;__name__&amp;#39;&lt;/span&gt;

&lt;span class="n"&gt;Failed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;load&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;__name__&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/blockquote&gt;
&lt;p&gt;I needed to copy the tac file manually.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cp bin/opencanary.tac /home/pi/canary-env/bin/opencanary.tac
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I also found the default Raspbian image has the NTP service running and so port 123 was already in use. I chose to disable the NTP module in OpenCanary&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo nano /etc/opencanaryd/opencanary.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;"ntp.enabled": false,&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Alternatively, you could leave the NTP module enabled and disable the service on the Raspberry Pi&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl stop ntp.service
sudo systemctl disable ntp.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="start-opencanaryd"&gt;Start OpenCanaryd&lt;/h2&gt;
&lt;p&gt;As a bit of a "Hello World!" start opencanaryd in developer mode so it runs process in the foreground to check it's all working&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;opencanaryd --dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Hopefully, you will see a message that contains &lt;code&gt;Canary running!!!&lt;/code&gt; although you will probably also see a number of &lt;code&gt;Dropping log message due to too many failed sends&lt;/code&gt; messages as well. This is because opencanaryd trying to send messages to &lt;a href="https://github.com/thinkst/opencanary-correlator"&gt;opencanary-correlator&lt;/a&gt; but we don't have that setup yet.&lt;/p&gt;
&lt;p&gt;At this point you can have a play with your canary, try to nmap it or telet to it and see the output.&lt;/p&gt;
&lt;p&gt;Once you have had some fun Ctrl + C out to close opencanaryd&lt;/p&gt;
&lt;h2 id="setup-email-alerts"&gt;Setup Email Alerts&lt;/h2&gt;
&lt;p&gt;Apparently, it's possible to have your canary log directly to &lt;a href="http://docs.opencanary.org/en/latest/alerts/email.html"&gt;email&lt;/a&gt; but when I tried I couldn't get it to work.&lt;/p&gt;
&lt;p&gt;I looked at opencanary-correlator, but it uses &lt;a href="https://www.mandrill.com/"&gt;mandrill&lt;/a&gt; for mail and that's now a paid MailChimp add-on which I didn't want to use.&lt;/p&gt;
&lt;p&gt;In the end, I found it quicker and easier to write a &lt;a href="https://github.com/HybridAU/canary_log_forwarder/blob/master/canary_log_forwarder.py"&gt;simple python script&lt;/a&gt; to work like correlator and forward all alerts to an email address.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo nano canary_log_forwarder.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Add your email addresses and SMTP server into the script and save it.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;Forwards logs from OpenCanary that come in on port 1514 to an email address.&lt;/span&gt;

&lt;span class="sd"&gt;This is a very simple script, it does no validation on the logs, it just&lt;/span&gt;
&lt;span class="sd"&gt;forwards everything that comes in.&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;smtplib&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;email.mime.text&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MIMEText&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;email.mime.multipart&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MIMEMultipart&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;twisted.internet&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reactor&lt;/span&gt;

&lt;span class="c1"&gt;# Settings&lt;/span&gt;
&lt;span class="n"&gt;FROM_ADDRESS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;opencanary@example.com&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;TO_ADDRESS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;security@example.com&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;SMTP_SERVER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;mail.example.com&amp;#39;&lt;/span&gt;
&lt;span class="c1"&gt;# Saving passwords in a file is not a great idea. If you do need to log in to&lt;/span&gt;
&lt;span class="c1"&gt;# your SMTP server, at the very least make sure this file is not world readable&lt;/span&gt;
&lt;span class="c1"&gt;# e.g. `chmod 700 canary_log_forwarder.py`&lt;/span&gt;
&lt;span class="n"&gt;SMTP_USERNAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;span class="n"&gt;SMTP_PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Protocol&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dataReceived&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEMultipart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;alternative&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;message_body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;plain&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Subject&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Alert from OpenCanary&amp;#39;&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;From&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FROM_ADDRESS&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;To&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TO_ADDRESS&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message_body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;smtplib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SMTP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SMTP_SERVER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ehlo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;starttls&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ehlo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="c1"&gt;# Login if applicable&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;SMTP_PASSWORD&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;SMTP_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SMTP_USERNAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SMTP_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FROM_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;TO_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_string&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmailFactory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Factory&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;buildProtocol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;SendEmail&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="n"&gt;reactor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listenTCP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1514&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EmailFactory&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;reactor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="make-it-a-service"&gt;Make it a service&lt;/h2&gt;
&lt;p&gt;Now we have everything setup we want to make it run as a service and start automatically when we boot up the Raspberry Pi. So we will create two systemd &lt;code&gt;.service&lt;/code&gt; files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo nano /etc/systemd/system/opencanary.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Unit]&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;OpenCanary honeypot&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;syslog.target&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;span class="na"&gt;User&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;pi&lt;/span&gt;
&lt;span class="na"&gt;Restart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;VIRTUAL_ENV=/home/pi/canary-env/&lt;/span&gt;
&lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;PATH=$VIRTUAL_ENV/bin:/usr/bin:$PATH&lt;/span&gt;
&lt;span class="na"&gt;WorkingDirectory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/home/pi/canary-env/bin&lt;/span&gt;
&lt;span class="na"&gt;ExecStart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/home/pi/canary-env/bin/opencanaryd --dev&lt;/span&gt;

&lt;span class="k"&gt;[Install]&lt;/span&gt;
&lt;span class="na"&gt;WantedBy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo nano /etc/systemd/system/canary-log-forwarder.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Unit]&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Canary log forwarder&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;syslog.target&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;span class="na"&gt;User&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;pi&lt;/span&gt;
&lt;span class="na"&gt;Restart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;VIRTUAL_ENV=/home/pi/canary-env/&lt;/span&gt;
&lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;PATH=$VIRTUAL_ENV/bin:$PATH&lt;/span&gt;
&lt;span class="na"&gt;WorkingDirectory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/home/pi/canary-env/&lt;/span&gt;
&lt;span class="na"&gt;ExecStart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/home/pi/canary-env/bin/python /home/pi/opencanary/canary_log_forwarder.py&lt;/span&gt;

&lt;span class="k"&gt;[Install]&lt;/span&gt;
&lt;span class="na"&gt;WantedBy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl enable canary-log-forwarder.service opencanary.service
sudo systemctl start canary-log-forwarder.service opencanary.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h1 id="finshed"&gt;Finshed&lt;/h1&gt;
&lt;p&gt;Your canary should now be all set up and ready to run. &lt;/p&gt;
&lt;p&gt;It's a good idea to reboot it just to make sure all the services start correctly.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo reboot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You should get emailed when it boots up letting you know that all the services have started.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:ten-thousand"&gt;
&lt;p&gt;I know the website said "Under $10k" but they wouldn't phrase it like that if the price was $300.&amp;#160;&lt;a class="footnote-backref" href="#fnref:ten-thousand" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Raspberry Pi"></category><category term="OpenCanary"></category><category term="Canary tools"></category><category term="Python"></category><category term="Debian"></category><category term="Honeypot"></category></entry><entry><title>Why I like the MIT License</title><link href="https://xo.tc/why-i-like-the-mit-license.html" rel="alternate"></link><published>2017-06-15T07:00:00+08:00</published><updated>2017-06-15T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-06-15:/why-i-like-the-mit-license.html</id><summary type="html">&lt;p&gt;Recently I've spent a little too much time thinking about open source licenses.&lt;/p&gt;
&lt;p&gt;Whenever I start a new project I struggled to pick a license, there are dosens open source licenses that are all more or less the same. In fact worese than being the same many licenses that have …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently I've spent a little too much time thinking about open source licenses.&lt;/p&gt;
&lt;p&gt;Whenever I start a new project I struggled to pick a license, there are dosens open source licenses that are all more or less the same. In fact worese than being the same many licenses that have the same goals are subtlety incompatible with one another.&lt;/p&gt;
&lt;p&gt;Linus has &lt;a href="https://www.youtube.com/watch?v=PaKIZ7gJlRU"&gt;expressed&lt;/a&gt; why he likes GPLv2 and not GPLv3. Even within BSD license there are &lt;a href="https://en.wikipedia.org/wiki/BSD_licenses"&gt;diffrent versions&lt;/a&gt; which can be confusing.&lt;/p&gt;
&lt;p&gt;The MIT license however is, short, simple, open, doesn't have lot's of diffrent variants and I was supprised to find it's the &lt;a href="https://github.com/blog/1964-open-source-license-usage-on-github-com"&gt;most popular license&lt;/a&gt; on GitHub so it's very well known.&lt;/p&gt;</content><category term="Posts"></category><category term="Open source"></category><category term="License"></category></entry><entry><title>ASD's Essential Eight</title><link href="https://xo.tc/asds-essential-eight.html" rel="alternate"></link><published>2017-06-08T07:00:00+08:00</published><updated>2017-06-08T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-06-08:/asds-essential-eight.html</id><summary type="html">&lt;p&gt;I've long been a fan of the advice from the Australian Signals Directorate (ASD) [previously the Defence Signals Directorate (DSD)]. Not too long ago they changed their "Top 4" to their "&lt;a href="https://asd.gov.au/publications/protect/essential-eight-explained.htm"&gt;Essential Eight&lt;/a&gt;".&lt;/p&gt;
&lt;p&gt;What I like about ASD's advice is that it's easy to read, in comparison ISO 27001:2013 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've long been a fan of the advice from the Australian Signals Directorate (ASD) [previously the Defence Signals Directorate (DSD)]. Not too long ago they changed their "Top 4" to their "&lt;a href="https://asd.gov.au/publications/protect/essential-eight-explained.htm"&gt;Essential Eight&lt;/a&gt;".&lt;/p&gt;
&lt;p&gt;What I like about ASD's advice is that it's easy to read, in comparison ISO 27001:2013 might be full of great advice but even the name is indecipherable jargon to most people.&lt;/p&gt;
&lt;p&gt;ASD's Essential Eight are simple to understand, and with the exception of Application whitelisting, they are relatively easy to implement. They are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Application whitelisting&lt;/li&gt;
&lt;li&gt;Patch applications&lt;/li&gt;
&lt;li&gt;Disable untrusted Microsoft Office macros&lt;/li&gt;
&lt;li&gt;User application hardening (Uninstall shovelware)&lt;/li&gt;
&lt;li&gt;Restrict administrative privileges&lt;/li&gt;
&lt;li&gt;Patch operating systems&lt;/li&gt;
&lt;li&gt;Multi-factor authentication&lt;/li&gt;
&lt;li&gt;Daily backup of important data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While it might be fun to install blinky-light boxes that run fancy machine learning algorithms and cost a fortune. ASD's Essential Eight are cheap, simple and effective and will definitely get you your best bang for your buck.&lt;/p&gt;</content><category term="Posts"></category><category term="ASD"></category><category term="Defence in Depth"></category></entry><entry><title>Designing for Failure</title><link href="https://xo.tc/designing-for-failure.html" rel="alternate"></link><published>2017-06-01T07:00:00+08:00</published><updated>2017-06-01T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-06-01:/designing-for-failure.html</id><summary type="html">&lt;p&gt;I recently purchased my grandfather's house which he built himself in the mid 1950s. My fiancé and I were painting the house and we came across a pipe sticking out of the wall just above the rain water tank.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Pipe above rain water tank" src="https://xo.tc/images/pipe-above-rain-water-tank.png"&gt;&lt;/p&gt;
&lt;p&gt;Looking inside the roof we discoved that this pipe came from …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently purchased my grandfather's house which he built himself in the mid 1950s. My fiancé and I were painting the house and we came across a pipe sticking out of the wall just above the rain water tank.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Pipe above rain water tank" src="https://xo.tc/images/pipe-above-rain-water-tank.png"&gt;&lt;/p&gt;
&lt;p&gt;Looking inside the roof we discoved that this pipe came from a large metal tray that was sitting underneath the hot water system. The manufacturers of the hot water system never intended for the tank to leak&lt;sup id="fnref:leak"&gt;&lt;a class="footnote-ref" href="#fn:leak"&gt;1&lt;/a&gt;&lt;/sup&gt; but it's something my grand father clearly though about and designed for just incase.&lt;/p&gt;
&lt;p&gt;Simiarly on the roof there is a copper pipe that looks a bit like a shepherd's crook that comes out of the hot water system.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Shepherd's crook pipe" src="https://xo.tc/images/shepherds-crook-pipe.png"&gt;&lt;/p&gt;
&lt;p&gt;The idea is that if the tank somehow got overfilled and then the water got boiled and expanded, rather than the tank exploding with the pressure, the boiling water would be forced up the pipe and pour out on the roof. As far as I'm aware the tank has never been overfilled or over boiled, but it's good to have a contingency just incase.&lt;/p&gt;
&lt;p&gt;In IT we are getting better at designing for failure, things like RAID or small office routers that now come with both DSL and a 4G modem so if the DSL dropps out it switches over.&lt;/p&gt;
&lt;p&gt;In Information Security we have ideas like defence in depth and layered security. They are a good start but we need to keep working on them.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:leak"&gt;
&lt;p&gt;And to their credit the tank is older than I am and still going well.&amp;#160;&lt;a class="footnote-backref" href="#fnref:leak" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Defence in Depth"></category><category term="Backups"></category></entry><entry><title>Fair use and copyright reform in Australia</title><link href="https://xo.tc/fair-use-and-copyright-reform-in-australia.html" rel="alternate"></link><published>2017-05-25T07:00:00+08:00</published><updated>2017-05-25T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-05-25:/fair-use-and-copyright-reform-in-australia.html</id><summary type="html">&lt;p&gt;I've just finished listening to the audio book of Cory Doctorow's &lt;a href="http://craphound.com/news/2014/12/10/information-doesnt-want-to-be-free-audiobook/"&gt;Information Doesn't Want to Be Free&lt;/a&gt;. It's a fascinating read and I'd recommend it to anyone interested in copyright.&lt;/p&gt;
&lt;p&gt;Admittedly some bits are a little repetitive but it really hammers home how broken the current copyright system is and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've just finished listening to the audio book of Cory Doctorow's &lt;a href="http://craphound.com/news/2014/12/10/information-doesnt-want-to-be-free-audiobook/"&gt;Information Doesn't Want to Be Free&lt;/a&gt;. It's a fascinating read and I'd recommend it to anyone interested in copyright.&lt;/p&gt;
&lt;p&gt;Admittedly some bits are a little repetitive but it really hammers home how broken the current copyright system is and how much damage archaic copyright laws are doing to the internet.&lt;/p&gt;
&lt;p&gt;At the same time &lt;a href="https://www.efa.org.au/2017/05/23/faircopyright/"&gt;Electronic Frontiers Australia&lt;/a&gt;, a number of &lt;a href="https://meta.wikimedia.org/wiki/FairCopyrightOz"&gt;Australian Wikipedians&lt;/a&gt; and the &lt;a href="http://www.digital.org.au"&gt;Australian Digital Alliance&lt;/a&gt; have released a new website  &lt;a href="https://www.faircopyright.org.au/"&gt;faircopyright.org.au&lt;/a&gt; which is campaigning for more sensible copyright laws in Australia.&lt;/p&gt;
&lt;p&gt;I personally would be willing to buy a copy of Information Doesn't Want to Be Free for any Australian MP who is willing to listen to or read it and I'm planing on sending an email to my local MP to that effect.&lt;/p&gt;</content><category term="Posts"></category><category term="Copyright"></category><category term="EFA"></category><category term="Books"></category><category term="Wikipedia"></category></entry><entry><title>If you're not paying for it you're not the customer you're the product</title><link href="https://xo.tc/if-youre-not-paying-for-it-youre-not-the-customer-youre-the-product.html" rel="alternate"></link><published>2017-05-18T07:00:00+08:00</published><updated>2017-05-18T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-05-18:/if-youre-not-paying-for-it-youre-not-the-customer-youre-the-product.html</id><summary type="html">&lt;p&gt;There are exceptions to every rule. I'm certainly not saying every free service exists to profit from it's users. I believe in charity and people doing things for the common good. &lt;a href="https://en.wikipedia.org/wiki/Wikipedia"&gt;Wikipedia&lt;/a&gt; and the &lt;a href="https://www.kernel.org/"&gt;Linux Kernel&lt;/a&gt; are great examples.&lt;/p&gt;
&lt;p&gt;But even with Wikipedia, I would say the "customer" are people …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There are exceptions to every rule. I'm certainly not saying every free service exists to profit from it's users. I believe in charity and people doing things for the common good. &lt;a href="https://en.wikipedia.org/wiki/Wikipedia"&gt;Wikipedia&lt;/a&gt; and the &lt;a href="https://www.kernel.org/"&gt;Linux Kernel&lt;/a&gt; are great examples.&lt;/p&gt;
&lt;p&gt;But even with Wikipedia, I would say the "customer" are people who donate&lt;sup id="fnref:donate"&gt;&lt;a class="footnote-ref" href="#fn:donate"&gt;1&lt;/a&gt;&lt;/sup&gt; and what they are "buying" is a world where everyone&lt;sup id="fnref:everyone"&gt;&lt;a class="footnote-ref" href="#fn:everyone"&gt;2&lt;/a&gt;&lt;/sup&gt; has access to information.&lt;/p&gt;
&lt;p&gt;That might be pushing the metaphor a bit too far, but I think it's always worth thinking about who is paying the bills of any free service.&lt;/p&gt;
&lt;p&gt;Even this blog, I'm paying the bills&lt;sup id="fnref:bills"&gt;&lt;a class="footnote-ref" href="#fn:bills"&gt;3&lt;/a&gt;&lt;/sup&gt;, and the customer isn't the people reading the blog it's me, I'm paying for a platform where I can &lt;strike&gt;rant&lt;/strike&gt; express my self.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:donate"&gt;
&lt;p&gt;As a disclaimer, I have donated to Wikipedia a few times when they do their funding drives. I think it's a worthy cause and I would encorage others to do so too.&amp;#160;&lt;a class="footnote-backref" href="#fnref:donate" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:everyone"&gt;
&lt;p&gt;Everyone with an internet connection. For now, but we buy into the dream that one day everyone in the world will have access to information.&amp;#160;&lt;a class="footnote-backref" href="#fnref:everyone" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:bills"&gt;
&lt;p&gt;In case you're wondering, I pay $20 AUD a month on hosting with &lt;a href="http://ransomit.com.au/"&gt;RansomIT&lt;/a&gt; and $70 USD per year for the domain name.&amp;#160;&lt;a class="footnote-backref" href="#fnref:bills" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Philosophy"></category></entry><entry><title>Upgrading a Nexus 6P from CyanogenMod 13 to LineageOS 14</title><link href="https://xo.tc/upgrading-a-nexus-6p-from-cyanogenmod-13-to-lineageos-14.html" rel="alternate"></link><published>2017-05-11T07:00:00+08:00</published><updated>2017-05-11T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-05-11:/upgrading-a-nexus-6p-from-cyanogenmod-13-to-lineageos-14.html</id><summary type="html">&lt;p&gt;There is an experimental build of LineageOS 14 which can upgrade from CyanogenMod 13 but I thought this was a good opportunity to clear some of the cruft off my phone and start again.&lt;/p&gt;
&lt;h2 id="backing-up-the-phone"&gt;Backing up the phone&lt;/h2&gt;
&lt;p&gt;There were only a few files on my phone I wanted to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is an experimental build of LineageOS 14 which can upgrade from CyanogenMod 13 but I thought this was a good opportunity to clear some of the cruft off my phone and start again.&lt;/p&gt;
&lt;h2 id="backing-up-the-phone"&gt;Backing up the phone&lt;/h2&gt;
&lt;p&gt;There were only a few files on my phone I wanted to copy off. All my photos, contacts and calendar are synced with NextCloud so I already had them backed up.&lt;/p&gt;
&lt;p&gt;But I wanted to get a copy of the seed values from Google Authenticator and I wanted to keep a copy of my text messages&lt;sup id="fnref:text-messages"&gt;&lt;a class="footnote-ref" href="#fn:text-messages"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;To pull out the Google Authenticator database you need to enable adb and root access&lt;sup id="fnref:root-access"&gt;&lt;a class="footnote-ref" href="#fn:root-access"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;To do this go into Setting &amp;gt; About Phone and tap on 'Buld Number' 7 times.&lt;/p&gt;
&lt;p&gt;Then go back and go into Developer options.&lt;/p&gt;
&lt;p&gt;Scroll down to root access and pick ADB only.&lt;/p&gt;
&lt;p&gt;Scroll down to Debuguging and switch Android debugging on.&lt;/p&gt;
&lt;p&gt;Next you need to install ADB onto your computer, for me on Arch Linux that was as simple as&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pacman&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;android&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;for Debian / Ubuntu that should be&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;android&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adb&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once you have adb installed you can connect your phone via the USB cable. You may need to accept a prompt on your phone to connect adb and trust the computer and the you can run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;adb root
adb pull /data/data/com.google.android.apps.authenticator2/databases/databases authenticator.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This will pull out your Google Authenticator database out. It's just a simple sqlite database and you can have a look through it.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sqlite3 authenticator.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;SQLite&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;version&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;18&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;2017-03-28&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;18&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;48&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;43&lt;/span&gt;
&lt;span class="nt"&gt;Enter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;.help&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;usage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;hints&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="nt"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;tables&lt;/span&gt;
&lt;span class="nt"&gt;accounts&lt;/span&gt;&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="nt"&gt;android_metadata&lt;/span&gt;
&lt;span class="nt"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;accounts&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;Gmail&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;
&lt;span class="nt"&gt;2&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;GitHub&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;
&lt;span class="nt"&gt;3&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;Amazon&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;Web&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;Services&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;simiarly we can now pull out our old text messages database with.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;adb pull /data/data/com.android.providers.telephony/databases/mmssms.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and have a look through them&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sqlite3 mmssms.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="whipe-the-phone"&gt;Whipe the phone&lt;/h2&gt;
&lt;p&gt;We reboot the phone into TeamWin Recovery mode by holding the volume down key while booting. Then press the volume up and down to scroll to Recovery mode and click the power button.&lt;/p&gt;
&lt;p&gt;Then pick Wipe. I personally did Advance Wipe and picked all the partitions. I don't think this was necessary but I think it's cleaner to start off with a compleatly blank phone.&lt;/p&gt;
&lt;h2 id="flash-the-new-firmware"&gt;Flash the new firmware&lt;/h2&gt;
&lt;p&gt;Next we flash the new firmware.&lt;/p&gt;
&lt;p&gt;Reboot again, and hold the volume down key but this time wait at the menu where it says Reboot bootloader.&lt;/p&gt;
&lt;p&gt;When I first ran &lt;code&gt;fastboot devices&lt;/code&gt; I got an error message&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;fastboot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;devices&lt;/span&gt;
&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;see&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;developer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;android&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;fastboot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But running it as root worked. I &lt;a href="https://forum.xda-developers.com/nexus-6p/orig-development/rom-cm14-1-nexus-6p-angler-t3498453"&gt;downloaded&lt;/a&gt; and flashed the vendor image, radio firmware and bootloader.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fastboot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;flash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vendor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vendor&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;n2g47h&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;
&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fastboot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;flash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;radio&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;radio&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;angler&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;angler&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;03.81&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;
&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fastboot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;flash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;bootloader&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;bootloader&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;angler&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;angler&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;03.67&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-lineageos"&gt;Install LineageOS&lt;/h2&gt;
&lt;p&gt;Now we reboot into into TeamWin Recovery mode.&lt;/p&gt;
&lt;p&gt;Use adb to push a copy of lineage-14 onto the phone&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;adb push lineage-14.1-20170501-nightly-angler-signed.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and pick Install then select the zip file and follow the prompts.&lt;/p&gt;
&lt;p&gt;Now we reboot then wait ... wait some more .... then after about a minute when your just starting to think "Oh Jeez I've bricked my phone" you will be greeted by the LineageOS boot screen.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:text-messages"&gt;
&lt;p&gt;I'm a bit of a hoarder with my data, storage is so cheap and it's so easy to keep it all forever. Signal has &lt;a href="https://whispersystems.org/blog/disappearing-messages/"&gt;disappearing messages&lt;/a&gt; and it's a great idea, some conversations ephemeral but I just can't bring myself to delete my message history.&amp;#160;&lt;a class="footnote-backref" href="#fnref:text-messages" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:root-access"&gt;
&lt;p&gt;Just incase it's not obvious enabling root access is a horible idea from a security point of view, I'd only do it when necessary and remove it again straight away.&amp;#160;&lt;a class="footnote-backref" href="#fnref:root-access" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="CyanogenMod"></category><category term="LineageOS"></category></entry><entry><title>Inbox Zero</title><link href="https://xo.tc/inbox-zero.html" rel="alternate"></link><published>2017-05-04T07:00:00+08:00</published><updated>2017-05-04T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-05-04:/inbox-zero.html</id><summary type="html">&lt;p&gt;There must be hundreds of diffrent strategies for dealing with the constant flood of requests that come in through out the day. My personal favorite for email is &lt;a href="https://www.youtube.com/watch?v=z9UjeTMb3Yk"&gt;Inbox Zero&lt;/a&gt;. If you havn't come across it before you should go and check it out, it might not be the one …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There must be hundreds of diffrent strategies for dealing with the constant flood of requests that come in through out the day. My personal favorite for email is &lt;a href="https://www.youtube.com/watch?v=z9UjeTMb3Yk"&gt;Inbox Zero&lt;/a&gt;. If you havn't come across it before you should go and check it out, it might not be the one that works for you but you should at least take a look.&lt;/p&gt;
&lt;p&gt;The thing that really stuck for me was that your inbox shouldn't be a reminder system, most office suites already have two tools that do that better; your calender and a your task / to do list.&lt;/p&gt;
&lt;p&gt;Instead of leaving an email that's otherwise dealt with in your inbox thinking "I must follow that up next week when Jo gets back from leave ... " archive the email and stick an appointment in your calendar for some time after Jo gets back that says "Follow up &lt;em&gt;thing&lt;/em&gt; with Jo."&lt;/p&gt;</content><category term="Posts"></category><category term="Email"></category><category term="Organisation"></category></entry><entry><title>Installing Python 3.6 on Windows</title><link href="https://xo.tc/installing-python-36-on-windows.html" rel="alternate"></link><published>2017-04-27T07:00:00+08:00</published><updated>2017-04-27T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-04-27:/installing-python-36-on-windows.html</id><summary type="html">&lt;p&gt;Installing Python on Windows is not that hard, but I want the 64 bit version and I want it installed system wide and neither of these are defaults so we need to change things a little.&lt;/p&gt;
&lt;p&gt;First we go to &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; and navigate to Downloads &amp;gt; Windows&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python Downloads Windows" src="https://xo.tc/images/python-windows-install-1-home-page.png"&gt;&lt;/p&gt;
&lt;p&gt;Then we need …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Installing Python on Windows is not that hard, but I want the 64 bit version and I want it installed system wide and neither of these are defaults so we need to change things a little.&lt;/p&gt;
&lt;p&gt;First we go to &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; and navigate to Downloads &amp;gt; Windows&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python Downloads Windows" src="https://xo.tc/images/python-windows-install-1-home-page.png"&gt;&lt;/p&gt;
&lt;p&gt;Then we need to download the 64-bit exceutable installer.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python Downloads Windows 64-bit" src="https://xo.tc/images/python-windows-install-2-64-bit-executable.png"&gt;&lt;/p&gt;
&lt;p&gt;We run the installer, first tick "Add Python 3.6 to PATH" this makes life much easier because we can simply call python from the command line. Next click "Customize installation"&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python Installer First Page" src="https://xo.tc/images/python-windows-install-3-installer-first-page.png"&gt;&lt;/p&gt;
&lt;p&gt;I install all the optional features (this is the default anyway) so we simply hit next.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python optional features" src="https://xo.tc/images/python-windows-install-4-installer-optional-features.png"&gt;&lt;/p&gt;
&lt;p&gt;In the Advanced Options tick "Install for all users" this will change the path from &lt;code&gt;C:\Users\your.name\AppData\Local\Programs\Python\Python36&lt;/code&gt; to &lt;code&gt;C:\Program Files\Python36&lt;/code&gt; which will make it system wide. Then hit Install&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python optional features" src="https://xo.tc/images/python-windows-install-5-installer-advanced-options.png"&gt;&lt;/p&gt;
&lt;p&gt;This will ask for elevated privlages and then run though installing and your done.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Python optional features" src="https://xo.tc/images/python-windows-install-6-installer-running.png"&gt;&lt;/p&gt;
&lt;p&gt;I understand that the Python installer probably defaults to installing the 32 bit version for just the local user for compatibility reasons. It's better to have defaults that will work for everyone, but for me I almost always install python to run things like scheduled tasks and system scripts so this is how I like my Python set up.&lt;/p&gt;</content><category term="Posts"></category><category term="Python"></category><category term="Windows"></category></entry><entry><title>Spam Filtering</title><link href="https://xo.tc/spam-filtering.html" rel="alternate"></link><published>2017-04-20T07:00:00+08:00</published><updated>2017-04-20T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-04-20:/spam-filtering.html</id><summary type="html">&lt;p&gt;Since I've started hosting my own email server I've been using spam assassin for my spam filtering. All in all it does a pretty good job of stopping spam but unfortuantly without the volume of mail Google has to train it's filter it will simply never be as good as …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Since I've started hosting my own email server I've been using spam assassin for my spam filtering. All in all it does a pretty good job of stopping spam but unfortuantly without the volume of mail Google has to train it's filter it will simply never be as good as what you can get from hosted email with one of the major providers.&lt;/p&gt;
&lt;p&gt;Recently I've decided that instead of constantly trying to tweak my spam filtering rules, adding new real time black lists, and so on. I've simply turned spam assassin up to be very agressive and then started using a whitelist of people and domains that I receive email from regularly.&lt;/p&gt;
&lt;p&gt;I know that it's not an approach that would scale past a couple of people, let alone a millions like the major providers have to deal with, but for me I rarely receive email from people I have not communicated with before and simply exporting my contacts list and whitelisting those addresses seems to be working pretty well.&lt;/p&gt;</content><category term="Posts"></category><category term="Spam"></category><category term="Email"></category><category term="Good-bye-Google"></category></entry><entry><title>Moving beyond PEP 8</title><link href="https://xo.tc/moving-beyond-pep-8.html" rel="alternate"></link><published>2017-04-13T07:00:00+08:00</published><updated>2017-04-13T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-04-13:/moving-beyond-pep-8.html</id><summary type="html">&lt;p&gt;I recently watched Raymond Hettinger - &lt;a href="https://www.youtube.com/watch?v=wf-BqAjZb8M"&gt;Beyond PEP 8 -- Best practices for beautiful intelligible code&lt;/a&gt; - from PyCon 2015. It was an ammazing talk and I'd higly reccomend it to anyone wanting to write readable Python code.&lt;/p&gt;
&lt;p&gt;One of the first things he tackled was the &lt;a href="https://www.python.org/dev/peps/pep-0008/#maximum-line-length"&gt;79 character&lt;/a&gt; line limit. That's something …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently watched Raymond Hettinger - &lt;a href="https://www.youtube.com/watch?v=wf-BqAjZb8M"&gt;Beyond PEP 8 -- Best practices for beautiful intelligible code&lt;/a&gt; - from PyCon 2015. It was an ammazing talk and I'd higly reccomend it to anyone wanting to write readable Python code.&lt;/p&gt;
&lt;p&gt;One of the first things he tackled was the &lt;a href="https://www.python.org/dev/peps/pep-0008/#maximum-line-length"&gt;79 character&lt;/a&gt; line limit. That's something that has always annoyed me, as I personally like long and descriptive variable names and if your already tabbed in four or eight spaces it dosn't always leave a lot of space for your code. I know I've been guilty of writing worse and less readable code just to make my code squeeze into the space available. Really if your code is PEP 8 compliant but harder to read then you have missed the point of PEP 8.&lt;/p&gt;
&lt;p&gt;I feel very strongly about descriptive variable names, I've worked with software that was originaly written for Gupta SQL Base in 1992 when it &lt;a href="http://support.guptatechnologies.com/Docs/SQLBase/Books/sqllang10/sqllang_sql_elements.htm"&gt;didn't support&lt;/a&gt; column names longer than 18 character. This lead to some great names like &lt;code&gt;PRJ_CON_RET_DAT&lt;/code&gt;, you might be able to work out what is but a variable like &lt;code&gt;project_contract_returned_date&lt;/code&gt; is so much easier to understand. Some people have said long descriptive variable are hard to type, but I think people should be using an editor with autocomplete.&lt;/p&gt;
&lt;p&gt;Raymond also tackes a few other ways to make your code more pythonic.&lt;/p&gt;</content><category term="Posts"></category><category term="Python"></category><category term="PEP8"></category></entry><entry><title>Calculating a base64 encoded sha256 sum of inline scripts for your content security policy</title><link href="https://xo.tc/calculating-a-base64-encoded-sha256-sum-of-inline-scripts-for-your-content-security-policy.html" rel="alternate"></link><published>2017-04-06T07:00:00+08:00</published><updated>2017-04-06T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-04-06:/calculating-a-base64-encoded-sha256-sum-of-inline-scripts-for-your-content-security-policy.html</id><summary type="html">&lt;p&gt;A while ago I wrote a post on &lt;a href="https://xo.tc/http-secuirty-headers.html"&gt;HTTP Security Headers&lt;/a&gt; and part of that invloved setting up a content security policy (CSP) and in that I say&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I've done a SHA-256 hash of the script&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and I just left it at that, simple right? Only now a it's little …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A while ago I wrote a post on &lt;a href="https://xo.tc/http-secuirty-headers.html"&gt;HTTP Security Headers&lt;/a&gt; and part of that invloved setting up a content security policy (CSP) and in that I say&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I've done a SHA-256 hash of the script&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and I just left it at that, simple right? Only now a it's little over a year later, I've changed my piwik domain and I need to change my inline script only I can't remember how I calculated the sum.&lt;/p&gt;
&lt;p&gt;For those who have &lt;strong&gt;already have a CSP&lt;/strong&gt; I'd recomend;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open Chrome&lt;/li&gt;
&lt;li&gt;Hit F12 to get the console&lt;/li&gt;
&lt;li&gt;Load your page&lt;/li&gt;
&lt;li&gt;Find the error message which helpfully contains exactly what you need to add to your CSP&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So in my case chrome provided me with:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Either the 'unsafe-inline' keyword, &lt;strong&gt;a hash ('sha256-j69kMLNHErwf2Xyju05S+HrqhF6iQdmyWjxO2peCm10=')&lt;/strong&gt;, or a nonce ('nonce-...') is required to enable inline execution.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;(emphasis mine)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Content Security Policy vialation" src="https://xo.tc/images/content-security-policy-vialation.png"&gt;&lt;/p&gt;
&lt;p&gt;Of course that's fine if you are ok with temporarily breaking your script but what if you want to calculate it before putting it on you your site?&lt;/p&gt;
&lt;p&gt;My new inline script is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cm"&gt;&amp;lt;!-- Piwik --&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;_paq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;_paq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nx"&gt;_paq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;trackPageView&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nx"&gt;_paq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;enableLinkTracking&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;//piwik.xo.tc/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;_paq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;setTrackerUrl&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;piwik.php&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;_paq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;setSiteId&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;script&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;script&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mf"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;text/javascript&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;defer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;piwik.js&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parentNode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;insertBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;noscript&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;//piwik.xo.tc/piwik.php?idsite=2&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;border:0;&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;noscript&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="cm"&gt;&amp;lt;!-- End Piwik Code --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we don't include the &amp;lt;script&amp;gt; tags but white space is significant so in my case I needed a line break (blank line) at the start because there is a linebreak just after the opeing &amp;lt;script&amp;gt; tag but I didn't need a blank line at the end. I saved a &lt;a href="https://xo.tc/documents/piwik_script.txt"&gt;text file&lt;/a&gt; with the script in it and ran&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;openssl&lt;span class="w"&gt; &lt;/span&gt;dgst&lt;span class="w"&gt; &lt;/span&gt;-sha256&lt;span class="w"&gt; &lt;/span&gt;-binary&lt;span class="w"&gt; &lt;/span&gt;piwik_script.txt&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;openssl&lt;span class="w"&gt; &lt;/span&gt;enc&lt;span class="w"&gt; &lt;/span&gt;-base64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which is based on the &lt;a href="https://www.w3.org/TR/CSP2/#script-src-hash-usage"&gt;example&lt;/a&gt; from the W3C recommendation about CSPs.&lt;/p&gt;</content><category term="Posts"></category><category term="Content security policy"></category><category term="SHA256"></category><category term="OpenSSL"></category><category term="Piwik"></category><category term="HTTP"></category></entry><entry><title>Occam's razor</title><link href="https://xo.tc/occams-razor.html" rel="alternate"></link><published>2017-03-30T07:00:00+08:00</published><updated>2017-03-30T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-03-30:/occams-razor.html</id><summary type="html">&lt;p&gt;I mentioned Occam's razor in a &lt;a href="https://xo.tc/attribution-is-about-more-than-just-technical-evidence.html"&gt;previous post&lt;/a&gt; and it's a philosophy I'm a huge fan of. Especially in information secuirty. &lt;/p&gt;
&lt;p&gt;Often it's summed up as &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"the simplest explanation is usually the correct one"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think it's easy to get carried away with theories that &lt;em&gt;could&lt;/em&gt; be posible rather than …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I mentioned Occam's razor in a &lt;a href="https://xo.tc/attribution-is-about-more-than-just-technical-evidence.html"&gt;previous post&lt;/a&gt; and it's a philosophy I'm a huge fan of. Especially in information secuirty. &lt;/p&gt;
&lt;p&gt;Often it's summed up as &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"the simplest explanation is usually the correct one"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think it's easy to get carried away with theories that &lt;em&gt;could&lt;/em&gt; be posible rather than focus on the theories that are the most likely.&lt;/p&gt;</content><category term="Posts"></category><category term="Philosophy"></category></entry><entry><title>The HP Automated Storage Manager Server service terminated unexpectedly.</title><link href="https://xo.tc/the-hp-automated-storage-manager-server-service-terminated-unexpectedly.html" rel="alternate"></link><published>2017-03-23T07:00:00+08:00</published><updated>2017-03-23T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-03-23:/the-hp-automated-storage-manager-server-service-terminated-unexpectedly.html</id><summary type="html">&lt;p&gt;About a week ago we had an issue with a HP X1600 G2 Network Storage System Server. After rebooting we got an error message in the event log roughly ever minute with Event ID 7031&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;The HP Automated Storage Manager Server service terminated unexpectedly. It has done this 1 time …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;About a week ago we had an issue with a HP X1600 G2 Network Storage System Server. After rebooting we got an error message in the event log roughly ever minute with Event ID 7031&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;The HP Automated Storage Manager Server service terminated unexpectedly. It has done this 1 time(s).  The following corrective action will be taken in 0 milliseconds: Restart the service.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;followed by an informational log with Event ID 7036&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;The HP Automated Storage Manager Server service entered the running state.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and it kept looping through those two messages.&lt;/p&gt;
&lt;p&gt;After some digging around we worked out that it was a USB hard drive causing the error. The hard drive had been plugged in for almost a month but it seems the version of HP Automated Storage Manager we were running couldn't start if there was a USB hard drive attached. Attaching the drive after the service has started doesn't cause issues which is why the error didn't crop up until after we rebooted the server.&lt;/p&gt;
&lt;p&gt;Hopefully that helps someone else who is scratching their head trying to work out this issue.&lt;/p&gt;</content><category term="Posts"></category><category term="Errors"></category><category term="HPE"></category><category term="Troubleshooting"></category></entry><entry><title>Attribution is about more than just technical evidence</title><link href="https://xo.tc/attribution-is-about-more-than-just-technical-evidence.html" rel="alternate"></link><published>2017-03-16T07:00:00+08:00</published><updated>2017-03-16T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-03-16:/attribution-is-about-more-than-just-technical-evidence.html</id><summary type="html">&lt;p&gt;There is a story that's been doing the rounds lately about malware that took control of microphones and &lt;a href="https://arstechnica.com/security/2017/02/hackers-who-took-control-of-pc-microphones-siphon-600-gb-from-70-targets/"&gt;uploaded over 600 GB of audio&lt;/a&gt; to its command and control. As others in the security industry have pointed out this is a great example of where we can make fairly confident …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a story that's been doing the rounds lately about malware that took control of microphones and &lt;a href="https://arstechnica.com/security/2017/02/hackers-who-took-control-of-pc-microphones-siphon-600-gb-from-70-targets/"&gt;uploaded over 600 GB of audio&lt;/a&gt; to its command and control. As others in the security industry have pointed out this is a great example of where we can make fairly confident guesses about the origin of the malware without even looking at the "Technical" evidence; Things like network logs, packet captures, infection vectors and reverse engineering the binaries to look for clues to trace the attacks back.&lt;/p&gt;
&lt;p&gt;Instead, we can look at a more political angle. As a quick off the back of the envelope calculation if we had 600GB MP3 files at 128kbps&lt;sup id="fnref:mp3-files"&gt;&lt;a class="footnote-ref" href="#fn:mp3-files"&gt;1&lt;/a&gt;&lt;/sup&gt; it would be &lt;a href="https://www.wolframalpha.com/input/?i=600GB+at+128kbps"&gt;more than 10,000 hours or over a year of audio&lt;/a&gt;. We can also see the computers infected were in the Ukraine, so we can say "Who would have the capacity and desire to listen to over 10,000 hours of Ukrainian conversations?"&lt;sup id="fnref:bluff"&gt;&lt;a class="footnote-ref" href="#fn:bluff"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Sure it might not prove attribution that would stand up in a court of law to "Beyond a reasonable doubt" but it points very strongly in one direction.&lt;/p&gt;
&lt;p&gt;I was once involved in a situation where a document had been leaked. Several people had access to that document and any of them could have leaked it, but we looked at when the document was leaked, who it was leaked to and who stood to gain from the leak. In the end, we had a pretty good idea about who had leaked the document, maybe not "beyond a reasonable doubt" level of confidence but enough that we were satisfied.&lt;/p&gt;
&lt;p&gt;I think in a heavily technical field where some things can be boolean it's easy to overlook the more social and political aspects where things are not so definite.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:mp3-files"&gt;
&lt;p&gt;I have no idea what codec or compression levels were being used, but 128kbps is a fairly average rate.&amp;#160;&lt;a class="footnote-backref" href="#fnref:mp3-files" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:bluff"&gt;
&lt;p&gt;While that's possible that siphoning off the audio could be misdirection. I think &lt;a href="https://en.wikipedia.org/wiki/Occam%27s_razor"&gt;Occam's razor&lt;/a&gt; applies here and "the simplest explanation is usually the correct one".&amp;#160;&lt;a class="footnote-backref" href="#fnref:bluff" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Attribution"></category><category term="Layer 8"></category><category term="Malware"></category></entry><entry><title>One hundred prisoners and a light bulb simulation</title><link href="https://xo.tc/one-hundred-prisoners-and-a-light-bulb-simulation.html" rel="alternate"></link><published>2017-03-09T07:00:00+08:00</published><updated>2017-03-09T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-03-09:/one-hundred-prisoners-and-a-light-bulb-simulation.html</id><summary type="html">&lt;p&gt;This is a little off my usual topic of IT Security but it's something I've been thinking about a bit lately. I recently came across the "One hundred prisoners and a light bulb" riddle. It was &lt;a href="http://www.ias.uwa.edu.au/lectures/van-ditmarsch"&gt;posed as&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A group of 100 prisoners, all together in the prison dining area …&lt;/p&gt;&lt;/blockquote&gt;</summary><content type="html">&lt;p&gt;This is a little off my usual topic of IT Security but it's something I've been thinking about a bit lately. I recently came across the "One hundred prisoners and a light bulb" riddle. It was &lt;a href="http://www.ias.uwa.edu.au/lectures/van-ditmarsch"&gt;posed as&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A group of 100 prisoners, all together in the prison dining area, are told that they will be all put in isolation cells and then will be interrogated one by one in a room containing a light with an on/off switch. The prisoners may communicate with one another by toggling the light-switch (and that is the only way in which they can communicate). The light is initially switched off. There is no fixed order of interrogation, or interval between interrogations, and the same prisoner will be interrogated again at any stage. When interrogated, a prisoner can either do nothing, or toggle the light-switch, or announce that all prisoners have been interrogated. If that announcement is true, the prisoners will (all) be set free, but if it is false, they will all be executed. While still in the dining room, and before the prisoners go to their isolation cells (forever), can the prisoners agree on a protocol that will set them free?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think there are several version that all run along the same lines but with slightly tweaked wording.&lt;/p&gt;
&lt;p&gt;The general solution to the puzzle is that;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All the prisoners decied to elect one prisoner as the leader.&lt;/li&gt;
&lt;li&gt;When a prisoner is interrogated if the light is off and they have not switched it on before they will switch the light on. Otherwise they will leave the light unchanged.&lt;/li&gt;
&lt;li&gt;Only the leader can switch the light off. After the leaer has switched the light off 99 times they know all other prisoners must have been interrogated.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This works and from a logic point of view is fairly elegant. However it seemed inefficient to me. I wanted to know how many interrogations before the prisoners are set free.  I feel sure there is some mathematical way you could calculate the average but that's beyond me so I &lt;strike&gt;kidnaped 100 people and locked them in my basement&lt;/strike&gt; wrote a Python script to simulate the problem.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/usr/bin/python3&lt;/span&gt;
&lt;span class="c1"&gt;# -*- coding: UTF-8 -*-&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;A group of 100 prisoners, all together in the prison dining area, are told that&lt;/span&gt;
&lt;span class="sd"&gt;they will be all put in isolation cells and then will be interrogated one by&lt;/span&gt;
&lt;span class="sd"&gt;one in a room containing a light with an on/off switch. The prisoners may&lt;/span&gt;
&lt;span class="sd"&gt;communicate with one another by toggling the light-switch (and that is the&lt;/span&gt;
&lt;span class="sd"&gt;only way in which they can communicate). The light is initially switched off.&lt;/span&gt;

&lt;span class="sd"&gt;There is no fixed order of interrogation, or interval between interrogations,&lt;/span&gt;
&lt;span class="sd"&gt;and the same prisoner will be interrogated again at any stage. When&lt;/span&gt;
&lt;span class="sd"&gt;interrogated, a prisoner can either do nothing, or toggle the light-switch,&lt;/span&gt;
&lt;span class="sd"&gt;or announce that all prisoners have been interrogated. If that announcement is&lt;/span&gt;
&lt;span class="sd"&gt;true, the prisoners will (all) be set free, but if it is false, they will all&lt;/span&gt;
&lt;span class="sd"&gt;be executed.&lt;/span&gt;

&lt;span class="sd"&gt;While still in the dining room, and before the prisoners go to their isolation&lt;/span&gt;
&lt;span class="sd"&gt;cells (forever), can the prisoners agree on a protocol that will set them free?&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;random&lt;/span&gt;

&lt;span class="n"&gt;light_bulb_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Prisoner&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;The basic class there should be 100 of these&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;Sets up the initial variables&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_switched_on_light_bulb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;interigation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;        When the prisoner goes into the room, if the light is on they leave it&lt;/span&gt;
&lt;span class="sd"&gt;        otherwise if it&amp;#39;s off and they have not yet switched it on they turn&lt;/span&gt;
&lt;span class="sd"&gt;        the light bulb on&lt;/span&gt;
&lt;span class="sd"&gt;        &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
        &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;light_bulb_on&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_switched_on_light_bulb&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;light_bulb_on&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;light_bulb_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_switched_on_light_bulb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Leader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Prisoner&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Only the leader can switch the light bulb off. After they have swtiched the&lt;/span&gt;
&lt;span class="sd"&gt;    light bulb off 99 times, they know all prisoners have been interrogated.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;Sets up the initial variables&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
        &lt;span class="n"&gt;Prisoner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;switch_off_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;interigation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;        When the leader gets in interrogated they can switch the light off&lt;/span&gt;
&lt;span class="sd"&gt;        &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
        &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;light_bulb_on&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;light_bulb_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;light_bulb_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;switch_off_count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;switch_off_count&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;All prisoners have been interrogated&amp;quot;&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_simulation&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Runs a simulation of the onehundred prisoners and a light bulb problem and&lt;/span&gt;
&lt;span class="sd"&gt;    returns the number of interigations before the prisoners are released.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="c1"&gt;# Add one leader and 99 prisoners&lt;/span&gt;
    &lt;span class="n"&gt;number_of_interigations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;responce&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;

    &lt;span class="n"&gt;prisoners&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Leader&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;prisoners&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Prisoner&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;responce&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;All prisoners have been interrogated&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;responce&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prisoners&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interigation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;number_of_interigations&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;number_of_interigations&lt;/span&gt;


&lt;span class="c1"&gt;# Run the simulation 1000 times and print out the average number of&lt;/span&gt;
&lt;span class="c1"&gt;# interigations before the prisoners are released.&lt;/span&gt;
&lt;span class="n"&gt;average&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;average&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;run_simulation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;average&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Making that script object oriented is compleate overkill but it was fun to write. I've made some assumptions here, mainly that the prisoners are interrogated in a random order and continuously until one of them says "All prisoners have been interrogated".&lt;/p&gt;
&lt;p&gt;It usually takes around 10400 interigations before the prisoners are set free. I then started thinking about other issues like what if the interigations are not random. My sister sent me a link to a &lt;a href="http://homepages.cwi.nl/~jve/papers/10/pdfs/JANCLlightbulb.pdf"&gt;journal article&lt;/a&gt; that looks into all these posibilities. It's a fun little distraction for those who like logic puzzles.&lt;/p&gt;</content><category term="Posts"></category><category term="Off topic"></category><category term="Python"></category><category term="Problem Solving"></category><category term="Logic puzzle"></category></entry><entry><title>Using the new(ish) Nextcloud updater</title><link href="https://xo.tc/using-the-newish-nextcloud-updater.html" rel="alternate"></link><published>2017-03-02T07:00:00+08:00</published><updated>2017-03-02T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-03-02:/using-the-newish-nextcloud-updater.html</id><summary type="html">&lt;p&gt;I first started playing with ownCloud back in early 2012 with version 3, and started using it seriously in mid 2014 as my main tool for syncing my Calendar, Contacts and files having migrated away from Google's Calendar/Contacts/Drive.&lt;/p&gt;
&lt;p&gt;But one of my biggest complaints was the update mechanism …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I first started playing with ownCloud back in early 2012 with version 3, and started using it seriously in mid 2014 as my main tool for syncing my Calendar, Contacts and files having migrated away from Google's Calendar/Contacts/Drive.&lt;/p&gt;
&lt;p&gt;But one of my biggest complaints was the update mechanism, or rather the lack of one. On September 29th 2016 I published a copy of &lt;a href="https://xo.tc/using-the-newish-nextcloud-updater.html"&gt;my ownCloud update script&lt;/a&gt; nothing amazing but it did the job. In that post I said that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I've been looking at &lt;a href="https://nextcloud.com/"&gt;NextCloud&lt;/a&gt;, I haven't made the switch yet but if they introduce an automatic update mechanism that would be a big enough draw card for me to change.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I didn't realise it at the time but also on the 29th of September 2016 Nextcloud  &lt;a href="https://nextcloud.com/blog/new-nextcloud-maintenance-releases-out-with-improved-updater-and-over-40-fixes/"&gt;annoucned&lt;/a&gt; a new updater mechanism. Not fully automatic like wordpress security updates, but a good step in the right directon.&lt;/p&gt;
&lt;p&gt;Early in 2017 I decided to take the plunge and migrate across to Nextcloud and I've just done my first in browser upgrade, from 11.0.1 to 11.0.2.&lt;/p&gt;
&lt;p&gt;It started with a notificaton in the browser and also on the desktop client.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Update notification" src="https://xo.tc/images/next-cloud-updater-1-notification.png"&gt;&lt;/p&gt;
&lt;p&gt;I went into the admin panel&lt;/p&gt;
&lt;p&gt;&lt;img alt="Admin panel" src="https://xo.tc/images/next-cloud-updater-2-admin.png"&gt;&lt;/p&gt;
&lt;p&gt;Under the version section I clicked Open updater&lt;/p&gt;
&lt;p&gt;&lt;img alt="Open updater" src="https://xo.tc/images/next-cloud-updater-3-open-updater.png"&gt;&lt;/p&gt;
&lt;p&gt;Then simply hit Start update&lt;/p&gt;
&lt;p&gt;&lt;img alt="Start update" src="https://xo.tc/images/next-cloud-updater-4-start-update.png"&gt;&lt;/p&gt;
&lt;p&gt;It ran through all of the steps in a couple of minutes then I picked "No" to exit maintenance mode.&lt;/p&gt;
&lt;p&gt;&lt;img alt="exit maintenance mode" src="https://xo.tc/images/next-cloud-updater-5-exit-maintenance-mode.png"&gt;&lt;/p&gt;
&lt;p&gt;Then I returned back to the home page to finish the database upgrade&lt;/p&gt;
&lt;p&gt;&lt;img alt="return to home page" src="https://xo.tc/images/next-cloud-updater-6-return-to-home-page.png"&gt;&lt;/p&gt;
&lt;p&gt;From there, the update was the same as before; click on "Start update" to start upgrading the database&lt;/p&gt;
&lt;p&gt;&lt;img alt="start database upgrade" src="https://xo.tc/images/next-cloud-updater-7-database-upgrade.png"&gt;&lt;/p&gt;
&lt;p&gt;After the upgrade continue on to Nextcloud and re-enable any 3rd party apps that have been disabled.&lt;/p&gt;
&lt;p&gt;&lt;img alt="finish Nexcloud update" src="https://xo.tc/images/next-cloud-updater-8-database-upgrade-finished.png"&gt;&lt;/p&gt;
&lt;p&gt;The overall process was very easy and felt much more user friendly than SSHing in and running my bash script.&lt;/p&gt;</content><category term="Posts"></category><category term="ownCloud"></category><category term="Nextcloud"></category><category term="updates"></category><category term="patching"></category><category term="Good bye Google"></category></entry><entry><title>Using ssh config to save settings and make your life easier</title><link href="https://xo.tc/using-ssh-config-to-save-settings-and-make-your-life-easier.html" rel="alternate"></link><published>2017-02-23T07:00:00+08:00</published><updated>2017-02-23T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-02-23:/using-ssh-config-to-save-settings-and-make-your-life-easier.html</id><summary type="html">&lt;p&gt;SSH is an amazing tool, I use it all the time and not just for logging into remote computers, but also to create tunnels, copy files and access git repositories.&lt;/p&gt;
&lt;p&gt;But I don't want to have to remember fidily commands something like &lt;code&gt;ssh I2P_Router&lt;/code&gt; is so much nicer than something …&lt;/p&gt;</summary><content type="html">&lt;p&gt;SSH is an amazing tool, I use it all the time and not just for logging into remote computers, but also to create tunnels, copy files and access git repositories.&lt;/p&gt;
&lt;p&gt;But I don't want to have to remember fidily commands something like &lt;code&gt;ssh I2P_Router&lt;/code&gt; is so much nicer than something like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;ssh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ssh&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Michael&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Van&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Delft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id_rsa&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7657&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;&lt;span class="nl"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;7657&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4444&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;&lt;span class="nl"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4444&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6668&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;&lt;span class="nl"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;6668&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i2p_user&lt;/span&gt;&lt;span class="nv"&gt;@example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nl"&gt;com&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2233&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I keep my &lt;code&gt;~/.ssh&lt;/code&gt; folder synced as a git repository, that I sync over https with &lt;a href="https://xo.tc/setting-up-gogs-on-debian-jessie-with-apache2-and-postgresql.html"&gt;gogs&lt;/a&gt;. For all other git repositories I use ssh, but https solves the bootstap problem where I setup a new computer and want to download my ssh settings.&lt;/p&gt;
&lt;p&gt;Below is an example of my &lt;code&gt;~/.ssh/config&lt;/code&gt; file with just a few changes.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Override /etc/ssh_config&lt;/span&gt;
&lt;span class="c1"&gt;# This is a potential issue where someone who can read your ~/.ssh/known_hosts&lt;/span&gt;
&lt;span class="c1"&gt;# can see what servers you have SSHed into. However I&amp;#39;m not concerned by that.&lt;/span&gt;
&lt;span class="c1"&gt;# It makes it much easier to just delete one line from known_hosts when a&lt;/span&gt;
&lt;span class="c1"&gt;# server changes key.&lt;/span&gt;

HashKnownHosts&lt;span class="w"&gt; &lt;/span&gt;no

&lt;span class="c1"&gt;###############################################################################&lt;/span&gt;
&lt;span class="c1"&gt;# Servers                                                                     #&lt;/span&gt;
&lt;span class="c1"&gt;###############################################################################&lt;/span&gt;
Host&lt;span class="w"&gt; &lt;/span&gt;example.com&lt;span class="w"&gt; &lt;/span&gt;www.example.com&lt;span class="w"&gt; &lt;/span&gt;brand.example.com
&lt;span class="w"&gt;    &lt;/span&gt;IdentityFile&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/Michael-Van-Delft.id_rsa
&lt;span class="w"&gt;    &lt;/span&gt;User&lt;span class="w"&gt; &lt;/span&gt;michael

&lt;span class="c1"&gt;# Port forwarding for I2P. Simply run `ssh I2P_Router`&lt;/span&gt;
&lt;span class="c1"&gt;# then browse to http://localhost:7657/&lt;/span&gt;
Host&lt;span class="w"&gt; &lt;/span&gt;I2P_Router
&lt;span class="w"&gt;    &lt;/span&gt;HostName&lt;span class="w"&gt; &lt;/span&gt;example.net
&lt;span class="w"&gt;    &lt;/span&gt;IdentityFile&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/Michael-Van-Delft.id_rsa
&lt;span class="w"&gt;    &lt;/span&gt;User&lt;span class="w"&gt; &lt;/span&gt;i2p_user
&lt;span class="w"&gt;    &lt;/span&gt;LocalForward&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;7657&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;localhost:7657
&lt;span class="w"&gt;    &lt;/span&gt;LocalForward&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;4444&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;localhost:4444
&lt;span class="w"&gt;    &lt;/span&gt;LocalForward&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;6668&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;localhost:6668

&lt;span class="c1"&gt;# Example of a local server with IPv6 only&lt;/span&gt;
Host&lt;span class="w"&gt; &lt;/span&gt;zilean
&lt;span class="w"&gt;    &lt;/span&gt;IdentityFile&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/pi@zilean.example.com.id_rsa
&lt;span class="w"&gt;    &lt;/span&gt;User&lt;span class="w"&gt; &lt;/span&gt;pi
&lt;span class="w"&gt;    &lt;/span&gt;AddressFamily&lt;span class="w"&gt; &lt;/span&gt;inet6
&lt;span class="w"&gt;    &lt;/span&gt;HostName&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2001&lt;/span&gt;:0db8:6101:cc01::7

&lt;span class="c1"&gt;###############################################################################&lt;/span&gt;
&lt;span class="c1"&gt;# Git and Service accounts                                                    #&lt;/span&gt;
&lt;span class="c1"&gt;###############################################################################&lt;/span&gt;
Host&lt;span class="w"&gt; &lt;/span&gt;github.com
&lt;span class="w"&gt;    &lt;/span&gt;HostName&lt;span class="w"&gt; &lt;/span&gt;github.com
&lt;span class="w"&gt;    &lt;/span&gt;IdentityFile&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/git@github.com.id_rsa
&lt;span class="w"&gt;    &lt;/span&gt;User&lt;span class="w"&gt; &lt;/span&gt;git
&lt;span class="w"&gt;    &lt;/span&gt;IdentitiesOnly&lt;span class="w"&gt; &lt;/span&gt;yes

&lt;span class="c1"&gt;# This is good if you have a server you ssh into (like example.com from the top&lt;/span&gt;
&lt;span class="c1"&gt;# entry) where you want to use diffrent credentials for git as you do when you&lt;/span&gt;
&lt;span class="c1"&gt;# SSH in normaly.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# To clone a repository simply run&lt;/span&gt;
&lt;span class="c1"&gt;# git clone gogs:Michael/exotic-security.git&lt;/span&gt;
Host&lt;span class="w"&gt; &lt;/span&gt;gogs
&lt;span class="w"&gt;     &lt;/span&gt;HostName&lt;span class="w"&gt; &lt;/span&gt;example.com
&lt;span class="w"&gt;     &lt;/span&gt;IdentityFile&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/gogs.id_ed25519
&lt;span class="w"&gt;     &lt;/span&gt;User&lt;span class="w"&gt; &lt;/span&gt;git
&lt;span class="w"&gt;     &lt;/span&gt;IdentitiesOnly&lt;span class="w"&gt; &lt;/span&gt;yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="Posts"></category><category term="Git"></category><category term="SSH"></category><category term="I2P"></category><category term="Gogs"></category><category term="IPv6"></category><category term="Linux"></category></entry><entry><title>Simple postgres basics</title><link href="https://xo.tc/simple-postgres-basics.html" rel="alternate"></link><published>2017-02-16T07:00:00+08:00</published><updated>2017-02-16T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-02-16:/simple-postgres-basics.html</id><summary type="html">&lt;p&gt;This is another one of &lt;a href="https://xo.tc/tag/note-to-self.html"&gt;those things&lt;/a&gt; I've done all this several times before, but need to keep looking up the documentation.&lt;/p&gt;
&lt;p&gt;To login to PostgreSQL after a fresh installation&lt;sup id="fnref:installation"&gt;&lt;a class="footnote-ref" href="#fn:installation"&gt;1&lt;/a&gt;&lt;/sup&gt; you need to change to the postgres user and run psql (no password needed, it uses &lt;a href="https://www.postgresql.org/docs/9.1/static/auth-methods.html#AUTH-PEER"&gt;Peer Authentication&lt;/a&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;This is another one of &lt;a href="https://xo.tc/tag/note-to-self.html"&gt;those things&lt;/a&gt; I've done all this several times before, but need to keep looking up the documentation.&lt;/p&gt;
&lt;p&gt;To login to PostgreSQL after a fresh installation&lt;sup id="fnref:installation"&gt;&lt;a class="footnote-ref" href="#fn:installation"&gt;1&lt;/a&gt;&lt;/sup&gt; you need to change to the postgres user and run psql (no password needed, it uses &lt;a href="https://www.postgresql.org/docs/9.1/static/auth-methods.html#AUTH-PEER"&gt;Peer Authentication&lt;/a&gt;)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo -u postgres psql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;from there you can create a user and access it as you normally would.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;createuser -P -s -e michael
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to connect to a database use&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;\c database_name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to list the tables run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;\dt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and to make the output format expanded so it fits on a small screen simply switch&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;\x on
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:installation"&gt;
&lt;p&gt;In my case that's usually on Debian or Ubuntu but it should be the same on most Linux distros.&amp;#160;&lt;a class="footnote-backref" href="#fnref:installation" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Note to self"></category><category term="PostgreSQL"></category><category term="Debian"></category></entry><entry><title>My IP Tables script example</title><link href="https://xo.tc/my-ip-tables-script-example.html" rel="alternate"></link><published>2017-02-09T07:00:00+08:00</published><updated>2017-02-09T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-02-09:/my-ip-tables-script-example.html</id><summary type="html">&lt;p&gt;Below is an example of the IP Tables script I use on many of my servers. The names and IP addresses have been changed to &lt;a href="https://en.wikipedia.org/wiki/Reserved_IP_addresses"&gt;reserved addresses&lt;/a&gt; and obviously it needs to be tweaked each time for relevent rules. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="c1"&gt;# This script is symlinked to /etc/network/if-pre-up.d …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Below is an example of the IP Tables script I use on many of my servers. The names and IP addresses have been changed to &lt;a href="https://en.wikipedia.org/wiki/Reserved_IP_addresses"&gt;reserved addresses&lt;/a&gt; and obviously it needs to be tweaked each time for relevent rules. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="c1"&gt;# This script is symlinked to /etc/network/if-pre-up.d/firewall-rules&lt;/span&gt;
&lt;span class="c1"&gt;# ln -s /home/michael/firewall-rules.sh /etc/network/if-pre-up.d/firewall-rules&lt;/span&gt;

&lt;span class="c1"&gt;################################################################################&lt;/span&gt;
&lt;span class="c1"&gt;# IPv4 Rules&lt;/span&gt;
&lt;span class="c1"&gt;################################################################################&lt;/span&gt;

&lt;span class="c1"&gt;# Networks&lt;/span&gt;
&lt;span class="nv"&gt;MichaelHome&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;198.51.100.122/32&amp;quot;&lt;/span&gt;
&lt;span class="nv"&gt;MichaelHomeV6&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;2001:db8:62F8:cc01::0/64&amp;quot;&lt;/span&gt;
&lt;span class="nv"&gt;TienHome&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;203.0.113.94/32&amp;quot;&lt;/span&gt;
&lt;span class="nv"&gt;WorkNetwork&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;192.0.2.0/24&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;GeneralRules&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;#start and flush&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-F
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;nat&lt;span class="w"&gt; &lt;/span&gt;-F
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-X
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-P&lt;span class="w"&gt; &lt;/span&gt;FORWARD&lt;span class="w"&gt; &lt;/span&gt;DROP
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-P&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt;   &lt;/span&gt;DROP
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-P&lt;span class="w"&gt; &lt;/span&gt;OUTPUT&lt;span class="w"&gt;  &lt;/span&gt;ACCEPT

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;#Ping, Trace Route, etc...&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;icmp&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;#Mail - SMTP, SMTPS, IMAP and IMAPS&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;25&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#SMTP&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;465&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#SMTPS&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;587&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#SMTP Submission&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;143&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#IMAP&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;993&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#IMAPS&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;4190&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# dovecot-sieve set mail filter settings.&lt;/span&gt;

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;#HTTP[S] traffic&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;80&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;443&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# i2p&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;21546&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;udp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;21546&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# zeronet&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;15441&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;#Allow Establishted Sessions&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;state&lt;span class="w"&gt; &lt;/span&gt;--state&lt;span class="w"&gt; &lt;/span&gt;ESTABLISHED,RELATED&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;#loopback&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt;  &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;lo&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;OUTPUT&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;lo&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;IPv4Rules&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# SSH and Mosh&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MichaelHome&lt;/span&gt;,&lt;span class="nv"&gt;$TienHome&lt;/span&gt;,&lt;span class="nv"&gt;$WorkNetwork&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;22&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;udp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MichaelHome&lt;/span&gt;,&lt;span class="nv"&gt;$TienHome&lt;/span&gt;,&lt;span class="nv"&gt;$WorkNetwork&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;60000&lt;/span&gt;:60010&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;IPv6Rules&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# SSH and Mosh&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;tcp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MichaelHomeV6&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;22&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;udp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MichaelHomeV6&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;60000&lt;/span&gt;:60010&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;#Run general rules for both IPv4 and IPv6&lt;/span&gt;
&lt;span class="nv"&gt;IPTABLES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/sbin/iptables
GeneralRules
IPv4Rules

&lt;span class="nv"&gt;IPTABLES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/sbin/ip6tables
GeneralRules
IPv6Rules

&lt;span class="c1"&gt;#DHCP&lt;/span&gt;
&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;udp&lt;span class="w"&gt; &lt;/span&gt;--dport&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;546&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;span class="nv"&gt;$IPTABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;INPUT&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;icmpv6&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;ACCEPT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="Posts"></category><category term="Firewalls"></category><category term="IPv6"></category><category term="Debian"></category><category term="IP Tables"></category></entry><entry><title>pip changing from pep8 to pycodestyle</title><link href="https://xo.tc/pip-changing-from-pep8-to-pycodestyle.html" rel="alternate"></link><published>2017-02-02T07:00:00+08:00</published><updated>2017-02-02T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-02-02:/pip-changing-from-pep8-to-pycodestyle.html</id><summary type="html">&lt;p&gt;I recently updated one of the packages in &lt;a href="https://atom.io/"&gt;Atom&lt;/a&gt; that was called &lt;code&gt;linter-pep8&lt;/code&gt; to version 2.0 which was renamed to &lt;a href="https://atom.io/packages/linter-pycodestyle"&gt;&lt;code&gt;linter-pycodestyle&lt;/code&gt;&lt;/a&gt;. This is because &lt;a href="https://pypi.python.org/pypi/pep8"&gt;PEP8 the package&lt;/a&gt; was renamed to &lt;a href="https://pypi.python.org/pypi/pycodestyle"&gt;pycodestyle&lt;/a&gt; to reduse confusion between the package and the &lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP8 the specification&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However after I opened Atom I got …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently updated one of the packages in &lt;a href="https://atom.io/"&gt;Atom&lt;/a&gt; that was called &lt;code&gt;linter-pep8&lt;/code&gt; to version 2.0 which was renamed to &lt;a href="https://atom.io/packages/linter-pycodestyle"&gt;&lt;code&gt;linter-pycodestyle&lt;/code&gt;&lt;/a&gt;. This is because &lt;a href="https://pypi.python.org/pypi/pep8"&gt;PEP8 the package&lt;/a&gt; was renamed to &lt;a href="https://pypi.python.org/pypi/pycodestyle"&gt;pycodestyle&lt;/a&gt; to reduse confusion between the package and the &lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP8 the specification&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However after I opened Atom I got an error message &lt;code&gt;Error: spawn pycodestyle ENOENT&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Error: spawn pycodestyle ENOENT" src="https://xo.tc/images/error-spawning-pycodestyle-enoent.png"&gt;&lt;/p&gt;
&lt;p&gt;because I hadn't upgraded the python package. As I wasn't using PEP8 for anything else I uninstalled it and installed pycodestyle. On windows I'd installed Python 3.6 x64 for all users so it was Python was installed &lt;code&gt;C:\Program Files\Python36\&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;quot;C:\Program Files\Python36\Scripts\pip.exe&amp;quot; uninstall pep8
&amp;quot;C:\Program Files\Python36\Scripts\pip.exe&amp;quot; install pycodestyle
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;on Linux&lt;sup id="fnref:linux"&gt;&lt;a class="footnote-ref" href="#fn:linux"&gt;1&lt;/a&gt;&lt;/sup&gt; pip was in my &lt;code&gt;PATH&lt;/code&gt; environment varable so I simply ran&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo pip uninstall pep8
sudo pip install pycodestyle
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And that fixed up my issues.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:linux"&gt;
&lt;p&gt;In my case that was Arch Linux and Debian Jessie.&amp;#160;&lt;a class="footnote-backref" href="#fnref:linux" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Python"></category><category term="Windows"></category><category term="Linux"></category><category term="Atom"></category><category term="Updates"></category></entry><entry><title>Failing Loudly</title><link href="https://xo.tc/failing-loudly.html" rel="alternate"></link><published>2017-01-26T07:00:00+08:00</published><updated>2017-01-26T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-01-26:/failing-loudly.html</id><summary type="html">&lt;p&gt;There is a concept in IT called 'failing loudly' as opposed to 'failing silently'. The idea is when something goes wrong it should be obvious and generally everything should come to a halt instead of trying to carry on with errors.&lt;/p&gt;
&lt;p&gt;An example of this is running a REST API …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a concept in IT called 'failing loudly' as opposed to 'failing silently'. The idea is when something goes wrong it should be obvious and generally everything should come to a halt instead of trying to carry on with errors.&lt;/p&gt;
&lt;p&gt;An example of this is running a REST API and only opening port 443, but leaving port 80 is closed. Connections are either secure or don't work at all.&lt;/p&gt;
&lt;p&gt;There was a change with systemd where if the &lt;code&gt;/etc/fstab&lt;/code&gt; files had errors in it, the system would hang at boot forever until some sort of user input fixed the issues. The previous behaviour was to simply show an error while booting but continue on regardless. The systemd argument was that it's better not to boot at all than to boot into a broken state, such as with a hard drive missing and potentially lose data.&lt;/p&gt;
&lt;p&gt;As with every design approach it has it's place, it's not always the appropriate way to do things. It comes down to what you want to prioritizes. But I think it's very appropriate for things which need good security.&lt;/p&gt;</content><category term="Posts"></category><category term="Philosophy"></category><category term="systemd"></category><category term="REST"></category></entry><entry><title>Expiry dates on smart phones and other IoT devices</title><link href="https://xo.tc/expiry-dates-on-smart-phones-and-other-iot-devices.html" rel="alternate"></link><published>2017-01-19T07:00:00+08:00</published><updated>2017-01-19T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-01-19:/expiry-dates-on-smart-phones-and-other-iot-devices.html</id><summary type="html">&lt;p&gt;A while ago someone&lt;sup id="fnref:someone"&gt;&lt;a class="footnote-ref" href="#fn:someone"&gt;1&lt;/a&gt;&lt;/sup&gt; suggested the idea of putting an expiry date on smart phones. The idea was that when manufacturing a device the company would have to commit to pushing out fixes to any &lt;a href="https://cve.mitre.org/"&gt;CVEs&lt;/a&gt; that come up until the given date. So when buying a phone there …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A while ago someone&lt;sup id="fnref:someone"&gt;&lt;a class="footnote-ref" href="#fn:someone"&gt;1&lt;/a&gt;&lt;/sup&gt; suggested the idea of putting an expiry date on smart phones. The idea was that when manufacturing a device the company would have to commit to pushing out fixes to any &lt;a href="https://cve.mitre.org/"&gt;CVEs&lt;/a&gt; that come up until the given date. So when buying a phone there would be an expiry date printed on the packageing and consumer could be sure of reciving a supported product until that time.&lt;/p&gt;
&lt;p&gt;After the &lt;a href="https://en.wikipedia.org/wiki/Mirai_%28malware%29"&gt;Mirai botnet&lt;/a&gt; struck there was a lot of discussion around what to do about the Internet of Things (IoT) threat. Bruce Schneier &lt;a href="https://www.schneier.com/blog/archives/2016/10/security_econom_1.html"&gt;wrote&lt;/a&gt; that it was&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a market failure that can't get fixed on its own.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and that it needed some sort of government intervention to fix. I tend to agree with his analysis, there is little to no incentive for vendors to fix the bugs in some internet connected smart toaster. Most consumers don't care if their $20 toaster has been hacked and used to DDoS some website, so long as it sill makes toast. And most vendors of IoT stuff don't have long product cycles and certanly don't budget the time and resources to fix things two years after they have been sold.&lt;/p&gt;
&lt;p&gt;The aproach I'd take&lt;sup id="fnref:my-aproach"&gt;&lt;a class="footnote-ref" href="#fn:my-aproach"&gt;2&lt;/a&gt;&lt;/sup&gt; to fixing the IoT threat would be to introduce manditory expiry dates for internet connected things. This wouldn't mean consumers couldn't continue to use them after the expiry date, just that the manufacturers must fix issues with products that have not expired and vendors can't sell expired items. It could be on some sort of sliding scale so things like internet connected washing machines might be 5 years while phones might only be 2 years. A bit like a manufacturer's warranty.&lt;/p&gt;
&lt;p&gt;I'd introduce some sort of certification, a minimum security standard that devices need to conform to. This would be pretty simple check box security but it would be good base line. Things like the device must have some sort of automatic update process so that when things do go wrong, they can be fixed. And the update process should check the updates are signed.&lt;/p&gt;
&lt;p&gt;I'd also heavily push some standard environments, things like Raspberry Pi's running &lt;a href="https://www.raspberrypi.org/downloads/raspbian/"&gt;Raspbian&lt;/a&gt; and &lt;a href="https://developer.microsoft.com/en-us/windows/iot"&gt;Windows 10 for IoT&lt;/a&gt;&lt;sup id="fnref:Windows"&gt;&lt;a class="footnote-ref" href="#fn:Windows"&gt;3&lt;/a&gt;&lt;/sup&gt;. This would make certification easier because the base environment could already be certified and could make best practice easier and shooting yourself in the foot harder.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:someone"&gt;
&lt;p&gt;After a fair amount of searching I still can't find the original source but I'm pretty sure it was a comment on an LWN article about a horrible android bug (possibly libstagefright) where I first came across the idea.&amp;#160;&lt;a class="footnote-backref" href="#fnref:someone" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:my-aproach"&gt;
&lt;p&gt;Let's just pretend we live in a fantasy world here where governments could move quickly and cooperate, and import and export regulations could actually be applied to things like $13 internet connected light bulbs for sale on eBay.&amp;#160;&lt;a class="footnote-backref" href="#fnref:my-aproach" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:Windows"&gt;
&lt;p&gt;I think diversity is important and I'd like to see at least 3 or 4 base platforms. If nothing else so you don't get one bug that just ripps through all devices.&amp;#160;&lt;a class="footnote-backref" href="#fnref:Windows" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="IoT"></category><category term="Patching"></category><category term="Bruce Schneier"></category><category term="Standards"></category><category term="Technology"></category><category term="Updates"></category></entry><entry><title>Submission to the Attorney-general's Department - Access to telecommunications data in civil proceedings</title><link href="https://xo.tc/submission-to-the-attorney-generals-department-access-to-telecommunications-data-in-civil-proceedings.html" rel="alternate"></link><published>2017-01-12T00:00:00+08:00</published><updated>2017-01-12T00:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-01-12:/submission-to-the-attorney-generals-department-access-to-telecommunications-data-in-civil-proceedings.html</id><summary type="html">&lt;p&gt;On the 21st of December 2016, the Attorney-general's Department &lt;a href="https://www.ag.gov.au/Consultations/Pages/Access-to-telecommunications-data-in-civil-proceedings.aspx"&gt;requested&lt;/a&gt; submissions regarding the use of telecommunications data held by a service provider solely for the purpose of complying with the &lt;a href="https://www.ag.gov.au/dataretention"&gt;mandatory data retention regime&lt;/a&gt; in civil litigation. The original closure date for submission was the 13th of January but it's …&lt;/p&gt;</summary><content type="html">&lt;p&gt;On the 21st of December 2016, the Attorney-general's Department &lt;a href="https://www.ag.gov.au/Consultations/Pages/Access-to-telecommunications-data-in-civil-proceedings.aspx"&gt;requested&lt;/a&gt; submissions regarding the use of telecommunications data held by a service provider solely for the purpose of complying with the &lt;a href="https://www.ag.gov.au/dataretention"&gt;mandatory data retention regime&lt;/a&gt; in civil litigation. The original closure date for submission was the 13th of January but it's been moved back to Friday the 27th January.&lt;/p&gt;
&lt;p&gt;The following is an open letter I'm making as a Submission to Attorney-general's Department, I'd encourage others to use it as a template and make their own submissions. Also avalible as a &lt;a href="https://xo.tc/submission-on-metadata-usage-in-civil-litigation.odt"&gt;LibreOffice&lt;/a&gt; and a &lt;a href="https://xo.tc/submission-on-metadata-usage-in-civil-litigation.pdf"&gt;pdf&lt;/a&gt; versions.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Retained data in civil proceedings consultation&lt;br&gt;
Communications Security Branch&lt;br&gt;
Attorney-General's Department&lt;br&gt;
3-5 National Circuit&lt;br&gt;
BARTON ACT 2600  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Submission against the use of telecommunications data held by a service provider solely for the purpose of complying with the mandatory data retention regime in any civil litigation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When mandatory metadata retention laws were first announced several people and high profile organisations raised concerns about the storage and use of this incredible amount of very personal data being kept on all Australians. However the laws were ushered through under the guise of national security. It was claimed that stronger powers were needed to protect Australia from terrorism&lt;sup id="fnref:terrorism"&gt;&lt;a class="footnote-ref" href="#fn:terrorism"&gt;1&lt;/a&gt;&lt;/sup&gt; and that this huge expansion of law enforcement capabilities would be used by intelligence agencies to fight Islamic State&lt;sup id="fnref:one-more-antiterror-tool"&gt;&lt;a class="footnote-ref" href="#fn:one-more-antiterror-tool"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;The metadata facts sheet&lt;sup id="fnref:data-retention-facts"&gt;&lt;a class="footnote-ref" href="#fn:data-retention-facts"&gt;3&lt;/a&gt;&lt;/sup&gt; released by the Attorney-general's Department says that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Metadata is vital to nearly every counter-terrorism, organised crime, counter-espionage and cyber-security investigation. It is used in almost every serious criminal investigation, including murder, sexual assault, child exploitation and kidnapping.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;However from the day mandatory data retention was introduced it was feared that this information, described in an opinion piece by George Brandis titled "One more anti-terror tool" as being "vital to investigate terrorism and organised crime."&lt;sup id="fnref2:one-more-antiterror-tool"&gt;&lt;a class="footnote-ref" href="#fn:one-more-antiterror-tool"&gt;2&lt;/a&gt;&lt;/sup&gt; would instead be subject to mission creep. Many predicted that metadata kept solely for the purpose of complying with the mandatory data retention regime would go from a tool only to be used in "serious criminal investigation" to a source of information for petty crimes and civil litigation.&lt;/p&gt;
&lt;p&gt;In the Consultation Paper it is mentioned that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the course of the Committee’s inquiry into the Bill, a number of submissions expressed concerns that retained telecommunications data would be able to be accessed by parties to civil proceedings.&lt;/p&gt;
&lt;p&gt;In its Advisory Report on the Telecommunications (Interception and Access) Amendment (Data Retention) Bill 2014, the Committee recommended that the Bill ‘be amended to
prohibit civil litigants from being able to access telecommunications data that is held by a service provider solely for the purpose of complying with the mandatory data retention
regime.’&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I find it particularly worrying that the question on the Data Retention FAQs that talked about use in copyright enforcement has now been removed, previously&lt;sup id="fnref:previously"&gt;&lt;a class="footnote-ref" href="#fn:previously"&gt;4&lt;/a&gt;&lt;/sup&gt; it said:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Will data retention be used for copyright enforcement?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Telecommunications (Interception and Access) Act 1979 only allows access for limited purposes,
such as criminal law enforcement matters. Breach of copyright is generally a civil law wrong.
The Act will preclude access to telecommunications data retained solely for the purpose of
complying with the mandatory data retention scheme for the purposes of civil litigation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and I fear that a tool which was originally introduced to fight terrorism will now become a tool of large private media organisation perusing copyright violations.&lt;/p&gt;
&lt;p&gt;In regards to the question 3;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Are there particular kinds of civil proceedings or circumstances in which the prohibition in section 280(1B) of the Telecommunications Act 1997 should not apply?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I believe the answer should be a strong and firm "No, the prohibition in section 280(1B) of the Telecommunications Act 1997 should apply to all types of civil proceedings". We should be looking to strengthen our controls and protections around this data not to weaken them.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:terrorism"&gt;
&lt;p&gt;ABC the 730 Report &lt;a href="http://www.abc.net.au/7.30/content/2015/s4184359.htm"&gt;'Democracies must be on front foot' says George Brandis as Government prepares new laws&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:terrorism" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:one-more-antiterror-tool"&gt;
&lt;p&gt;The Australian &lt;a href="http://www.theaustralian.com.au/opinion/one-more-antiterror-tool/news-story/b9f48192069443268dec2dfcb04870c5"&gt;One more anti-terror tool&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:one-more-antiterror-tool" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;a class="footnote-backref" href="#fnref2:one-more-antiterror-tool" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:data-retention-facts"&gt;
&lt;p&gt;The Attorney-general's Department &lt;a href="https://www.ag.gov.au/NationalSecurity/DataRetention/Documents/KeepingourcommunitysafeFactsheet.pdf"&gt;Data retention facts&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:data-retention-facts" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:previously"&gt;
&lt;p&gt;Snapshot of the FAQs on archive.org from &lt;a href="http://web.archive.org/web/20160428205854/https://www.ag.gov.au/NationalSecurity/DataRetention/Pages/Frequentlyaskedquestions.aspx#RetentionCopyright"&gt;28/04/2016&lt;/a&gt; and the &lt;a href="https://www.ag.gov.au/NationalSecurity/DataRetention/Pages/Frequentlyaskedquestions.aspx"&gt;current version&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:previously" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="EFA"></category><category term="Australia"></category><category term="Metadata"></category></entry><entry><title>Thinking about how to defend against the PoisonTap</title><link href="https://xo.tc/thinking-about-how-to-defend-against-the-poisontap.html" rel="alternate"></link><published>2017-01-05T07:00:00+08:00</published><updated>2017-01-05T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2017-01-05:/thinking-about-how-to-defend-against-the-poisontap.html</id><summary type="html">&lt;p&gt;Recently the Samy Kamkar has come out with a device called a &lt;a href="https://samy.pl/poisontap/"&gt;PoisonTap&lt;/a&gt;, a few months before that Mubix was &lt;a href="https://room362.com/post/2016/snagging-creds-from-locked-machines/"&gt;talking about&lt;/a&gt; getting credentials from a locked computer with the &lt;a href="https://lanturtle.com/"&gt;LAN Turtle&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Both these attacks exploit the same underlying issue which is that most operating systems (Windows, Linux&lt;sup id="fnref:linux"&gt;&lt;a class="footnote-ref" href="#fn:linux"&gt;1&lt;/a&gt;&lt;/sup&gt; and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently the Samy Kamkar has come out with a device called a &lt;a href="https://samy.pl/poisontap/"&gt;PoisonTap&lt;/a&gt;, a few months before that Mubix was &lt;a href="https://room362.com/post/2016/snagging-creds-from-locked-machines/"&gt;talking about&lt;/a&gt; getting credentials from a locked computer with the &lt;a href="https://lanturtle.com/"&gt;LAN Turtle&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Both these attacks exploit the same underlying issue which is that most operating systems (Windows, Linux&lt;sup id="fnref:linux"&gt;&lt;a class="footnote-ref" href="#fn:linux"&gt;1&lt;/a&gt;&lt;/sup&gt; and OSX) will automatically trust a USB network when it's attached and start sending data over it.&lt;/p&gt;
&lt;p&gt;I've been thinking a lot about how we as the IT Security Community can defend against these sorts of attacks.&lt;/p&gt;
&lt;p&gt;The most obvious idea that springs to mind is to issue the user with some sort of popup "New network detected, do you want to connect?" but there are a few issues with that.&lt;/p&gt;
&lt;p&gt;The first is that it's a horrible user experience (UX) because 99.9% of the time the answer will be "Yes" ... "Why do you think I plugged in my usb 4g dongle if I didn't want to use it!?".&lt;/p&gt;
&lt;p&gt;The second is that sometimes you need the network to start working before you can login. A few years ago I worked at a high school we used RADIUS to secure our WiFi. Students could connect with their domain credentials. We had shared laptops in the school library but the laptops couldn't authenticate with the RADIUS server until students had logged in, but students couldn't login to the laptops without network. This will likely only get worse, with devices like &lt;a href="https://www.google.com/chromebook/about/"&gt;Chromebooks&lt;/a&gt; and Windows 10 pushing Microsoft accounts pretty hard.&lt;/p&gt;
&lt;p&gt;The defences that PoisonTap jokingly &lt;a href="https://samy.pl/poisontap/#toc_11"&gt;suggest for desktop security&lt;/a&gt; are funny but impractical such as&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Adding cement to your USB and Thunderbolt ports can be effective&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the end I don't really think there is any good client side defence for these sorts of attacks. Instead I think it needs to be at the protocol level, we need to bake security in by default. Things saying browsers vendors saying we will only support HTTP/2 &lt;a href="https://en.wikipedia.org/wiki/HTTP/2#Encryption"&gt;if it's encrypted&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We should demand encryption in any new protocol and systems susceptible to passive monitoring should be treated as a vulnerable and rejected. It might be a long an painful journey but I can imagine an internet where all communications are secure by default.&lt;/p&gt;
&lt;p&gt;I always though it was disappointing that IPv6 didn't make encryption mandatory it would have been great to have security built right in at the &lt;a href="https://en.wikipedia.org/wiki/Internet_layer"&gt;Internet  layer&lt;/a&gt;.  &lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:linux"&gt;
&lt;p&gt;There are hundreds of distributions but, when I say "Linux" I mean mainstream distributions like Debian / Ubuntu / Red Hat / Fedora with their default settings.&amp;#160;&lt;a class="footnote-backref" href="#fnref:linux" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Man in the middle"></category><category term="Encryption"></category><category term="IPv6"></category><category term="Standards"></category></entry><entry><title>Fixing no valid mx hosts found</title><link href="https://xo.tc/fixing-no-valid-mx-hosts-found.html" rel="alternate"></link><published>2016-12-29T07:00:00+08:00</published><updated>2016-12-29T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-12-29:/fixing-no-valid-mx-hosts-found.html</id><summary type="html">&lt;p&gt;I've been hosting my own email on this domain for just over a year now and I hadn't noticed any problems until a couple of days ago a German friend of mine using &lt;a href="https://www.gmx.net/"&gt;GMX&lt;/a&gt; tired to send me an email and it bounced back with the error message "no valid …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've been hosting my own email on this domain for just over a year now and I hadn't noticed any problems until a couple of days ago a German friend of mine using &lt;a href="https://www.gmx.net/"&gt;GMX&lt;/a&gt; tired to send me an email and it bounced back with the error message "no valid mx hosts found".&lt;/p&gt;
&lt;p&gt;It turns out that according to &lt;a href="https://tools.ietf.org/html/rfc2181#section-10.3"&gt;RFC 2181&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a MX resource record must not be an alias.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I had mail.xo.tc setup as my mx record&lt;/p&gt;
&lt;p&gt;&lt;img alt="DNS Made Easy MX record" src="https://xo.tc/images/no-valid-mx-mx-record.png"&gt;&lt;/p&gt;
&lt;p&gt;And then because everything is running off this one server I had mail as a CNAME.&lt;/p&gt;
&lt;p&gt;&lt;img alt="mail as a CNAME" src="https://xo.tc/images/no-valid-mx-cname.png"&gt;&lt;/p&gt;
&lt;p&gt;I deleted the CNAME and added in an A and AAAA record and that fixed the issue.&lt;/p&gt;
&lt;p&gt;&lt;img alt="New A and AAAA record" src="https://xo.tc/images/no-valid-mx-a-and-aaaa-record.png"&gt;&lt;/p&gt;
&lt;p&gt;Now I can receive emails from gmx.de and I'm RFC compliant.&lt;/p&gt;</content><category term="Posts"></category><category term="Email"></category><category term="DNS"></category><category term="Self Hosted"></category><category term="SMTP"></category><category term="Standards"></category></entry><entry><title>Upgrading from Piwik 2.17.1 to Piwik 3.0.0</title><link href="https://xo.tc/upgrading-from-piwik-2171-to-piwik-300.html" rel="alternate"></link><published>2016-12-22T07:00:00+08:00</published><updated>2016-12-22T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-12-22:/upgrading-from-piwik-2171-to-piwik-300.html</id><summary type="html">&lt;p&gt;Piwik have just &lt;a href="https://piwik.org/changelog/piwik-3-0-0/"&gt;announced&lt;/a&gt; the release of Piwik 3.0 and I was excited to try it out. I've been running Piwik on this site for just over a year. I like &lt;a href="https://piwik.org/"&gt;Piwik&lt;/a&gt; because it allows me to run analytics&lt;sup id="fnref:analytics"&gt;&lt;a class="footnote-ref" href="#fn:analytics"&gt;1&lt;/a&gt;&lt;/sup&gt; on this site while respecting users &lt;a href="http://piwik.org/privacy/"&gt;privacy&lt;/a&gt;, giving users …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Piwik have just &lt;a href="https://piwik.org/changelog/piwik-3-0-0/"&gt;announced&lt;/a&gt; the release of Piwik 3.0 and I was excited to try it out. I've been running Piwik on this site for just over a year. I like &lt;a href="https://piwik.org/"&gt;Piwik&lt;/a&gt; because it allows me to run analytics&lt;sup id="fnref:analytics"&gt;&lt;a class="footnote-ref" href="#fn:analytics"&gt;1&lt;/a&gt;&lt;/sup&gt; on this site while respecting users &lt;a href="http://piwik.org/privacy/"&gt;privacy&lt;/a&gt;, giving users the option to &lt;a href="http://donottrack.us/"&gt;opt-out&lt;/a&gt;&lt;sup id="fnref:opt-out"&gt;&lt;a class="footnote-ref" href="#fn:opt-out"&gt;2&lt;/a&gt;&lt;/sup&gt; of tracking and it means I don't share their data with a 3rd party like Google.  &lt;/p&gt;
&lt;p&gt;The upgrade was fairly seamless.&lt;/p&gt;
&lt;p&gt;When I logged in there was a notification saying an update was available.&lt;/p&gt;
&lt;p&gt;&lt;img alt="New update avalible" src="https://xo.tc/images/piwik-update-1-new-update-avalible.png"&gt;&lt;/p&gt;
&lt;p&gt;I clicked on the update link to update and selected "Update Automatically"&lt;/p&gt;
&lt;p&gt;&lt;img alt="Update automatically" src="https://xo.tc/images/piwik-update-2-new-version-of-piwik.png"&gt;&lt;/p&gt;
&lt;p&gt;After about 10 seconds I got a message saying the update was successful&lt;/p&gt;
&lt;p&gt;&lt;img alt="Update successfull" src="https://xo.tc/images/piwik-update-3-sucessfull.png"&gt;&lt;/p&gt;
&lt;p&gt;Then I had to upgrade the database, as this is a very low traffic site I decided to upgrade in the browser&lt;/p&gt;
&lt;p&gt;&lt;img alt="Database upgrade" src="https://xo.tc/images/piwik-update-4-database.png"&gt;&lt;/p&gt;
&lt;p&gt;The update finished and I continued on to piwki&lt;/p&gt;
&lt;p&gt;&lt;img alt="Upgrade finished" src="https://xo.tc/images/piwik-update-5-upgrade-finished.png"&gt;&lt;/p&gt;
&lt;p&gt;Only when I reloaded the page I was getting 500 server errors&lt;/p&gt;
&lt;p&gt;&lt;img alt="Piwik 500 Server error" src="https://xo.tc/images/piwik-update-6-500-server-error.png"&gt;&lt;/p&gt;
&lt;p&gt;Looking in &lt;code&gt;/var/log/apache2/error.log&lt;/code&gt; I saw a number of errors saying:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;piwik&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;htaccess&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Options&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;allowed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I found that the &lt;code&gt;.htaccess&lt;/code&gt; file in the plugins directory had a line at the end&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Options -Indexes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That line stops people getting a directory listing of the files in the plugins folder, so it's an important security feature.&lt;/p&gt;
&lt;p&gt;I edited my apache2 config and changed my &lt;code&gt;AllowOverride&lt;/code&gt; setting from&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;Directory&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/var/www/html/piwik&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;AllowOverride&lt;span class="w"&gt; &lt;/span&gt;FileInfo&lt;span class="w"&gt; &lt;/span&gt;Limit&lt;span class="w"&gt; &lt;/span&gt;AuthConfig
&lt;span class="nt"&gt;&amp;lt;/Directory&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;Directory&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/var/www/html/piwik&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;AllowOverride&lt;span class="w"&gt; &lt;/span&gt;FileInfo&lt;span class="w"&gt; &lt;/span&gt;Limit&lt;span class="w"&gt; &lt;/span&gt;AuthConfig&lt;span class="w"&gt; &lt;/span&gt;Options=Indexes
&lt;span class="nt"&gt;&amp;lt;/Directory&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After that Piwik loaded up with no erros.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Piwik 3.0 new sign in page" src="https://xo.tc/images/piwik-update-7-new-signin-page.png"&gt;&lt;/p&gt;
&lt;p&gt;I've had a bit of a play with it and I think the new dashboard looks nice.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Piwik 3.0 new dashboard" src="https://xo.tc/images/piwik-update-8-new-dashboard.png"&gt;&lt;/p&gt;
&lt;p&gt;One of the features I've been tracking and looking forward it is the change from &lt;code&gt;md5&lt;/code&gt; hashes to &lt;code&gt;bcrypt&lt;/code&gt; so it's great to see that's &lt;a href="https://github.com/piwik/piwik/issues/5728"&gt;landed&lt;/a&gt; in the 3.0 release.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:analytics"&gt;
&lt;p&gt;If pushed, I'd have to begrudgingly admit that it's more about self validation than any technical usefulness of the data.&amp;#160;&lt;a class="footnote-backref" href="#fnref:analytics" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:opt-out"&gt;
&lt;p&gt;It would be better if all web analytics were opt-in, but that's not how the world seems to work.&amp;#160;&lt;a class="footnote-backref" href="#fnref:opt-out" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Piwik"></category><category term="Analytics"></category><category term="Privacy"></category><category term="Apache"></category></entry><entry><title>Is patching still the best defence</title><link href="https://xo.tc/is-patching-still-the-best-defence.html" rel="alternate"></link><published>2016-12-15T07:00:00+08:00</published><updated>2016-12-15T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-12-15:/is-patching-still-the-best-defence.html</id><summary type="html">&lt;p&gt;One of the nice things about the ASD's &lt;a href="http://www.asd.gov.au/infosec/mitigationstrategies.htm"&gt;Strategies to mitigate Targed Cyber Intrusoions&lt;/a&gt; is that they rank them by effectiveness. Saying that their top four would prevent 85% of intrusions.&lt;/p&gt;
&lt;p&gt;Their top four are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Application Whitelisting.&lt;/li&gt;
&lt;li&gt;Patching Applications.&lt;/li&gt;
&lt;li&gt;Patching Operating System Vulnerabilities.&lt;/li&gt;
&lt;li&gt;Restrict Administrative privileges.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Patching is two out …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One of the nice things about the ASD's &lt;a href="http://www.asd.gov.au/infosec/mitigationstrategies.htm"&gt;Strategies to mitigate Targed Cyber Intrusoions&lt;/a&gt; is that they rank them by effectiveness. Saying that their top four would prevent 85% of intrusions.&lt;/p&gt;
&lt;p&gt;Their top four are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Application Whitelisting.&lt;/li&gt;
&lt;li&gt;Patching Applications.&lt;/li&gt;
&lt;li&gt;Patching Operating System Vulnerabilities.&lt;/li&gt;
&lt;li&gt;Restrict Administrative privileges.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Patching is two out of the top four recommendations and has long viewed by many IT Security professionals, &lt;a href="https://xo.tc/automatic-updates-for-debian.html"&gt;my self included&lt;/a&gt; as one of the easiest things to do that gets you the best bang for your buck.&lt;/p&gt;
&lt;p&gt;I was at a meeting recently where someone said an exploit had not been used against their network in about 6 months. The implication was that a huge percentage of malware these days is delivered as an .exe in a zip file from an email &lt;a href="https://xo.tc/tracking-a-spam-campagn.html"&gt;claiming to be a traffic infringement&lt;/a&gt; or something similar. Suggesting that patching is no longer the easiest win for IT Security.&lt;/p&gt;
&lt;p&gt;I'm not entirely convinced that exploits are no longer being used, I think there are plenty of hacked sites and malvertising campaigns that take advantage of unpatched browsers or out of date applications like flash. But I can see a bit of a shift from using exploits to infect computers to simply sending a trojan or a phishing email and relying on tricking users.&lt;/p&gt;</content><category term="Posts"></category><category term="Patching"></category><category term="Exploits"></category><category term="Defence in Depth"></category></entry><entry><title>Tracking a spam campagn</title><link href="https://xo.tc/tracking-a-spam-campagn.html" rel="alternate"></link><published>2016-12-08T07:00:00+08:00</published><updated>2016-12-08T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-12-08:/tracking-a-spam-campagn.html</id><summary type="html">&lt;p&gt;At work yesterday we got a couple of phishing email claiming to be traffic infringements, nothing too remarkable about that. But interestingly this time the links in the emails to &lt;a href="https://bitly.com/"&gt;Bitly&lt;/a&gt;, a url shortener service that redirects traffic instead of going directly to some hacked site hosting malware.&lt;/p&gt;
&lt;p&gt;With Bitly …&lt;/p&gt;</summary><content type="html">&lt;p&gt;At work yesterday we got a couple of phishing email claiming to be traffic infringements, nothing too remarkable about that. But interestingly this time the links in the emails to &lt;a href="https://bitly.com/"&gt;Bitly&lt;/a&gt;, a url shortener service that redirects traffic instead of going directly to some hacked site hosting malware.&lt;/p&gt;
&lt;p&gt;With Bitly URLs you can simply put a + sign on the end of any link it will take you to a page of statistics rather than redirect you. The URLs from the phishing emails (with a plus sign added) were:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://bitly.com/2h3aFul+"&gt;https://bitly.com/2h3aFul+&lt;/a&gt;
&lt;img alt="bitly link 2h3aFul" src="https://xo.tc/images/bitly-2h3aFul.png"&gt;&lt;/p&gt;
&lt;p&gt;and &lt;a href="https://bitly.com/2gh3gXg+"&gt;https://bitly.com/2gh3gXg+&lt;/a&gt;
&lt;img alt="bitly link 2gh3gXg" src="https://xo.tc/images/bitly-2gh3gXg.png"&gt;&lt;/p&gt;
&lt;p&gt;We can see the first time either link was followed was around 21:00UTC wich is 05:00 AWST (Western Australia time) and it dies off pretty quickly suggesting that these campaigns move from one URL to another very quicly rather than spamming out the same URL all day&lt;sup id="fnref:all-day"&gt;&lt;a class="footnote-ref" href="#fn:all-day"&gt;1&lt;/a&gt;&lt;/sup&gt;. It also shows that most traffic is from Australia which you would expect given that the was claiming to be an infringement form the West Australia Police.&lt;/p&gt;
&lt;p&gt;Most of the traffic is direct access, this not surprising seeing that people are coming from email rather than another source such as twitter. Although there is a fair amount coming from localhost:5272. I’m not sure what that is, but a quick google search suggest it’s Xeams spam filter is following links in emails to check if they are malicious.&lt;/p&gt;
&lt;p&gt;The spoofed address this came from was infringement@data.gov.au, I'd be guessing they picked that one because it looks almost legitimate and data.gov.au doesn't have dmarc or even an SPF record&lt;sup id="fnref:SPF-Record"&gt;&lt;a class="footnote-ref" href="#fn:SPF-Record"&gt;2&lt;/a&gt;&lt;/sup&gt;. I was also surprised to find that in the footer of the email, the links were not malicious. There was one to the about West Australian Police and it really pointed to the about West Australian Police page. It was just in the body of the email that there were malicious links.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:all-day"&gt;
&lt;p&gt;It's posible that the spammers have setup their campaign to send emails early in the morning for their target timezone. I remember hearing from a legitimate (double opt-in) email marketing group that first thing in the morning was the most effective time to send emails because it will be a the top of people inbox as they are having their morning coffee.&amp;#160;&lt;a class="footnote-backref" href="#fnref:all-day" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:SPF-Record"&gt;
&lt;p&gt;I was really surprised to find that, I know a couple of the folks that helped set it up and they were pretty switched on types.&amp;#160;&lt;a class="footnote-backref" href="#fnref:SPF-Record" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Spam"></category><category term="Analytics"></category><category term="Australia"></category><category term="Email"></category></entry><entry><title>Automatic Updates for Debian</title><link href="https://xo.tc/automatic-updates-for-debian.html" rel="alternate"></link><published>2016-12-01T07:00:00+08:00</published><updated>2016-12-01T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-12-01:/automatic-updates-for-debian.html</id><summary type="html">&lt;p&gt;Good security is about defence in depth, layers of security. There is no one thing that will make you secure but one of the easiest things to do that gets you the best bang for your buck is patching your software.&lt;/p&gt;
&lt;p&gt;On windows this is called Automatic Updates, in Debian …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Good security is about defence in depth, layers of security. There is no one thing that will make you secure but one of the easiest things to do that gets you the best bang for your buck is patching your software.&lt;/p&gt;
&lt;p&gt;On windows this is called Automatic Updates, in Debian it's called Unattended Upgrades but it's essentially the same thing. There is an &lt;a href="https://wiki.debian.org/UnattendedUpgrades"&gt;Unattended Upgrades page&lt;/a&gt; on the Debian wiki that is pretty good. Enabling updates basicly boils down to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;unattended-upgrades&lt;span class="w"&gt; &lt;/span&gt;apt-listchanges
sudo&lt;span class="w"&gt; &lt;/span&gt;dpkg-reconfigure&lt;span class="w"&gt; &lt;/span&gt;-plow&lt;span class="w"&gt; &lt;/span&gt;unattended-upgrades
vim&lt;span class="w"&gt; &lt;/span&gt;/etc/apt/apt.conf.d/50unattended-upgrades
&lt;span class="c1"&gt;# Edit line 71 to send emails to a monitored address&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If your current update strategy is to SSH into boxes and run &lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get dist-upgrade&lt;/code&gt; whenever you remember then you should look automating it with unattended upgrades. Of course a full dev &amp;gt; test &amp;gt; production patch cycle is best for large mission critical things but for small setups like the one box that runs this website unattended upgrades are perfect.&lt;/p&gt;</content><category term="Posts"></category><category term="Debian"></category><category term="Linux"></category><category term="Patching"></category><category term="Defence in Depth"></category></entry><entry><title>The struggle with apathy</title><link href="https://xo.tc/the-struggle-with-apathy.html" rel="alternate"></link><published>2016-11-24T07:00:00+08:00</published><updated>2016-11-24T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-11-24:/the-struggle-with-apathy.html</id><summary type="html">&lt;p&gt;I like many people struggle&lt;sup id="fnref:struggle"&gt;&lt;a class="footnote-ref" href="#fn:struggle"&gt;1&lt;/a&gt;&lt;/sup&gt; with apathy, it's not that I'm depressed or that I don't find enjoyment in doing things. I still get that hacker like thirst for knowledge, that need to solve a problem or to understand what makes something tick. But sometimes I think it would …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I like many people struggle&lt;sup id="fnref:struggle"&gt;&lt;a class="footnote-ref" href="#fn:struggle"&gt;1&lt;/a&gt;&lt;/sup&gt; with apathy, it's not that I'm depressed or that I don't find enjoyment in doing things. I still get that hacker like thirst for knowledge, that need to solve a problem or to understand what makes something tick. But sometimes I think it would be so easy to spend a whole day on the couch just watching &lt;a href="http://watchtheguild.com/"&gt;weak sitcoms&lt;/a&gt; and eating &lt;a href="https://en.wikipedia.org/wiki/Cheezels"&gt;Cheezels&lt;/a&gt;, I could pass a lot of time watching &lt;a href="https://www.youtube.com/watch?v=tG7hYnMyxyY"&gt;funny YouTube videos&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One of the reasons I update this blog with a new post published at the same time every week is that I've made a commitment to my self, a schedule that I can stick to, a dead line that I need to meet. If I just updated this blog on an adhoc basis whenever I was in the mood I'd probably have about 4 post on here. It's not that I don't enjoy writing posts but that without some self imposed pressure I'd never get done.&lt;/p&gt;
&lt;p&gt;Generally when I see self help style things that are meant to be motivational they seem sickly sweet to me and put my right off. If you search &lt;a href="https://www.google.com.au/search?q=positive%20motivational&amp;amp;tbm=isch"&gt;positive motivational&lt;/a&gt; on Google and seeing things like "Choosing to be positive and having a grateful attitude is going to determine how you're going to live your life." and that makes you feel good, and it helps you achieve your goals that's awesome! Good for you.&lt;sup id="fnref:poes-law"&gt;&lt;a class="footnote-ref" href="#fn:poes-law"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;But for me it makes me feel a little nauseous. I don't really know how to explain, but the closest I can get is: It's like it's too happy to the point where it feels fake, and fake happiness feels worse than just feeling neutral.&lt;/p&gt;
&lt;p&gt;Yan Zhu wrote an good &lt;a href="https://diracdeltas.github.io/blog/thoughts-on-cypherpunks-2-0/"&gt;post about apathy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But there are some motivational things that I like;&lt;/p&gt;
&lt;p&gt;Matt Grey and Tom Scott recently did a bit on how they manage to do so much stuff, the whole video is pretty decent but there is a bit where &lt;a href="https://youtu.be/mz347Y9iXBY?t=2m14s"&gt;Tom says&lt;/a&gt; "Find someone who you can't let down". I like that, it could be a friend, family or or whatever but if you feel like you will disappoint or inconvenience someone you care about by not doing something they you're more likely to make the effort to do it.&lt;/p&gt;
&lt;p&gt;I like goals that are very specific, attainable and very easy to evaluate. Now I know that has a faint whiff of bovine manure, but what I mean by that is don't say "I'd like to learn to use Metasploit". That's way too open ended and it won't happen. What does it mean to 'use'? to what level of proficiency? by when? how will you know when you can 'use Metasploit' well enough. Instead be very, very specific, say "I'm going to finish one chapter of &lt;a href="https://www.nostarch.com/metasploit"&gt;this book on Metasploit&lt;/a&gt; every week for the next 17 weeks, I'll do it by doing an hours study every Sunday between 10:00 and 11:00 and if something comes up I'll move my hours study to Wednesday nights." That's much more achievable and you will know if you have failed or succeeded.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:struggle"&gt;
&lt;p&gt;Struggle may be too strong a word, I was going to call this post 'The war on apathy' which is a much snappier title. But I have a strong objection to people declaring 'war' on everything. So I spent some time on &lt;a href="http://www.thesaurus.com/"&gt;thesaurus.com&lt;/a&gt; and eventually gave up and went with struggle because I couldn't be bothered looking any more. The irony of that is not lost on me.&amp;#160;&lt;a class="footnote-backref" href="#fnref:struggle" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:poes-law"&gt;
&lt;p&gt;Incase your &lt;a href="https://en.wikipedia.org/wiki/Poe%27s_law"&gt;unsure&lt;/a&gt;, I mean that sincerely. We are not all the same and what works for one person doesn't for another. If those motivational posters are for you, then that's great.&amp;#160;&lt;a class="footnote-backref" href="#fnref:poes-law" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Metasploit"></category><category term="Books"></category></entry><entry><title>How to tunnel data over DNS</title><link href="https://xo.tc/how-to-tunnel-data-over-dns.html" rel="alternate"></link><published>2016-11-17T07:00:00+08:00</published><updated>2016-11-17T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-11-17:/how-to-tunnel-data-over-dns.html</id><summary type="html">&lt;p&gt;A while ago I wrote a post on &lt;a href="https://xo.tc/tunneling-data-over-dns.html"&gt;tunneling data over DNS&lt;/a&gt; that was a technical explanation of what's going on. This post is a tutorial on how to setup a DNS tunnel with &lt;a href="http://code.kryo.se/iodine/"&gt;iodine&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'm using &lt;a href="https://dnsmadeeasy.com/"&gt;DNS Made Easy&lt;/a&gt; as my main DNS provider, Debian on an EC2 for …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A while ago I wrote a post on &lt;a href="https://xo.tc/tunneling-data-over-dns.html"&gt;tunneling data over DNS&lt;/a&gt; that was a technical explanation of what's going on. This post is a tutorial on how to setup a DNS tunnel with &lt;a href="http://code.kryo.se/iodine/"&gt;iodine&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'm using &lt;a href="https://dnsmadeeasy.com/"&gt;DNS Made Easy&lt;/a&gt; as my main DNS provider, Debian on an EC2 for the DNS server, and Arch Linux and Windows as the client. I haven't tried this on other setups but it should be more or less the same.&lt;/p&gt;
&lt;h2 id="setting-up-the-server"&gt;Setting up the server&lt;/h2&gt;
&lt;p&gt;Start a t2.micro EC2&lt;sup id="fnref:ec2"&gt;&lt;a class="footnote-ref" href="#fn:ec2"&gt;1&lt;/a&gt;&lt;/sup&gt; running Debian, updated all the packages and reboot&lt;sup id="fnref:reboot"&gt;&lt;a class="footnote-ref" href="#fn:reboot"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;update&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;dist-upgrade&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then install iodine&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;iodine
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Setup the domain name to use for the tunnel, in my case I used tunnel.xo.tc. I created a sub-domain and delegated it to a DNS servers called tunnel-ns1.xo.tc.&lt;/p&gt;
&lt;p&gt;In DNS Made easy go to NS Records and hit the Add button.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Adding an NS Record" src="https://xo.tc/images/dns-tunnel-add-ns-record.png"&gt;&lt;/p&gt;
&lt;p&gt;Next we need to setup the A record for the name server we have specified.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Adding an A Record" src="https://xo.tc/images/dns-tunnel-add-a-record.png"&gt;&lt;/p&gt;
&lt;p&gt;Then on the EC2 server&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;iodined&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;.73.72.1&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;tunnel.xo.tc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-f&lt;/code&gt; Keeps iodined running on the forground, it's not nessacery but it makes it easier to stop and start.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;10.73.72.1&lt;/code&gt; is the local network that iodine will create. Use an address that is not on your LAN.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-c&lt;/code&gt; Disables checking of the client IP address, you will only need it if your DNS queries are getting routed through a cluster of DNS servers and so your traffic will be coming from diffrent IP addresses.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tunnel.xo.tc&lt;/code&gt; is the domain to use as a tunnel.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Check your server is working with &lt;a href="http://code.kryo.se/iodine/check-it/"&gt;iodine check tool&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="arch-linux-client"&gt;Arch Linux Client&lt;/h2&gt;
&lt;p&gt;On the client (Arch Linux)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;pacman&lt;span class="w"&gt; &lt;/span&gt;-S&lt;span class="w"&gt; &lt;/span&gt;iodine
sudo&lt;span class="w"&gt; &lt;/span&gt;iodine&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;tunnel.xo.tc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you run &lt;code&gt;ip addr&lt;/code&gt; you should see a new network connection&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;michael&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="nx"&gt;ezreal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;addr&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;dns0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;POINTOPOINT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;MULTICAST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;NOARP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;UP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;LOWER_UP&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mtu&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1130&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;qdisc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;fq_codel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;UNKNOWN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;group&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;qlen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;link&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;none&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;inet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;27&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;global&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;dns0&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="nx"&gt;valid_lft&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;forever&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;preferred_lft&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;forever&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;michael&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="nx"&gt;ezreal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ping&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;
&lt;span class="nx"&gt;PING&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;56&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;84&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;icmp_seq&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ttl&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;346&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;
&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;icmp_seq&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ttl&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;334&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;
&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;icmp_seq&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ttl&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;346&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;
&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;icmp_seq&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ttl&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;338&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;

&lt;span class="o"&gt;---&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;10.73.72.1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ping&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;statistics&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;packets&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;transmitted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;received&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;packet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;loss&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3001&lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;
&lt;span class="nx"&gt;rtt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;mdev&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m m-Double"&gt;334.381&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m m-Double"&gt;341.482&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m m-Double"&gt;346.673&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m m-Double"&gt;5.310&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Congratulations, you now have a tunnel through DNS.&lt;/p&gt;
&lt;h2 id="windows-client"&gt;Windows Client&lt;/h2&gt;
&lt;p&gt;First we need to install the Install the TAP32 driver. To do this download the &lt;a href="http://openvpn.net/index.php/open-source/downloads.html"&gt;OpenVPN&lt;/a&gt; installer&lt;sup id="fnref:openVPN"&gt;&lt;a class="footnote-ref" href="#fn:openVPN"&gt;3&lt;/a&gt;&lt;/sup&gt; and when you get to Choose Components step, you only need to pick TAP Virtual Ethernet Adapter.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Installing openVPN TAP adapter" src="https://xo.tc/images/installing-openVPN-TAP.png"&gt;&lt;/p&gt;
&lt;p&gt;The rest is more or less the same as Linux, download the latest binary, extract them, open a command prompt as administrator and run iodine &lt;code&gt;c:\Users\Michael\Downloads\iodine-0.7.0-windows\64bit\iodine.exe -f tunnel.xo.tc&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="making-it-a-service"&gt;Making it a service&lt;/h2&gt;
&lt;p&gt;Of course if you're planning on using it from a hotel WiFi for example you might not be able to SSH in and start iodine so you will want your tunnel available all the time.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;nano&lt;span class="w"&gt; &lt;/span&gt;/etc/default/iodine
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Setup your iodine config&lt;sup id="fnref:password"&gt;&lt;a class="footnote-ref" href="#fn:password"&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt; Default settings for iodine. This file is sourced from
&lt;span class="gh"&gt;#&lt;/span&gt; /etc/init.d/iodined
START_IODINED=&amp;quot;true&amp;quot;
IODINED_ARGS=&amp;quot;10.73.72.1 -c tunnel.xo.tc&amp;quot;
IODINED_PASSWORD=&amp;quot;SjLYBVAI4HnaF6TN6oryN7r2&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl enable iodined.service
sudo systemctl restart iodined.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="encryption-and-routing"&gt;Encryption and routing&lt;/h2&gt;
&lt;p&gt;Now you have a DNS tunnel between you and your server, but it doesn't mean that all your traffic will magically flow through it, nor is your traffic private&lt;sup id="fnref:private"&gt;&lt;a class="footnote-ref" href="#fn:private"&gt;5&lt;/a&gt;&lt;/sup&gt;. The recommended way is to either setup a VPN or SSH Tunnel&lt;sup id="fnref:tunnel"&gt;&lt;a class="footnote-ref" href="#fn:tunnel"&gt;6&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;On Linux it's pretty simple &lt;code&gt;ssh -D 8080 admin@10.73.72.1 -i aws-key.pem&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;On Windows it's pretty much the same, except we will use Putty and under Connection &amp;gt; SSH &amp;gt; Tunnels and Dynamic port forwarding on port 8080.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Putty Tunnel Settings" src="https://xo.tc/images/putty-add-ssh-tunnel.png"&gt;)&lt;/p&gt;
&lt;p&gt;Then in Firefox go to Options &amp;gt; Advanced &amp;gt; Network &amp;gt; Connection Settings &amp;gt; Manual proxy configuration and enter the SOCKS proxy details.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Firefox Proxy Settings" src="https://xo.tc/images/firefox-proxy-settings.png"&gt;&lt;/p&gt;
&lt;p&gt;I found the network to be painfully slow, but it's a fun little experment.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:ec2"&gt;
&lt;p&gt;Also if you are using Amazon, make sure you open ports TCP 22, TCP 53 and UDP 53 in the security groups settings.&amp;#160;&lt;a class="footnote-backref" href="#fnref:ec2" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:reboot"&gt;
&lt;p&gt;A reboot is not strictly necessary, but when I ran the updates it installed a new kernel so I wanted to reboot for the kernel update.&amp;#160;&lt;a class="footnote-backref" href="#fnref:reboot" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:openVPN"&gt;
&lt;p&gt;The documentation says it needs to be the 32 bit version of OpenVPN but I used the 64 bit version and it worked fine.&amp;#160;&lt;a class="footnote-backref" href="#fnref:openVPN" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:password"&gt;
&lt;p&gt;To generate a password I recommend &lt;code&gt;sudo dd if=/dev/random bs=1 count=18 2&amp;gt;/dev/null | base64&lt;/code&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:password" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:private"&gt;
&lt;p&gt;Tunneling data through DNS might be stealthy but iodine does not provide encryption be default.&amp;#160;&lt;a class="footnote-backref" href="#fnref:private" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:tunnel"&gt;
&lt;p&gt;Yes a tunnel with in a tunnel.&amp;#160;&lt;a class="footnote-backref" href="#fnref:tunnel" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="DNS"></category><category term="DNS Made Easy"></category><category term="Data Exfiltration"></category><category term="Debian"></category><category term="Arch Linux"></category><category term="Amazon"></category><category term="Firewalls"></category><category term="Windows"></category></entry><entry><title>You should try to outrun the bear</title><link href="https://xo.tc/you-should-try-to-outrun-the-bear.html" rel="alternate"></link><published>2016-11-10T07:00:00+08:00</published><updated>2016-11-10T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-11-10:/you-should-try-to-outrun-the-bear.html</id><summary type="html">&lt;p&gt;If you have worked in IT Security for a while you will probably have heard the old saying;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"You don't have to outrun the bear you only have to outrun the other bloke"&lt;sup id="fnref:saying"&gt;&lt;a class="footnote-ref" href="#fn:saying"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I've heard it several times and it annoys me because it's almost always used to defend …&lt;/p&gt;</summary><content type="html">&lt;p&gt;If you have worked in IT Security for a while you will probably have heard the old saying;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"You don't have to outrun the bear you only have to outrun the other bloke"&lt;sup id="fnref:saying"&gt;&lt;a class="footnote-ref" href="#fn:saying"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I've heard it several times and it annoys me because it's almost always used to defend doing a half-baked job of something. Things like using WEP because the neighbour's WiFi is unsecured.&lt;/p&gt;
&lt;p&gt;Now I would never say things need to be &lt;a href="https://xo.tc/perfectly-good.html"&gt;perfect&lt;/a&gt; you're better off with something that works and is good than waiting for the perfect solution to be built. But if you're going to do something you should at least try to do things properly.&lt;/p&gt;
&lt;p&gt;You should at the very least &lt;em&gt;try&lt;/em&gt; to outrun the bear.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:saying"&gt;
&lt;p&gt;Or some variation on the theme. The one I originally heard was "the tiger" which I think sounds better, but Google suggest that "the bear" is more popular.&amp;#160;&lt;a class="footnote-backref" href="#fnref:saying" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Philosophy"></category></entry><entry><title>Seting up Matrix Synapse and Riot on Debian 8 Jessie</title><link href="https://xo.tc/seting-up-matrix-synapse-and-riot-on-debian-8-jessie.html" rel="alternate"></link><published>2016-11-03T07:00:00+08:00</published><updated>2016-11-03T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-11-03:/seting-up-matrix-synapse-and-riot-on-debian-8-jessie.html</id><summary type="html">&lt;p&gt;My partner is going over seas and wanted to be able to make video calls to me back in Australia. Unfortunately because I use F-Droid and don't have the Google Play store on my phone&lt;sup id="fnref:F-Droid"&gt;&lt;a class="footnote-ref" href="#fn:F-Droid"&gt;1&lt;/a&gt;&lt;/sup&gt; I don't have WhatsApp or Viber or Facebook Messanger or... But I recently came …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My partner is going over seas and wanted to be able to make video calls to me back in Australia. Unfortunately because I use F-Droid and don't have the Google Play store on my phone&lt;sup id="fnref:F-Droid"&gt;&lt;a class="footnote-ref" href="#fn:F-Droid"&gt;1&lt;/a&gt;&lt;/sup&gt; I don't have WhatsApp or Viber or Facebook Messanger or... But I recently came across &lt;a href="https://riot.im/"&gt;Riot.im&lt;/a&gt; a messaging app with the concept rooms like IRC or Slack and that can do one to one video calls.&lt;/p&gt;
&lt;p&gt;So I decided to setup my own Matrix / Synapse server at home on Debian 8 Jesse.&lt;/p&gt;
&lt;p&gt;I went with the packages rather than installing from source because I like the idea of an easy &lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get dist-upgrade&lt;/code&gt; to keep everything up to date.&lt;/p&gt;
&lt;h2 id="add-the-matrix-synapse-signing-key"&gt;Add the matrix-synapse signing key&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;wget&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//matrix.org/packages/debian/repo-key.asc&lt;/span&gt;
&lt;span class="nx"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;repo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;asc&lt;/span&gt;
&lt;span class="nx"&gt;rm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;repo&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;asc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="edit-your-sourceslist"&gt;Edit your sources.list&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo vim /etc/apt/sources.list.d/synapse.list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;add&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;deb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;http://matrix.org/packages/debian/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;jessie&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;main&lt;/span&gt;
&lt;span class="k"&gt;deb-src&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;http://matrix.org/packages/debian/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;jessie&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kp"&gt;main&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="refresh-your-sources-and-install"&gt;Refresh your sources and install&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install matrix-synapse
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The install ask you for a host name, and if it can report anonymized statistics back home.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Synapse Host name" src="https://xo.tc/images/matrix-synapse-server-name.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Synapse Host name" src="https://xo.tc/images/matrix-synapse-anonymized-statistics.png"&gt;&lt;/p&gt;
&lt;h1 id="configure"&gt;Configure&lt;/h1&gt;
&lt;p&gt;That's pretty much it, most of the defaults are ok, I'd recomend reading through &lt;code&gt;homeserver.yaml&lt;/code&gt; anyway.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo vim /etc/matrix-synapse/homeserver.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I enabled registration, then removed it once I'd signed up (line 294).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Enable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;registration&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="nl"&gt;enable_registration:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;On this server I'm not using Let's Encrypt yet so I copied my SSL certificates over the top of  &lt;code&gt;homeserver.tls.crt&lt;/code&gt; and &lt;code&gt;homeserver.tls.key&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And started the server.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl enable matrix-synapse.service
sudo systemctl statrt matrix-synapse.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="dns-entry"&gt;DNS Entry&lt;/h2&gt;
&lt;p&gt;I setup a &lt;a href="https://github.com/matrix-org/synapse#setting-up-federation"&gt;DNS entry&lt;/a&gt; to tell federated servers what port to connect on. For me that was just entering a SRV record in DNS Made Easy.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Synapse Host name" src="https://xo.tc/images/matrix-synapse-dns-settings.png"&gt;&lt;/p&gt;
&lt;p&gt;The exact steps steps will be a little different depending on your DNS provider.&lt;/p&gt;
&lt;h2 id="apache2"&gt;Apache2&lt;/h2&gt;
&lt;p&gt;Lastly I setup Apache to proxy &lt;code&gt;/_matrix&lt;/code&gt; from port 443 to port 8008, below is part of my Apache2 config from &lt;code&gt;/etc/apache2/sites-enabled/000-default.conf&lt;/code&gt; but the important bit is after # Matrix Synapse&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;VirtualHost&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Host settings&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ServerName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hybr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;au&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# SSL Settings&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLEngine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLOptions&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;StrictRequire&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLHonorCipherOrder&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Remove all, Add back only TLS1.2&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ALL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;TLSv1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# A fine selection of the choicest ciphers&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCipherSuite&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ALL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ECDHE&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;RSA&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;AES256&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;GCM&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;SHA384&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ECDHE&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;RSA&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;AES128&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;GCM&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;SHA256&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCertificateFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;custom&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCertificateChainFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;custom&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_intermediate&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCertificateKeyFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;exmple&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Strict&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Transport&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Security&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;max-age=31536000&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Public&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Pins&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;pin-sha256=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;f5uthPZ21VOlA6Bye2yvoe+6a/h9fKRK27SdFt43XHQ=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;; pin-sha256=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;ATwpV5xzLfkVs631iympx7q+JlvRePMgTcvFG7x3Eeo=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;; max-age=5184000; includeSubDomains&amp;quot;&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ServerAdmin&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;webmaster&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DocumentRoot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# error, crit, alert, emerg.&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# It is also possible to configure the loglevel for particular&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# modules, e.g.&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;#LogLevel info ssl:warn&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ErrorLog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CustomLog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;access&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;combined&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;################################################################################    &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Matrix Synapse  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;################################################################################    &lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ProxyPass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;_matrix&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="mf"&gt;127.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8008&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;_matrix&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ProxyPassReverse&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;_matrix&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="mf"&gt;127.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8008&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;_matrix&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;VirtualHost&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then you can go to https://riot.im/app/#/register pick the custom server radio button and away you go.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Synapse Host name" src="https://xo.tc/images/riot-sign-up-page.png"&gt;&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:F-Droid"&gt;
&lt;p&gt;I've said it before, as this is a security blog I should point out that I use F-Droid and CyanogenMod for Open Source philosophical reasons and &lt;strong&gt;not&lt;/strong&gt; for security reasons. If you want a secure Android phone get a modern Nexus phone or the Google Pixel and stick on the stock ROM with all the Google updates.&amp;#160;&lt;a class="footnote-backref" href="#fnref:F-Droid" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Good Bye Google"></category><category term="Synapse"></category><category term="Matrix"></category><category term="Riot"></category><category term="Vector"></category><category term="Video Calls"></category><category term="Self Hosted"></category><category term="Federated"></category></entry><entry><title>Backing up a remote server with rsync</title><link href="https://xo.tc/backing-up-a-remote-server-with-rsync.html" rel="alternate"></link><published>2016-10-27T07:00:00+08:00</published><updated>2016-10-27T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-10-27:/backing-up-a-remote-server-with-rsync.html</id><summary type="html">&lt;p&gt;I've got a couple of VPS boxes over at &lt;a href="https://www.ransomit.com.au/"&gt;RansomIT&lt;/a&gt; including the server that run this site&lt;sup id="fnref:RansomIT"&gt;&lt;a class="footnote-ref" href="#fn:RansomIT"&gt;1&lt;/a&gt;&lt;/sup&gt;. One of those boxes is a cheap little VPS with 512MB of RAM that costs me $5 a month. I need to back up this box, my usual go to for personal …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've got a couple of VPS boxes over at &lt;a href="https://www.ransomit.com.au/"&gt;RansomIT&lt;/a&gt; including the server that run this site&lt;sup id="fnref:RansomIT"&gt;&lt;a class="footnote-ref" href="#fn:RansomIT"&gt;1&lt;/a&gt;&lt;/sup&gt;. One of those boxes is a cheap little VPS with 512MB of RAM that costs me $5 a month. I need to back up this box, my usual go to for personal servers is &lt;a href="https://www.crashplan.com/en-us/"&gt;Crashplan&lt;/a&gt; but Crashplan &lt;a href="https://support.code42.com/CrashPlan/4/Getting_Started/Code42_CrashPlan_System_Requirements"&gt;needs&lt;/a&gt; 1GB of RAM.&lt;/p&gt;
&lt;p&gt;So I thought, why not sync&lt;sup id="fnref:sync"&gt;&lt;a class="footnote-ref" href="#fn:sync"&gt;2&lt;/a&gt;&lt;/sup&gt; the contents of the small server over to more powerful server (with 8GB of RAM) that can run Crashplan.&lt;/p&gt;
&lt;h2 id="create-a-backup-user-on-the-source-server"&gt;Create a backup user on the source server&lt;/h2&gt;
&lt;p&gt;I'm going to create a 'backups' account on the source server, add an SSH key and add the backups account into the sudoers group&lt;sup id="fnref:Account"&gt;&lt;a class="footnote-ref" href="#fn:Account"&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;useradd&lt;span class="w"&gt; &lt;/span&gt;--system&lt;span class="w"&gt; &lt;/span&gt;--shell&lt;span class="w"&gt; &lt;/span&gt;/bin/bash&lt;span class="w"&gt; &lt;/span&gt;--home-dir&lt;span class="w"&gt; &lt;/span&gt;/home/backups&lt;span class="w"&gt; &lt;/span&gt;--create-home&lt;span class="w"&gt; &lt;/span&gt;backups
sudo&lt;span class="w"&gt; &lt;/span&gt;su&lt;span class="w"&gt; &lt;/span&gt;backups
&lt;span class="nb"&gt;cd&lt;/span&gt;
ssh-keygen
&lt;span class="c1"&gt;# Accept the defaults&lt;/span&gt;
mv&lt;span class="w"&gt; &lt;/span&gt;id_rsa.pub&lt;span class="w"&gt; &lt;/span&gt;authorized_keys
less&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/id_rsa
&lt;span class="c1"&gt;# Copy the private key and press Q to quit&lt;/span&gt;
&lt;span class="nb"&gt;exit&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;visudo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Add to the sudoers file&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# Allow backups to run rsync as root without a password
backups ALL=NOPASSWD:/usr/bin/rsync
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="create-our-backups-script-on-the-destinaton-server"&gt;Create our backups script on the destinaton server&lt;/h2&gt;
&lt;p&gt;Copy the ssh private key (id_rsa) to the destination server.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;backups
&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;backups
vim&lt;span class="w"&gt; &lt;/span&gt;backups.id_rsa
sudo&lt;span class="w"&gt; &lt;/span&gt;chown&lt;span class="w"&gt; &lt;/span&gt;root:root&lt;span class="w"&gt; &lt;/span&gt;backups.id_rsa
sudo&lt;span class="w"&gt; &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;backups.id_rsa
&lt;span class="c1"&gt;# SSH into the source server, this is both so we get the servers host key&lt;/span&gt;
&lt;span class="c1"&gt;# added and also a a bit of a &amp;#39;hello world&amp;#39; sanity check.&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;backups.id_rsa&lt;span class="w"&gt; &lt;/span&gt;backups@source.example.com
&lt;span class="nb"&gt;exit&lt;/span&gt;
vim&lt;span class="w"&gt; &lt;/span&gt;nightly-backups.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I've based my backups script on the one in the &lt;a href="https://wiki.archlinux.org/index.php/full_system_backup_with_rsync"&gt;Arch Wiki&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="c1"&gt;# -a Archive mode (keep file permissions etc...)&lt;/span&gt;
&lt;span class="c1"&gt;# -A preserve ACLs&lt;/span&gt;
&lt;span class="c1"&gt;# -X keep extended attributeds&lt;/span&gt;

&lt;span class="c1"&gt;# Backup www.example.com&lt;/span&gt;
rsync&lt;span class="w"&gt; &lt;/span&gt;-aAX&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;ssh -i /home/michael/backups/backups.id_rsa&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--rsync-path&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;sudo rsync&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--exclude&lt;span class="o"&gt;={&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/dev/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/proc/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/sys/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/tmp/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/run/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/mnt/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/media/*&amp;quot;&lt;/span&gt;,&lt;span class="s2"&gt;&amp;quot;/lost+found&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;--delete&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;backups@www.example.com:/&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;/home/michael/backups/www.example.com/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And link the script to crontab&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# The script needs to be owned by root or it won&amp;#39;t execute.&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;chown&lt;span class="w"&gt; &lt;/span&gt;root:root&lt;span class="w"&gt; &lt;/span&gt;nightly-backups.sh
sudo&lt;span class="w"&gt; &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;774&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nightly-backups.sh
sudo&lt;span class="w"&gt; &lt;/span&gt;vim&lt;span class="w"&gt; &lt;/span&gt;/etc/crontab
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt; rsync servers back here 01:15 every day.
15   1  &lt;span class="gs"&gt;*   *&lt;/span&gt;   *   root    /home/michael/backups/nightly-backups.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The reason I've got the backup job also running as root on the destination server is we are keeping the file permissions and some files will be owned by root (from the source server) so we need to be root on the destination server to overwrite them when they change.&lt;/p&gt;
&lt;p&gt;It's not the best backup solution but it's simple and effective.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:RansomIT"&gt;
&lt;p&gt;I'm an extremely satisfied customer and I'd be happy to recommend them. If you are looking for reasonably priced and reliable servers in Oceania with excellent customer service &lt;a href="https://www.ransomit.com.au/"&gt;RansomIT&lt;/a&gt; are great.&amp;#160;&lt;a class="footnote-backref" href="#fnref:RansomIT" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:sync"&gt;
&lt;p&gt;I wouldn't recommend &lt;em&gt;just&lt;/em&gt; syncing a server as a backup solution, if you get hit by cryptolocker and you sync your files then your backups are encrypted too. But in this case the synced copy is getting backed up by Crashplan which handles all of the file revisions and retention time frames.&amp;#160;&lt;a class="footnote-backref" href="#fnref:sync" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:Account"&gt;
&lt;p&gt;On the Unix and Linux stackexchange &lt;a href="http://unix.stackexchange.com/a/92397/112358"&gt;Martin von Wittich&lt;/a&gt; makes a good point that this could be run as root. He is correct, my choice to use a seperate account is not that it directly increases security but I feel it's neater and it doesn't lead to sprawl.&lt;/p&gt;
&lt;p&gt;For example say another job also needs to ssh in as root, if there is already an SSH key it would so easy to use the same key pair rather than generate a new one and append it to the authorized_keys. But then if you want to disable the backups you need to work out what other services are using that key pair.&lt;/p&gt;
&lt;p&gt;I've seen Windows environments where twenty or thirty different services were running as the domain administrator account, many of these service did need administrative access, things like backups, inventory systems and anti-virus. But it meant that the domain admin password couldn't be changed (for example when staff left) without breaking things. It took a lot of work to find all of the things that were using the account and migrate them to their own accounts so we could change (and disable) the domain admin account.&amp;#160;&lt;a class="footnote-backref" href="#fnref:Account" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Backups"></category><category term="Rsync"></category><category term="Cron"></category><category term="Linux"></category><category term="SSH"></category><category term="Stack Exchange"></category></entry><entry><title>Adding subject alternative name to certificate request</title><link href="https://xo.tc/adding-subject-alternative-name-to-certificate-request.html" rel="alternate"></link><published>2016-10-20T07:00:00+08:00</published><updated>2016-10-20T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-10-20:/adding-subject-alternative-name-to-certificate-request.html</id><summary type="html">&lt;p&gt;This is another &lt;a href="https://xo.tc/tag/note-to-self.html"&gt;note to self&lt;/a&gt;, I must have done this 20 or 30 times over the years but I can never remember exactly how.&lt;/p&gt;
&lt;p&gt;The easiest way I've found to add subject alternate names to certificate requests is to add two lines at the end of &lt;code&gt;/etc/ssl/openssl …&lt;/code&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is another &lt;a href="https://xo.tc/tag/note-to-self.html"&gt;note to self&lt;/a&gt;, I must have done this 20 or 30 times over the years but I can never remember exactly how.&lt;/p&gt;
&lt;p&gt;The easiest way I've found to add subject alternate names to certificate requests is to add two lines at the end of &lt;code&gt;/etc/ssl/openssl.cnf&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[SAN]&lt;/span&gt;
&lt;span class="na"&gt;subjectAltName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;DNS:example.com,DNS:www.example.com,DNS:mail.example.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then when creating a CSR simply include &lt;code&gt;-reqexts SAN&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;openssl req -out CSR.csr -new -newkey rsa:4096 -nodes -keyout privateKey.key -reqexts SAN&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;&lt;code&gt;openssl req -out CSR.csr -key my-existing-key.example.com.key -new -sha256 -reqexts SAN&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It's that simple.&lt;/p&gt;</content><category term="Posts"></category><category term="Note to self"></category><category term="OpenSSL"></category><category term="TLS"></category></entry><entry><title>Recovering data from a hard drive after wiping the partition table</title><link href="https://xo.tc/recovering-data-from-a-hard-drive-after-wiping-the-partition-table.html" rel="alternate"></link><published>2016-10-13T07:00:00+08:00</published><updated>2016-10-13T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-10-13:/recovering-data-from-a-hard-drive-after-wiping-the-partition-table.html</id><summary type="html">&lt;p&gt;A mate from work had a LUKS volume that he had setup and was using to store his personal documents, things like scanned copies of invoices and tax information. Unfortunately in a momentary lapse of concentration after mounting it he ran &lt;code&gt;mkfs.ext4&lt;/code&gt; over it.&lt;/p&gt;
&lt;p&gt;I'm sure we have all …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A mate from work had a LUKS volume that he had setup and was using to store his personal documents, things like scanned copies of invoices and tax information. Unfortunately in a momentary lapse of concentration after mounting it he ran &lt;code&gt;mkfs.ext4&lt;/code&gt; over it.&lt;/p&gt;
&lt;p&gt;I'm sure we have all been there before, anyone who has spent enough time in tech knows the gut wrenching feeling after entering the wrong command. I can still remember the tense feeling after I ran query but forgot the where clause and saw &lt;code&gt;(2986 row(s) affected)&lt;/code&gt; when I was expecting &lt;code&gt;(1 row(s) affected)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The good news was that my mate had a backup, the bad news was the backup was six months out of date. He was able to make a copy of the LUKS volume and run &lt;a href="http://www.cgsecurity.org/wiki/PhotoRec"&gt;PhotoRec&lt;/a&gt; over it which pulled back all the files.&lt;/p&gt;
&lt;p&gt;PhotoRec is a brilliant tool but it can't recover metadata so things like file names, creation and last modified dates and directory structures were all missing. So he was left with thousands of recovered files, some of which he already had and others that were new.&lt;/p&gt;
&lt;p&gt;I wrote a simple python script to run through two directories and check for files in the new directory (the recovered files) that were not in the old directory (backup of original files).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/usr/bin/python3&lt;/span&gt;
&lt;span class="c1"&gt;# -*- coding: UTF-8 -*-&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;A small python script to find new files in two similar directories.&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os.path&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;hashlib&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;argparse&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;setup_options&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Parse options and get the location of the old and the new directory.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;argparse&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ArgumentParser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Run through two directories (including sub directories) &amp;#39;&lt;/span&gt;
                     &lt;span class="s1"&gt;&amp;#39;and find files that are the new directory but not in &amp;#39;&lt;/span&gt;
                     &lt;span class="s1"&gt;&amp;#39;the old directory.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s1"&gt;&amp;#39;old_files&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;metavar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;old_directory&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;The old directory with the original files&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s1"&gt;&amp;#39;new_files&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;metavar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;new_directory&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;The new directory with both original files and new ones.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse_args&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;compare_two_directories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Run through two directories (including sub directories) and find files that&lt;/span&gt;
&lt;span class="sd"&gt;    are in the new directory but not in the old directory.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;original_files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# Run through the original directory and creates an MD5 sum each of the&lt;/span&gt;
    &lt;span class="c1"&gt;# files. MD5 is insecure because of known hash collisions, however we are&lt;/span&gt;
    &lt;span class="c1"&gt;# not trying to validate the file&amp;#39;s contents so it&amp;#39;s good enough, faster&lt;/span&gt;
    &lt;span class="c1"&gt;# and more memory efficient than SHA256.&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;dirpath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dirnames&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filenames&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;old_files&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;filenames&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dirpath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;file_hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="n"&gt;original_files&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_hash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Run through the new directory and print files who&amp;#39;s md5 hash is not in&lt;/span&gt;
    &lt;span class="c1"&gt;# the original list of files.&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;dirpath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dirnames&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filenames&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new_files&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;filenames&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dirpath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;file_hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;file_hash&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;original_files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;__main__&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;compare_two_directories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;setup_options&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I've put this script up on &lt;a href="https://github.com/HybridAU/compare"&gt;GitHub&lt;/a&gt; so anyone can use it, with a simple&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;michael@xo:~$&lt;span class="w"&gt; &lt;/span&gt;./compare.py&lt;span class="w"&gt; &lt;/span&gt;/home/michael/backup&lt;span class="w"&gt; &lt;/span&gt;/home/michael/recovered-files
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It runs through all the files in the old directory (and it's subdirectories) and calculates an MD5 sum. While MD5 is broken for validating the contents files because of known &lt;a href="http://www.mscs.dal.ca/~selinger/md5collision/"&gt;hash collisions&lt;/a&gt;, and should &lt;em&gt;never&lt;/em&gt; be used for storing passwords, we are just trying to compare two documents neither of which is coming from an untrusted source so it's good enough and quicker when running over a few thousands documents than SHA256&lt;sup id="fnref:quicker"&gt;&lt;a class="footnote-ref" href="#fn:quicker"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Then it stores the MD5 hash in a &lt;a href="https://docs.python.org/3.5/library/stdtypes.html#set-types-set-frozenset"&gt;set&lt;/a&gt;. I've used a set rather than say a list, because I don't want duplicates and I want to be able to check if a value is in the set quickly.&lt;/p&gt;
&lt;p&gt;Next it runs through the new directory (and it's subdirectories) and for every file that has an MD5 sum that's not in the set, it outputs the name.&lt;/p&gt;
&lt;p&gt;This script brought the number of recovered files down from thousands to a manageable amount, so hopefully it's useful for someone else in a similar situation.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:quicker"&gt;
&lt;p&gt;I believe that thanks to optimizations in the design of SHA256 it can potentially be quicker than MD5. I've heard that with OpenSSL SHA256 is quicker than MD5. But with my tests using python's hashlib MD5 was faster than SHA256.&amp;#160;&lt;a class="footnote-backref" href="#fnref:quicker" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Python"></category><category term="Backups"></category><category term="Full Disk Encryption"></category><category term="File recovery"></category></entry><entry><title>Setting up mailpile on Debian 8 Jessie for remote access</title><link href="https://xo.tc/setting-up-mailpile-on-debian-8-jessie-for-remote-access.html" rel="alternate"></link><published>2016-10-06T07:00:00+08:00</published><updated>2016-10-06T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-10-06:/setting-up-mailpile-on-debian-8-jessie-for-remote-access.html</id><summary type="html">&lt;p&gt;I've never yet found a mail client that I &lt;em&gt;really love&lt;/em&gt;. Outlook is ok in corporate environments. Gmail is probably the best I've used but I'm &lt;a href="https://xo.tc/good-bye-google.html"&gt;trying&lt;/a&gt; to move away from Google and free 3rd party hosted solutions. &lt;a href="https://roundcube.net/"&gt;Roundcube&lt;/a&gt; is pretty good, I'm not a fan of PHP but most …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've never yet found a mail client that I &lt;em&gt;really love&lt;/em&gt;. Outlook is ok in corporate environments. Gmail is probably the best I've used but I'm &lt;a href="https://xo.tc/good-bye-google.html"&gt;trying&lt;/a&gt; to move away from Google and free 3rd party hosted solutions. &lt;a href="https://roundcube.net/"&gt;Roundcube&lt;/a&gt; is pretty good, I'm not a fan of PHP but most of the internet seems to run on it. I've run &lt;a href="http://www.rainloop.net/"&gt;Rainloop&lt;/a&gt; for a while I like it. I actually think &lt;a href="https://www.kde.org/applications/internet/kmail/"&gt;KMail&lt;/a&gt; and &lt;a href="https://userbase.kde.org/Kontact"&gt;Kontact&lt;/a&gt; as a whole are very nice. I kind of wish they handled HTML email a bit more elegantly but with some tweaking they work well. The problem is they are desktop solutions and I'd like something I can access remotely. I use &lt;a href="http://www.mutt.org/"&gt;Mutt&lt;/a&gt; over ssh a bit and that works well enough.&lt;/p&gt;
&lt;p&gt;So I though I'd give &lt;a href="https://www.mailpile.is/"&gt;mailpile&lt;/a&gt; a go, I know it's not designed to run as a web service but it can.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/mailpile/Mailpile/wiki/Getting-started-on-linux"&gt;install guide&lt;/a&gt; is very well documented. I pretty much followed it verbatim although I tweaked a few things because I wanted it to run as a service.&lt;/p&gt;
&lt;p&gt;I SSHed into my home box and forwareded port 33411&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ssh example.com -L 33411:localhost:33411
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-the-prerequisites"&gt;Install the prerequisites&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo apt-get install git gnupg openssl python-virtualenv python-pip python-lxml python-dev libjpeg-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="clone-the-git-repo"&gt;Clone the Git Repo&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt; sudo git clone --recursive https://github.com/mailpile/Mailpile.git /opt/mailpile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="create-a-mailpile-user"&gt;Create a mailpile user&lt;/h2&gt;
&lt;p&gt;For now we are going to give the user &lt;code&gt;/bin/bash&lt;/code&gt; as a shell, but later we will change it to &lt;code&gt;/usr/sbin/nologin&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo useradd --system --shell /bin/bash --home-dir /opt/mailpile mailpile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="setup-the-virtual-environment"&gt;Setup the virtual environment&lt;/h2&gt;
&lt;p&gt;Unfortunately it looks like mailpile only runs with Python 2.7 not Python 3+&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ownership&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;
&lt;span class="nx"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;chown&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;opt&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;

&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Change&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;
&lt;span class="nx"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;su&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;

&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;into&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;newly&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;created&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;repo&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;opt&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;mailpile&lt;/span&gt;

&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;virtual&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;directory&lt;/span&gt;
&lt;span class="nx"&gt;virtualenv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;python2&lt;/span&gt;&lt;span class="m m-Double"&gt;.7&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;system&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;site&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;packages&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mp&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;virtualenv&lt;/span&gt;

&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;activate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;virtual&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;
&lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mp&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;virtualenv&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;activate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install-the-dependencies"&gt;Install the dependencies&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="run-mailpile"&gt;Run mailpile&lt;/h2&gt;
&lt;p&gt;As a test we are going to start mailpile manually, once we are sure it's working we will make it a service.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;./mp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If all has gone well you should now see a &lt;code&gt;mailpile&amp;gt;&lt;/code&gt; prompt and if have forwareded the ports you should be able to browse to &lt;a href="http://localhost:33411"&gt;http://localhost:33411&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="setup-mail"&gt;Setup mail&lt;/h2&gt;
&lt;p&gt;The setup was very simple,&lt;/p&gt;
&lt;p&gt;You are first greeted with a welcome screen where you select your language&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile first welcome screen" src="https://xo.tc/images/mailpile_01_welcome_to_mailpile.png"&gt;&lt;/p&gt;
&lt;p&gt;Next you choose a password&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Choose a password" src="https://xo.tc/images/mailpile_02_Choose_a_password.png"&gt;&lt;/p&gt;
&lt;p&gt;Click through to finish the setup&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Finish setup" src="https://xo.tc/images/mailpile_03_Mailpile_Secured.png"&gt;&lt;/p&gt;
&lt;p&gt;And you end up a login screen&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Login screen" src="https://xo.tc/images/mailpile_04_Login_screen.png"&gt;&lt;/p&gt;
&lt;p&gt;Once you login you are presented with a welcome screen.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile First welcome screen" src="https://xo.tc/images/mailpile_05_Welcom_screen.png"&gt;&lt;/p&gt;
&lt;p&gt;Before you can add an account you need to run through the privacy settings, I went with the defaults which were pertty good.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Privacy settings" src="https://xo.tc/images/mailpile_06_Privacy_settings.png"&gt;&lt;/p&gt;
&lt;p&gt;Then you go back to the welcome screen but this time you can add an account.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Retrun to welcome screen" src="https://xo.tc/images/mailpile_07_Returned_welcom_screen.png"&gt;&lt;/p&gt;
&lt;p&gt;I added an account&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Adding an account" src="https://xo.tc/images/mailpile_08_Add_account.png"&gt;&lt;/p&gt;
&lt;p&gt;I went with the 'Detect settings' option to see how well that worked, it took a couple of minutes but got everything right. Later I also tried adding settings manually and that was pretty easy too.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Auto detect settings" src="https://xo.tc/images/mailpile_09_auto_detect.png"&gt;&lt;/p&gt;
&lt;p&gt;Lastly you setup your encryption options and your done.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Auto detect settings" src="https://xo.tc/images/mailpile_10_finished_setup.png"&gt;&lt;/p&gt;
&lt;p&gt;Now you can check your mail.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mailpile Home screen" src="https://xo.tc/images/mailpile_11_Showing_mail.png"&gt;&lt;/p&gt;
&lt;p&gt;When I was setting up Mailpile I ran into &lt;a href="https://github.com/mailpile/Mailpile/issues/1578"&gt;issue 1578&lt;/a&gt; and so no mail was showing up. Fortunatly there is a &lt;a href="https://github.com/cbrouwer/Mailpile/commit/b1708c98df6ed60a2a0c513a9ab1683e4530156a"&gt;simple fix&lt;/a&gt; for that which will hopefully be merged soon.&lt;/p&gt;
&lt;p&gt;I'm planning on running Mailpile under a subdirectory (e.g. example.com/mailpile) so in the mailpile terminal I ran &lt;code&gt;set sys.http_path = /mailpile&lt;/code&gt; but that's not necessary if your planning on running it in the root of your domain.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mailpile&amp;gt; login

Your password:

mailpile&amp;gt; set sys.http_path = /mailpile
Elapsed: 0.001s (set: Updated your settings)

{
    &amp;quot;sys.http_path&amp;quot;: &amp;quot;/mailpile&amp;quot;
}

mailpile&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="make-it-a-service"&gt;Make it a service&lt;/h2&gt;
&lt;p&gt;Press Ctrl + D to exit the mailpile cli, then type &lt;code&gt;deactivate&lt;/code&gt; python virtual environment and &lt;code&gt;exit&lt;/code&gt; to change back to your normal account.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo vim /etc/systemd/system/mailpile.service&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Unit]&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Mailplie Server&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;syslog.target&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;simple&lt;/span&gt;
&lt;span class="na"&gt;User&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;mailpile&lt;/span&gt;
&lt;span class="na"&gt;Group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;mailpile&lt;/span&gt;
&lt;span class="na"&gt;WorkingDirectory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/mailpile&lt;/span&gt;
&lt;span class="na"&gt;ExecStart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/mailpile/mp-virtualenv/bin/python mp --www= --wait&lt;/span&gt;

&lt;span class="c1"&gt;# Give a reasonable amount of time for the server to start up/shut down&lt;/span&gt;
&lt;span class="na"&gt;TimeoutSec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;300&lt;/span&gt;

&lt;span class="k"&gt;[Install]&lt;/span&gt;
&lt;span class="na"&gt;WantedBy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Enable and start the service&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo systemctl enable mailpile.service
sudo systemctl start mailpile.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now that it's a service we can lock the user account down a bit more by giving it no shell.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo usermod -s /usr/sbin/nologin mailpile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="make-it-a-website"&gt;Make it a website&lt;/h2&gt;
&lt;p&gt;As Mailpile is still in beta and they &lt;a href="https://github.com/mailpile/Mailpile/wiki/Accessing-The-GUI-Over-Internet"&gt;recommend&lt;/a&gt; you don't leave it open.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At the moment, we do not recommend exposing Mailpile directly to the wider Internet.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So I'm going to be setting mine up so you need a client certificate to access it. This isn't necessary but it's an extra layer of security and I'd recommend it. I've got a tutorial on &lt;a href="https://xo.tc/setting-up-a-personal-certification-authority.html"&gt;setting up a personal certification authority&lt;/a&gt; and &lt;a href="https://xo.tc/securing-apache-with-client-certificates.html"&gt;securing apache with client certificates&lt;/a&gt; if you want more information on how that works.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo vim /etc/apache2/sites-enabled/000-default.conf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Below is most of my apache2 config, but the important bits are under &lt;code&gt;# SSL Client&lt;/code&gt; Certificates and &lt;code&gt;# Mailpile&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;VirtualHost&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Host settings&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ServerName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# SSL Settings&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLEngine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLOptions&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;StrictRequire&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLHonorCipherOrder&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Remove all, Add back only TLS1.2&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ALL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;TLSv1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# A fine selection of the choicest ciphers&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCipherSuite&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ALL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ECDHE&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;RSA&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;AES256&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;GCM&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;SHA384&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ECDHE&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;RSA&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;AES128&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;GCM&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;SHA256&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCertificateFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;custom&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCertificateChainFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;custom&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_intermediate&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCertificateKeyFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;exmple&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Strict&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Transport&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Security&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;max-age=31536000&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# HPKP: HTTP Public Key Pinning&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# https://scotthelme.co.uk/hpkp-http-public-key-pinning/&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# https://developer.mozilla.org/en-US/docs/Web/Security/Public_Key_Pinning&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Public&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Pins&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;pin-sha256=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;f5uthPZ21VOlA6Bye2yvoe+6a/h9fKRK27SdFt43XHQ=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;; pin-sha256=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;ATwpV5xzLfkVs631iympx7q+JlvRePMgTcvFG7x3Eeo=&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;; max-age=5184000; includeSubDomains&amp;quot;&lt;/span&gt;


&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ServerAdmin&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;webmaster&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DocumentRoot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# error, crit, alert, emerg.&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# It is also possible to configure the loglevel for particular&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# modules, e.g.&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;#LogLevel info ssl:warn&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ErrorLog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CustomLog&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;access&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;combined&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;################################################################################    &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# SSL Client Certificates&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;################################################################################        &lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# This allows any client certificates issued by Example CA&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;SSLCACertificateFile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;custom&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ExampleCertificationAuthority&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;################################################################################    &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# Mailpile&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;################################################################################    &lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ProxyPass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mailpile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="mf"&gt;127.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;33411&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mailpile&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ProxyPassReverse&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mailpile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="mf"&gt;127.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;33411&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mailpile&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mailpile&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;SSLVerifyClient&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;require&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;SSLVerifyDepth&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# Restricts the list of client certificates we accept, from all&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;# client certificates issued by Example CA to just authorised ones.&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;SSLRequire&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;SSL_CLIENT_S_DN_Email&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;eq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;michael@example.com&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;\
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="ow"&gt;or&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;SSL_CLIENT_S_DN_Email&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;eq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;michael@xo.tc&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;Location&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;VirtualHost&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Restart Apache and your done.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo systemctl restart apache2.service&lt;/code&gt;&lt;/p&gt;</content><category term="Posts"></category><category term="Good bye Google"></category><category term="Mailpile"></category><category term="Apache"></category><category term="Debian"></category><category term="Self Hosted"></category><category term="TLS"></category></entry><entry><title>My ownCloud update script</title><link href="https://xo.tc/my-owncloud-update-script.html" rel="alternate"></link><published>2016-09-29T07:00:00+08:00</published><updated>2016-09-29T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-09-29:/my-owncloud-update-script.html</id><summary type="html">&lt;p&gt;&lt;strong&gt;Update 2017-03-02:&lt;/strong&gt; If your using Nextcloud they now have their own &lt;a href="https://xo.tc/using-the-newish-nextcloud-updater.html"&gt;in browser updater&lt;/a&gt; this script still works though. &lt;/p&gt;
&lt;p&gt;One of the most important things in security is patching. For the last several years two out of the ASD's &lt;a href="http://www.asd.gov.au/infosec/top-mitigations/mitigations-2014-table.htm"&gt;top four mitigations&lt;/a&gt; have been patching (patching applications and patching the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;strong&gt;Update 2017-03-02:&lt;/strong&gt; If your using Nextcloud they now have their own &lt;a href="https://xo.tc/using-the-newish-nextcloud-updater.html"&gt;in browser updater&lt;/a&gt; this script still works though. &lt;/p&gt;
&lt;p&gt;One of the most important things in security is patching. For the last several years two out of the ASD's &lt;a href="http://www.asd.gov.au/infosec/top-mitigations/mitigations-2014-table.htm"&gt;top four mitigations&lt;/a&gt; have been patching (patching applications and patching the Operating System).&lt;/p&gt;
&lt;p&gt;To me I think how your going to get new version of your application out to your end users should be a decision made very early in the design phase. About the time your thinking whats the most appropriate programing language to tackle a problem you should also be thinking how will I deploy this code once it's written and how will we update deployments.&lt;/p&gt;
&lt;p&gt;Sometimes this decision will be made for you by the platform you are targeting such as Android or IOS. Sometimes it's not your problem when you expect downstream distributions to deal with packaging and updates&lt;sup id="fnref:downstream"&gt;&lt;a class="footnote-ref" href="#fn:downstream"&gt;1&lt;/a&gt;&lt;/sup&gt;. And sometimes you need to build your own update mechanism. I quite like the way &lt;a href="http://www.librenms.org/"&gt;LibreNMS&lt;/a&gt; updates, which basically boils down to a cron job doing a &lt;code&gt;git pull&lt;/code&gt; every day.&lt;/p&gt;
&lt;p&gt;I've used &lt;a href="https://owncloud.org/"&gt;ownCloud&lt;/a&gt; for a while but one thing that's always annoyed me is they don't have an easy way to upgrades. I'd like to just tick a box that says 'Keep me on the latest stable version' or at the very least 'download security fixes automatically'.&lt;/p&gt;
&lt;p&gt;For now I've made do with this script and just manually downloading the latest version of ownCloud each time there is a patch.&lt;/p&gt;
&lt;p&gt;I've created a directory called &lt;code&gt;/opt/owncloud-install/&lt;/code&gt; and in there I've got a subdirectory called &lt;code&gt;old-installs&lt;/code&gt;. When a new ownCloud version comes out I cd into &lt;code&gt;/opt/owncloud-install/&lt;/code&gt; wget the latest version and run &lt;code&gt;/opt/owncloud-install/upgrade.sh&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="c1"&gt;# Stop Apache2 (not necessary, but it&amp;#39;s a good idea)&lt;/span&gt;
systemctl&lt;span class="w"&gt; &lt;/span&gt;stop&lt;span class="w"&gt; &lt;/span&gt;apache2.service

&lt;span class="c1"&gt;# Backup config.php and data&lt;/span&gt;
mv&lt;span class="w"&gt; &lt;/span&gt;/var/www/owncloud/config/config.php&lt;span class="w"&gt; &lt;/span&gt;/opt/owncloud-install/config.php
mv&lt;span class="w"&gt; &lt;/span&gt;/var/www/owncloud/data&lt;span class="w"&gt; &lt;/span&gt;/opt/owncloud-install/

&lt;span class="c1"&gt;# Delete everything else&lt;/span&gt;
rm&lt;span class="w"&gt; &lt;/span&gt;-rf&lt;span class="w"&gt; &lt;/span&gt;/var/www/owncloud/
&lt;span class="c1"&gt;# Extract a fresh copy (the tar ball doesn&amp;#39;t include a data and config.php)&lt;/span&gt;
tar&lt;span class="w"&gt; &lt;/span&gt;-xf&lt;span class="w"&gt; &lt;/span&gt;owncloud-*.tar.bz2&lt;span class="w"&gt; &lt;/span&gt;-C&lt;span class="w"&gt; &lt;/span&gt;/var/www/

&lt;span class="c1"&gt;# Replace the backed up files&lt;/span&gt;
mv&lt;span class="w"&gt; &lt;/span&gt;/opt/owncloud-install/config.php&lt;span class="w"&gt; &lt;/span&gt;/var/www/owncloud/config/
mv&lt;span class="w"&gt; &lt;/span&gt;/opt/owncloud-install/data/&lt;span class="w"&gt; &lt;/span&gt;/var/www/owncloud/

&lt;span class="c1"&gt;# Set ownership (the files in the tar ball are owned by nobody)&lt;/span&gt;
chown&lt;span class="w"&gt; &lt;/span&gt;-R&lt;span class="w"&gt; &lt;/span&gt;www-data:www-data&lt;span class="w"&gt; &lt;/span&gt;/var/www/owncloud/

&lt;span class="c1"&gt;# Start Apache2 back up.&lt;/span&gt;
systemctl&lt;span class="w"&gt; &lt;/span&gt;start&lt;span class="w"&gt; &lt;/span&gt;apache2.service

&lt;span class="c1"&gt;# Achive install file&lt;/span&gt;
mv&lt;span class="w"&gt; &lt;/span&gt;owncloud-*.tar.bz2&lt;span class="w"&gt; &lt;/span&gt;old-installs/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After that you still need to visit your ownCloud home page and click through the database upgrades.&lt;/p&gt;
&lt;p&gt;It's not the most robust script but it works well enough for me. I've been looking at &lt;a href="https://nextcloud.com/"&gt;NextCloud&lt;/a&gt;, I haven't made the switch yet but if they introduce an automatic update mechanism that would be a big enough draw card for me to change.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:downstream"&gt;
&lt;p&gt;Although even then you need some way to mark a new version and security fixes so the downstream can package them.&amp;#160;&lt;a class="footnote-backref" href="#fnref:downstream" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="ownCloud"></category><category term="Updates"></category><category term="LibreNMS"></category><category term="Patching"></category><category term="Cron"></category></entry><entry><title>Calls from the bank</title><link href="https://xo.tc/calls-from-the-bank.html" rel="alternate"></link><published>2016-09-22T07:00:00+08:00</published><updated>2016-09-22T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-09-22:/calls-from-the-bank.html</id><summary type="html">&lt;p&gt;I bank with one of the &lt;a href="https://en.wikipedia.org/wiki/Banking_in_Australia#Four_pillars"&gt;big four banks&lt;/a&gt; in Australia I recently got a call, and it started off&lt;/p&gt;
&lt;p&gt;"Hi I'm Taylor&lt;sup id="fnref:Taylor"&gt;&lt;a class="footnote-ref" href="#fn:Taylor"&gt;1&lt;/a&gt;&lt;/sup&gt; I'm calling from {bank_name} and I'd like to talk to you about a letter you received from the bank recently"&lt;/p&gt;
&lt;p&gt;I hadn't seen any letter but …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I bank with one of the &lt;a href="https://en.wikipedia.org/wiki/Banking_in_Australia#Four_pillars"&gt;big four banks&lt;/a&gt; in Australia I recently got a call, and it started off&lt;/p&gt;
&lt;p&gt;"Hi I'm Taylor&lt;sup id="fnref:Taylor"&gt;&lt;a class="footnote-ref" href="#fn:Taylor"&gt;1&lt;/a&gt;&lt;/sup&gt; I'm calling from {bank_name} and I'd like to talk to you about a letter you received from the bank recently"&lt;/p&gt;
&lt;p&gt;I hadn't seen any letter but I've migrated all my bills to paperless and I on only check my snail mail once every week or two. I said so and the call continued.&lt;/p&gt;
&lt;p&gt;"I apologizes for this but I need to let you know this call is being recorded for quality assurance purposes, and as I am accessing your profile I will need to verify your account, I'll need your full name including middle name, current address and date of birth."&lt;/p&gt;
&lt;p&gt;At this point Taylor had provided me with no details to prove the call has come from the bank. The call had come from an odd number&lt;sup id="fnref:odd-number"&gt;&lt;a class="footnote-ref" href="#fn:odd-number"&gt;2&lt;/a&gt;&lt;/sup&gt; and they were asking for personal information.&lt;/p&gt;
&lt;p&gt;So I asked Taylor if I could call back to verify the call was from the bank and also asked for Taylor's last name. Taylor seemed genuinely surprised and almost a little offended that I didn't just trust that this mysterious call was from my bank. Taylor then told me that employees were not allowed to give out their last name for privacy reasons but suggested that I call back on the same number that I had in my caller ID. That number is not publicly available anywhere on the bank website. In fact when I Googled the number I found other people asking about the same number on the bank's forums with a moderator saying "I am unable to confirm whether this is a {bank_name} phone number;"&lt;/p&gt;
&lt;p&gt;So I called the bank using the number on their contact us page and I was expecting to hear them say, "Yes it's a scam, it's been doing the rounds and we are doing our best to stop it but comes from outside Australia and it's hard to shutdown." Instead I spoke to Sandy&lt;sup id="fnref:Sandy"&gt;&lt;a class="footnote-ref" href="#fn:Sandy"&gt;3&lt;/a&gt;&lt;/sup&gt; who actually laughed and also seemed very surprised that I'd though someone cold calling me and calming to be from a bank with about a 20% market share&lt;sup id="fnref:market-share"&gt;&lt;a class="footnote-ref" href="#fn:market-share"&gt;4&lt;/a&gt;&lt;/sup&gt; might not be genuine.&lt;/p&gt;
&lt;p&gt;As it turned out the call was genuine and they were trying to sell me a an "upgrade" on my mortgage.&lt;/p&gt;
&lt;p&gt;I saw Tory Hunt &lt;a href="https://www.troyhunt.com/this-is-your-bank-please-verify-your/"&gt;write about this&lt;/a&gt; almost two years ago. I thought banks were getting on top of this sort of thing, and I thought my bank had a pretty good security team. I met a few people who claimed to be part of their security teem at &lt;a href="https://ruxcon.org.au/"&gt;Ruxcon&lt;/a&gt; and they seemed pretty switched on.&lt;/p&gt;
&lt;p&gt;I guess this is the sort of thing a marketing manager might setup without really thinking about the security implications but it's almost training people to just accept cold calls and give out information. I'm amazed they don't get more people calling back to verify but it seemed like I was an anomaly.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:Taylor"&gt;
&lt;p&gt;I've changed the name.&amp;#160;&lt;a class="footnote-backref" href="#fnref:Taylor" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:odd-number"&gt;
&lt;p&gt;I'm aware that &lt;a href="https://en.wikipedia.org/wiki/Caller_ID_spoofing"&gt;caller ID spoofing&lt;/a&gt; is not that hard but it still, it was a number I didn't recognize.&amp;#160;&lt;a class="footnote-backref" href="#fnref:odd-number" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:Sandy"&gt;
&lt;p&gt;Again I've changed the name.&amp;#160;&lt;a class="footnote-backref" href="#fnref:Sandy" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:market-share"&gt;
&lt;p&gt;I've looked for a reliable source on banks market share and they all seem to differ a bit but it's generally about 20% to each of the big for banks and the remaining 20% split between all the small credit unions and little one branch banks. That combined with the fact that many people use more than one bank, I think if you called random Australian phone numbers you would have better than a 1 in 5 chance of finding someone who uses this bank.&amp;#160;&lt;a class="footnote-backref" href="#fnref:market-share" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Banks"></category><category term="Social Engineering"></category><category term="Privacy"></category></entry><entry><title>An excellent demonstration of Cross-Site Request Forgery</title><link href="https://xo.tc/an-excellent-demonstration-of-cross-site-request-forgery.html" rel="alternate"></link><published>2016-09-15T07:00:00+08:00</published><updated>2016-09-15T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-09-15:/an-excellent-demonstration-of-cross-site-request-forgery.html</id><summary type="html">&lt;p&gt;A few weeks ago one of the people I follow on &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt; stared the &lt;a href="https://github.com/superlogout/superlogout.github.io"&gt;superlogout&lt;/a&gt; repository.&lt;/p&gt;
&lt;p&gt;Intrigued by the name I went to check it out and found a simple site that logs you out of a bunch of services. For those that want to try it, it's available at …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A few weeks ago one of the people I follow on &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt; stared the &lt;a href="https://github.com/superlogout/superlogout.github.io"&gt;superlogout&lt;/a&gt; repository.&lt;/p&gt;
&lt;p&gt;Intrigued by the name I went to check it out and found a simple site that logs you out of a bunch of services. For those that want to try it, it's available at &lt;a href="http://superlogout.github.io/"&gt;superlogout.github.io&lt;/a&gt; the way it works is pretty straight forward, it uses JavaScript to GET a &lt;a href="https://github.com/superlogout/superlogout.github.io/blob/559be9fe2bb427745e30863f0733cd508a12eb09/index.html#L230-L275"&gt;bunch of urls&lt;/a&gt; that are the logout pages for services (or in the case of YouTube, DeviantART and LiveJournal it's a POST).&lt;/p&gt;
&lt;p&gt;This an excellent demonstration of how &lt;a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet"&gt;Cross-Site Request Forgery&lt;/a&gt; works. In this case it's made clear that they are logging you out of the service, but they don't have to show you. I could embed the same JavaScript in my site but not show anything, people would just be mysteriously logged out of their GMail after reading my blog. Further I could use that along with my analytics to record which services visitors were logged into when they visited.&lt;/p&gt;
&lt;p&gt;Logging someone out is not that dangerous but it's easy to see what could be done without CSRF protection. If they could post to any page on those sites with JavaScript, they could buy things on Amazon, bid on auctions on eBay, send emails with GMail and so on.&lt;/p&gt;
&lt;p&gt;It's not &lt;a href="https://en.wikipedia.org/wiki/Poe%27s_law"&gt;entirely clear&lt;/a&gt; to me whether this is a parody site showing the power of CSRF or if it's genuinely meant to be a service. But my feeling is that it's meant to poke fun at the insecurities, and demonstrate that CSRF protection is needed on all pages, including logout pages and not just on pages where you can post data.&lt;/p&gt;</content><category term="Posts"></category><category term="CSRF"></category><category term="OWASP"></category><category term="JavaScript"></category></entry><entry><title>Alternative Networks for this site - ZeroNet</title><link href="https://xo.tc/alternative-networks-for-this-site-zeronet.html" rel="alternate"></link><published>2016-09-08T07:00:00+08:00</published><updated>2016-09-08T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-09-08:/alternative-networks-for-this-site-zeronet.html</id><summary type="html">&lt;p&gt;Over the last couple of weeks I've published this site as an &lt;a href="https://xo.tc/alternative-networks-for-this-site-i2p.html"&gt;I2P eepsite&lt;/a&gt;, and as a &lt;a href="https://xo.tc/alternative-networks-for-this-site-tor.html"&gt;Tor Hidden Service&lt;/a&gt;. This week I'm announcing Exotic Security is now available as a &lt;a href="https://zeronet.io/"&gt;ZeroNet&lt;/a&gt; site.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://localhost:43110/19M77j42ddq7wgvZctRSxR8Dyq7De8SGYb"&gt;http://localhost:43110/19M77j42ddq7wgvZctRSxR8Dyq7De8SGYb&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think ZeroNet is the most conceptually different network I've looked at yet …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Over the last couple of weeks I've published this site as an &lt;a href="https://xo.tc/alternative-networks-for-this-site-i2p.html"&gt;I2P eepsite&lt;/a&gt;, and as a &lt;a href="https://xo.tc/alternative-networks-for-this-site-tor.html"&gt;Tor Hidden Service&lt;/a&gt;. This week I'm announcing Exotic Security is now available as a &lt;a href="https://zeronet.io/"&gt;ZeroNet&lt;/a&gt; site.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://localhost:43110/19M77j42ddq7wgvZctRSxR8Dyq7De8SGYb"&gt;http://localhost:43110/19M77j42ddq7wgvZctRSxR8Dyq7De8SGYb&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think ZeroNet is the most conceptually different network I've looked at yet. While all the other networks I've looked at have been the standard client server model, I think of ZeroNet more like a torrent file that contains a bunch of HTML pages. So you can get the files off a peer to peer network and when you view the site you're both the client and the server.&lt;/p&gt;
&lt;p&gt;ZeroNet is designed to be censorship resistant in the same way that torrents are, but also like torrents it's not designed for privacy.&lt;/p&gt;
&lt;p&gt;As far as I can tell there is no official way of running ZeroNet as a service. I understand that it's designed to be peer to peer so your site can still be served even if your host is offline, but I wanted to run it as a service so I know there is always at least one host seeding the latest version of my site.&lt;/p&gt;
&lt;p&gt;These are my notes on installing ZeroNet on Debian Jessie. All commands run as root (with sudo).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt-get install python-msgpack python-gevent
git clone https://github.com/HelloZeroNet/ZeroNet.git /opt/zeronet
useradd --system --shell /usr/sbin/nologin --home-dir /opt/zeronet zeronet
chown -R zeronet:zeronet /opt/zeronet/
vim /etc/systemd/system/zeronet.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;zeronet.service copied from &lt;a href="https://github.com/bloff/zeronet-installs/blob/master/Ubuntu%20Linux/install_zeronet.sh"&gt;Bruno Loff's Ubuntu Install&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Unit]&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Zeronet Server&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;syslog.target&lt;/span&gt;
&lt;span class="na"&gt;After&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;simple&lt;/span&gt;
&lt;span class="na"&gt;User&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;zeronet&lt;/span&gt;
&lt;span class="na"&gt;Group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;zeronet&lt;/span&gt;
&lt;span class="na"&gt;WorkingDirectory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/zeronet&lt;/span&gt;
&lt;span class="na"&gt;ExecStart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/python zeronet.py&lt;/span&gt;

&lt;span class="c1"&gt;# Give a reasonable amount of time for the server to start up/shut down&lt;/span&gt;
&lt;span class="na"&gt;TimeoutSec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;300&lt;/span&gt;

&lt;span class="k"&gt;[Install]&lt;/span&gt;
&lt;span class="na"&gt;WantedBy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;systemctl start zeronet.service
systemctl enable zeronet.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Getting a ZeroNet site up and running was pretty easy but I ran into some issues with my pelican site because I've been using root relative URLs but in ZeroNet my site is not running in the root of the server but instead under &lt;code&gt;/19M77j42ddq7wgvZctRSxR8Dyq7De8SGYb/&lt;/code&gt; so I had to go back and look at the &lt;a href="http://docs.getpelican.com/en/latest/content.html#linking-to-static-files"&gt;documentation&lt;/a&gt; and update all the internal links in all my posts. After about half an hour with find and replace, grep and some regex I was in back in business.&lt;/p&gt;</content><category term="Posts"></category><category term="Darknet"></category><category term="ZeroNet"></category><category term="Alternative Networks"></category><category term="Torrents"></category><category term="Peer to Peer"></category></entry><entry><title>Alternative Networks for this site - Tor</title><link href="https://xo.tc/alternative-networks-for-this-site-tor.html" rel="alternate"></link><published>2016-09-01T07:00:00+08:00</published><updated>2016-09-01T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-09-01:/alternative-networks-for-this-site-tor.html</id><summary type="html">&lt;p&gt;Last week I looked a few alternative censorship resistant networks and setup an &lt;a href="https://xo.tc/alternative-networks-for-this-site-i2p.html"&gt;I2P eepsite&lt;/a&gt;. This week I've made Exotic Security available as a &lt;a href="https://www.torproject.org/"&gt;Tor hidden service&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://exoticsecv6kd6fw.onion"&gt;http://exoticsecv6kd6fw.onion&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I like vanity domain names so first I downloaded &lt;a href="https://github.com/lachesis/scallion"&gt;Scallion&lt;/a&gt; and generated an onion address that started with 'exoticsec'.&lt;/p&gt;
&lt;p&gt;Scallion …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Last week I looked a few alternative censorship resistant networks and setup an &lt;a href="https://xo.tc/alternative-networks-for-this-site-i2p.html"&gt;I2P eepsite&lt;/a&gt;. This week I've made Exotic Security available as a &lt;a href="https://www.torproject.org/"&gt;Tor hidden service&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://exoticsecv6kd6fw.onion"&gt;http://exoticsecv6kd6fw.onion&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I like vanity domain names so first I downloaded &lt;a href="https://github.com/lachesis/scallion"&gt;Scallion&lt;/a&gt; and generated an onion address that started with 'exoticsec'.&lt;/p&gt;
&lt;p&gt;Scallion was very easy to use, just a simple git clone, xbuild and then&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mono scallion.exe -c exoticsec&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I was very impressed with how well it ran, my GPU a GeForce GTX 680 got 470 MH/s and found two names that matched in under 10 hours&lt;sup id="fnref:10-hours"&gt;&lt;a class="footnote-ref" href="#fn:10-hours"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;I then installed Tor following their &lt;a href="https://www.torproject.org/docs/debian.html.en"&gt;guide for Debian&lt;/a&gt; and set it to run automatically &lt;code&gt;sudo systemctl enable tor.service&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The I setup apache, I edited &lt;code&gt;/etc/apache2/ports.conf&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Tor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Hidden&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;service&lt;/span&gt;
#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Just&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;random&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;I&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;generated&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;there&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;no&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;significance&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;it&lt;/span&gt;.
&lt;span class="nv"&gt;Listen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;127&lt;/span&gt;.&lt;span class="mi"&gt;0&lt;/span&gt;.&lt;span class="mi"&gt;0&lt;/span&gt;.&lt;span class="mi"&gt;1&lt;/span&gt;:&lt;span class="mi"&gt;9625&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;my sites-enabled&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;#&lt;span class="w"&gt; &lt;/span&gt;Tor&lt;span class="w"&gt; &lt;/span&gt;Hidden&lt;span class="w"&gt; &lt;/span&gt;Service
&lt;span class="nt"&gt;&amp;lt;VirtualHost&lt;/span&gt; &lt;span class="err"&gt;127.0.0.1:9625&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;Host&lt;span class="w"&gt; &lt;/span&gt;settings
&lt;span class="w"&gt;    &lt;/span&gt;ServerName&lt;span class="w"&gt; &lt;/span&gt;exoticsecv6kd6fw.onion

&lt;span class="w"&gt;    &lt;/span&gt;ServerAdmin&lt;span class="w"&gt; &lt;/span&gt;webmaster@xo.tc
&lt;span class="w"&gt;    &lt;/span&gt;DocumentRoot&lt;span class="w"&gt; &lt;/span&gt;/var/www/tor-hidden-service
&lt;span class="w"&gt;    &lt;/span&gt;ErrorDocument&lt;span class="w"&gt; &lt;/span&gt;404&lt;span class="w"&gt; &lt;/span&gt;/pages/404-not-found.html

&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;Available&lt;span class="w"&gt; &lt;/span&gt;loglevels:&lt;span class="w"&gt; &lt;/span&gt;trace8,&lt;span class="w"&gt; &lt;/span&gt;...,&lt;span class="w"&gt; &lt;/span&gt;trace1,&lt;span class="w"&gt; &lt;/span&gt;debug,&lt;span class="w"&gt; &lt;/span&gt;info,&lt;span class="w"&gt; &lt;/span&gt;notice,&lt;span class="w"&gt; &lt;/span&gt;warn,
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;error,&lt;span class="w"&gt; &lt;/span&gt;crit,&lt;span class="w"&gt; &lt;/span&gt;alert,&lt;span class="w"&gt; &lt;/span&gt;emerg.
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;It&lt;span class="w"&gt; &lt;/span&gt;is&lt;span class="w"&gt; &lt;/span&gt;also&lt;span class="w"&gt; &lt;/span&gt;possible&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;configure&lt;span class="w"&gt; &lt;/span&gt;the&lt;span class="w"&gt; &lt;/span&gt;loglevel&lt;span class="w"&gt; &lt;/span&gt;for&lt;span class="w"&gt; &lt;/span&gt;particular
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;modules,&lt;span class="w"&gt; &lt;/span&gt;e.g.
&lt;span class="w"&gt;    &lt;/span&gt;#LogLevel&lt;span class="w"&gt; &lt;/span&gt;info&lt;span class="w"&gt; &lt;/span&gt;ssl:warn

&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;As&lt;span class="w"&gt; &lt;/span&gt;we&lt;span class="w"&gt; &lt;/span&gt;are&lt;span class="w"&gt; &lt;/span&gt;hosting&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;localhost,&lt;span class="w"&gt; &lt;/span&gt;by&lt;span class="w"&gt; &lt;/span&gt;default&lt;span class="w"&gt; &lt;/span&gt;the&lt;span class="w"&gt; &lt;/span&gt;server-status&lt;span class="w"&gt; &lt;/span&gt;and
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;server-info&lt;span class="w"&gt; &lt;/span&gt;pages&lt;span class="w"&gt; &lt;/span&gt;are&lt;span class="w"&gt; &lt;/span&gt;avalible.
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/server-status&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;Order&lt;span class="w"&gt; &lt;/span&gt;allow,deny
&lt;span class="w"&gt;        &lt;/span&gt;Deny&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;all
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/server-info&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;Order&lt;span class="w"&gt; &lt;/span&gt;allow,deny
&lt;span class="w"&gt;        &lt;/span&gt;Deny&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;all
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;


&lt;span class="w"&gt;    &lt;/span&gt;ErrorLog&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;/error.log
&lt;span class="w"&gt;    &lt;/span&gt;CustomLog&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;/access.log&lt;span class="w"&gt; &lt;/span&gt;combined
&lt;span class="nt"&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then I edited &lt;code&gt;/etc/tor/torrc&lt;/code&gt; and uncommented the two lines to enable a hidden service&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;HiddenServiceDir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tor&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;hidden_service&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;span class="n"&gt;HiddenServicePort&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;127.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;9625&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Restarted tor to create the HiddenServiceDir&lt;/p&gt;
&lt;p&gt;&lt;code&gt;systemctl restart tor.service&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Then I replaced &lt;code&gt;/var/lib/tor/hidden_service/private_key&lt;/code&gt; with the key I'd generate with Scallion and I was done.&lt;/p&gt;
&lt;p&gt;I was surprised how easy it was to get up and running. Admittedly it might have been a bit more involved if I'd been trying to hide my identity, I probably would have used &lt;a href="https://www.whonix.org/"&gt;Whonix&lt;/a&gt; as the host instead but even so it was very easy to get up and going.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:10-hours"&gt;
&lt;p&gt;Although I'm pretty sure that was mostly luck, the predicted time for one hash that matched was a little over 10 hours.&amp;#160;&lt;a class="footnote-backref" href="#fnref:10-hours" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Darknet"></category><category term="Tor"></category><category term="Apache"></category><category term="Alternative Networks"></category></entry><entry><title>Alternative Networks for this site - I2P</title><link href="https://xo.tc/alternative-networks-for-this-site-i2p.html" rel="alternate"></link><published>2016-08-25T07:00:00+08:00</published><updated>2016-08-25T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-08-25:/alternative-networks-for-this-site-i2p.html</id><summary type="html">&lt;p&gt;I've been very interested in all the different censorship resistant that seem to have sprung up over the last few years so I thought I'd have a look at hosting this site on them. It seems like the ideal site to try them out with because I use &lt;a href="http://blog.getpelican.com/"&gt;pelican&lt;/a&gt; to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've been very interested in all the different censorship resistant that seem to have sprung up over the last few years so I thought I'd have a look at hosting this site on them. It seems like the ideal site to try them out with because I use &lt;a href="http://blog.getpelican.com/"&gt;pelican&lt;/a&gt; to generate static html files and they should be fairly easy to host anywhere.&lt;/p&gt;
&lt;p&gt;The some of the networks I've looked at recently are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.torproject.org/"&gt;Tor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://geti2p.net/en/"&gt;I2P&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://zeronet.io/"&gt;ZeroNet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://people.csail.mit.edu/devadas/pubs/riffle.pdf"&gt;Riffle&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;and this week I've started running Exotic Security as an I2P eepsite&lt;sup id="fnref:eepsite"&gt;&lt;a class="footnote-ref" href="#fn:eepsite"&gt;1&lt;/a&gt;&lt;/sup&gt; it's now available at:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://xotc.i2p"&gt;http://xotc.i2p&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gqgvzum3xdgtaahkjfw3layb33vjrucmw5btyhrppm463cz3c5oq.b32.i2p/"&gt;http://gqgvzum3xdgtaahkjfw3layb33vjrucmw5btyhrppm463cz3c5oq.b32.i2p/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I've used I2P for a while now and it's fairly similar to its more popular cousin Tor although there are a few &lt;a href="https://geti2p.net/en/comparison/tor"&gt;notable diffrences&lt;/a&gt;. The ones that stand out for me are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I2P was designed was a global passive adversary in mind. Someone who can watch the whole network, every packet that goes in and every packet that comes out. So it uses tricks like constantly sending some amount of traffic, whether you're using it or not to thwart traffic flow analysis.&lt;/li&gt;
&lt;li&gt;Unlike Tor who ask you not to torrent over their network I2P actually encourages torrents and has a a built in torrent engine called snark.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Setting up an eepsite was fairly easy. I installed I2P simply following their &lt;a href="https://geti2p.net/en/download/debian#debian"&gt;debian install guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I decided to go with a site run by Apache and use I2P as a reverse proxy rather than use the built in web server.&lt;/p&gt;
&lt;p&gt;I edited the ports that apache listens on &lt;code&gt;vim /etc/apache2/ports.conf&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# I2P eepsite
Listen 127.0.0.1:7658
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and added an entry in &lt;code&gt;/etc/apache2/sites-enabled/000-default.conf&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;VirtualHost&lt;/span&gt; &lt;span class="err"&gt;127.0.0.1:7658&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;Host&lt;span class="w"&gt; &lt;/span&gt;settings
&lt;span class="w"&gt;    &lt;/span&gt;ServerName&lt;span class="w"&gt; &lt;/span&gt;xotc.i2p

&lt;span class="w"&gt;    &lt;/span&gt;ServerAdmin&lt;span class="w"&gt; &lt;/span&gt;webmaster@xo.tc
&lt;span class="w"&gt;    &lt;/span&gt;DocumentRoot&lt;span class="w"&gt; &lt;/span&gt;/var/www/eepsite
&lt;span class="w"&gt;    &lt;/span&gt;ErrorDocument&lt;span class="w"&gt; &lt;/span&gt;404&lt;span class="w"&gt; &lt;/span&gt;/pages/404-not-found.html

&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;Available&lt;span class="w"&gt; &lt;/span&gt;loglevels:&lt;span class="w"&gt; &lt;/span&gt;trace8,&lt;span class="w"&gt; &lt;/span&gt;...,&lt;span class="w"&gt; &lt;/span&gt;trace1,&lt;span class="w"&gt; &lt;/span&gt;debug,&lt;span class="w"&gt; &lt;/span&gt;info,&lt;span class="w"&gt; &lt;/span&gt;notice,&lt;span class="w"&gt; &lt;/span&gt;warn,
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;error,&lt;span class="w"&gt; &lt;/span&gt;crit,&lt;span class="w"&gt; &lt;/span&gt;alert,&lt;span class="w"&gt; &lt;/span&gt;emerg.
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;It&lt;span class="w"&gt; &lt;/span&gt;is&lt;span class="w"&gt; &lt;/span&gt;also&lt;span class="w"&gt; &lt;/span&gt;possible&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;configure&lt;span class="w"&gt; &lt;/span&gt;the&lt;span class="w"&gt; &lt;/span&gt;loglevel&lt;span class="w"&gt; &lt;/span&gt;for&lt;span class="w"&gt; &lt;/span&gt;particular
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;modules,&lt;span class="w"&gt; &lt;/span&gt;e.g.
&lt;span class="w"&gt;    &lt;/span&gt;#LogLevel&lt;span class="w"&gt; &lt;/span&gt;info&lt;span class="w"&gt; &lt;/span&gt;ssl:warn

&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;As&lt;span class="w"&gt; &lt;/span&gt;we&lt;span class="w"&gt; &lt;/span&gt;are&lt;span class="w"&gt; &lt;/span&gt;hosting&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;localhost,&lt;span class="w"&gt; &lt;/span&gt;by&lt;span class="w"&gt; &lt;/span&gt;default&lt;span class="w"&gt; &lt;/span&gt;the&lt;span class="w"&gt; &lt;/span&gt;server-status&lt;span class="w"&gt; &lt;/span&gt;and
&lt;span class="w"&gt;    &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;server-info&lt;span class="w"&gt; &lt;/span&gt;pages&lt;span class="w"&gt; &lt;/span&gt;are&lt;span class="w"&gt; &lt;/span&gt;avalible.
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/server-status&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;Order&lt;span class="w"&gt; &lt;/span&gt;allow,deny
&lt;span class="w"&gt;        &lt;/span&gt;Deny&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;all
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/server-info&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;Order&lt;span class="w"&gt; &lt;/span&gt;allow,deny
&lt;span class="w"&gt;        &lt;/span&gt;Deny&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;all
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;ErrorLog&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;/error.log
&lt;span class="w"&gt;    &lt;/span&gt;CustomLog&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cp"&gt;${&lt;/span&gt;&lt;span class="n"&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class="cp"&gt;}&lt;/span&gt;/access.log&lt;span class="w"&gt; &lt;/span&gt;combined
&lt;span class="nt"&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and in the router console under I2P internals &amp;gt; Hidden Service Manager I enabled the website.&lt;/p&gt;
&lt;p&gt;I could have simply pointed I2P at the site already running on port 443 but Pelican uses absolute links, also I &lt;a href="https://xo.tc/using-piwik-analytics.html"&gt;use&lt;/a&gt; &lt;a href="https://piwik.org/"&gt;Piwik analytics&lt;/a&gt; which again points to a clear net site. So instead I've used pelican to generate a new site with the relative links and no analytics.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:eepsite"&gt;
&lt;p&gt;I have a feeling I saw somewhere that I2P were looking at moving away from the name 'eepsite' and moving to calling them 'Hidden Services' like Tor does, but now I can't find that anywhere so I'm sticking with eepsite.&amp;#160;&lt;a class="footnote-backref" href="#fnref:eepsite" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Darknet"></category><category term="Alternative Networks"></category><category term="Tor"></category><category term="I2P"></category><category term="ZeroNet"></category><category term="Riffle"></category><category term="Apache"></category></entry><entry><title>Fingerprint readers on phones</title><link href="https://xo.tc/fingerprint-readers-on-phones.html" rel="alternate"></link><published>2016-08-18T07:00:00+08:00</published><updated>2016-08-18T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-08-18:/fingerprint-readers-on-phones.html</id><summary type="html">&lt;p&gt;I can clearly remember my first reaction when I heard about fingerprint readers on phones. It was a stream of thoughts along the lines of "I bet that will be broken in an matter of days, biometrics are not ready for prime time", "You don't go around leaving a smudgy …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I can clearly remember my first reaction when I heard about fingerprint readers on phones. It was a stream of thoughts along the lines of "I bet that will be broken in an matter of days, biometrics are not ready for prime time", "You don't go around leaving a smudgy copy of your password on every glass you hold" and "You can change your password but good luck resetting your fingerprint after that gets compromised."&lt;/p&gt;
&lt;p&gt;But I was falling into a trap that's all to common in information security&lt;sup id="fnref:security"&gt;&lt;a class="footnote-ref" href="#fn:security"&gt;1&lt;/a&gt;&lt;/sup&gt; of rejecting an idea because it isn't perfect. When the question that I &lt;a href="https://xo.tc/perfectly-good.html"&gt;should have been asking&lt;/a&gt; isn't "Is it flawless?" but "Is it better than what we currently have?".&lt;/p&gt;
&lt;p&gt;Shortly after my initial reaction I started thinking a little more deeply about the idea and I could think of a number of friends and family that didn't even use a pin on their phone because it was too much effort to unlock every time. I decided that if a fingerprint reader was significantly more &lt;a href="https://xo.tc/avids-rule-of-usability.html"&gt;convenient&lt;/a&gt; and if that was enough to get people to lock their phone then it would be a net win for security.&lt;/p&gt;
&lt;p&gt;I recently bought a &lt;a href="https://store.google.com/product/nexus_6p"&gt;Nexus 6P&lt;/a&gt; and installed &lt;a href="https://wiki.cyanogenmod.org/w/Angler_Info"&gt;CyanogenMod&lt;/a&gt;. Now that I've got a fingerprint reader I think it's just brilliant. Previously I used a pattern to lock my screen and for my encryption key because it was quick and easy. Now I use a 16 character password&lt;sup id="fnref:16-character-password"&gt;&lt;a class="footnote-ref" href="#fn:16-character-password"&gt;2&lt;/a&gt;&lt;/sup&gt; which is hard to type for the lock screen and encryption key. Then when I want to unlock it for every day use I just use my fingerprint.&lt;/p&gt;
&lt;p&gt;I still need to enter my password to decrypt my phone if I reboot it. And every three days it &lt;a href="https://github.com/android/platform_frameworks_base/blob/25b4d4b280c6aa07656328bd9dd90977781d00e1/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java#L136-L140"&gt;times out&lt;/a&gt; but because I don't have to enter it every single time I unlock it, it's not too much of a hassle so I don't mind having a longer and more secure password.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:security"&gt;
&lt;p&gt;It's not just an issue in InfoSec, comes up in all areas of life.&amp;#160;&lt;a class="footnote-backref" href="#fnref:security" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:16-character-password"&gt;
&lt;p&gt;I'd like to use a longer passphrase but unfortunately &lt;a href="https://github.com/android/platform_packages_apps_settings/commit/70d5c3a0139899e5f4d425c8ab2d68f0dfc5c6da"&gt;16 character&lt;/a&gt; is the &lt;a href="https://code.google.com/p/android/issues/detail?id=52314"&gt;limit&lt;/a&gt; for now.&amp;#160;&lt;a class="footnote-backref" href="#fnref:16-character-password" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Android"></category><category term="Passwords"></category><category term="Biometrics"></category><category term="CyanogenMod"></category><category term="Usability"></category></entry><entry><title>How often should you change your password?</title><link href="https://xo.tc/how-often-should-you-change-your-password.html" rel="alternate"></link><published>2016-08-11T07:00:00+08:00</published><updated>2016-08-11T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-08-11:/how-often-should-you-change-your-password.html</id><summary type="html">&lt;p&gt;There was an &lt;a href="http://arstechnica.com/security/2016/08/frequent-password-changes-are-the-enemy-of-security-ftc-technologist-says/"&gt;article&lt;/a&gt; recently based on a &lt;a href="https://www.cs.unc.edu/~reiter/papers/2010/CCS.pdf"&gt;2010 study&lt;/a&gt; that suggested that frequent password changes actually negatively impact security.&lt;/p&gt;
&lt;p&gt;I agree with the article but feel that some of the commentary could be a little more nuanced. The thrust of the article is that forcing regular password changes &lt;a href="https://xo.tc/avids-rule-of-usability.html"&gt;irritates …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;There was an &lt;a href="http://arstechnica.com/security/2016/08/frequent-password-changes-are-the-enemy-of-security-ftc-technologist-says/"&gt;article&lt;/a&gt; recently based on a &lt;a href="https://www.cs.unc.edu/~reiter/papers/2010/CCS.pdf"&gt;2010 study&lt;/a&gt; that suggested that frequent password changes actually negatively impact security.&lt;/p&gt;
&lt;p&gt;I agree with the article but feel that some of the commentary could be a little more nuanced. The thrust of the article is that forcing regular password changes &lt;a href="https://xo.tc/avids-rule-of-usability.html"&gt;irritates users&lt;/a&gt; and they turn to patterns like adding a number on the end and just incrementing it. I've seen my share of users who will happily announce to the world that their password is 'August2016' without being asked.&lt;/p&gt;
&lt;p&gt;If MySpace forced passwords to expire every 30 days and you found 'March2008' in the recent &lt;a href="https://haveibeenpwned.com/PwnedWebsites#MySpace"&gt;MySpace&lt;/a&gt; breach, it wouldn't take a genius to work out what was next.&lt;/p&gt;
&lt;p&gt;On the other hand, occasional password changes do have their place. Should MySpace wait until there is public evidence of a breach to force a reset? What about other organisations like &lt;a href="http://krebsonsecurity.com/2016/06/password-re-user-get-to-get-busy/"&gt;Facebook and Netflix&lt;/a&gt; who reset passwords of users because they had reused passwords their MySpace password? There are a lot of ifs here;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If MySpace had used a secure hash like &lt;a href="https://en.wikipedia.org/wiki/PBKDF2"&gt;PBKDF2&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/Bcrypt"&gt;bcrypt&lt;/a&gt; then all but the weakest of passwords would be secure and;&lt;/li&gt;
&lt;li&gt;If users picked passwords with a significant amount of entropy they wouldn't be cracked even if MySpace just used md5 and;&lt;/li&gt;
&lt;li&gt;If users didn't reuse passwords across sites it wouldn't be an issue for other site anyway and;&lt;/li&gt;
&lt;li&gt;If ...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our natural response as security professionals is to try to &lt;em&gt;force&lt;/em&gt; people to use good password hygiene so we resort to things like password expiry dates and complexity requirements that actually restrict the number of available passwords.&lt;/p&gt;
&lt;p&gt;We should look at ways to &lt;em&gt;encourage&lt;/em&gt; good password hygiene, sign up forms can offer the option to generate a password&lt;sup id="fnref:generate"&gt;&lt;a class="footnote-ref" href="#fn:generate"&gt;1&lt;/a&gt;&lt;/sup&gt; and a button to copy it into the clipboard so users can use a password manager. Maybe organisations should include tools like &lt;a href="http://keepass.info/"&gt;KeePass&lt;/a&gt; as part of the standard operating environment and make them available on all desktops.&lt;/p&gt;
&lt;p&gt;In the future we need to move to things like two factor authentication with a &lt;a href="https://www.nitrokey.com/"&gt;hardware&lt;/a&gt; &lt;a href="https://www.yubico.com/"&gt;device&lt;/a&gt; and reduce our reliance on passwords.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:generate"&gt;
&lt;p&gt;My preferred method of generating passwords is &lt;code&gt;dd if=/dev/random bs=1 count=18 2&amp;gt;/dev/null | base64&lt;/code&gt;. I haven't looked into this at all, but I'm sure there would be a secure way to do the equivalent of that in client side JavaScript.&amp;#160;&lt;a class="footnote-backref" href="#fnref:generate" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Passwords"></category><category term="Password Manager"></category><category term="Usability"></category></entry><entry><title>Kerckhoffs's principle</title><link href="https://xo.tc/kerckhoffss-principle.html" rel="alternate"></link><published>2016-08-04T07:00:00+08:00</published><updated>2016-08-04T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-08-04:/kerckhoffss-principle.html</id><summary type="html">&lt;p&gt;One of the security tenants that I live by is &lt;a href="https://en.wikipedia.org/wiki/Kerckhoffs%27s_principle"&gt;Kerckhoffs's principle&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A cryptosystem should be secure even if everything about the system, except the key, is public knowledge.&lt;/p&gt;
&lt;p&gt;-- Auguste Kerckhoffs, 1883&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It's beautiful in it's simplicity and yet counter intuitive.&lt;/p&gt;
&lt;p&gt;It's a beguiling myth that if you want to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One of the security tenants that I live by is &lt;a href="https://en.wikipedia.org/wiki/Kerckhoffs%27s_principle"&gt;Kerckhoffs's principle&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A cryptosystem should be secure even if everything about the system, except the key, is public knowledge.&lt;/p&gt;
&lt;p&gt;-- Auguste Kerckhoffs, 1883&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It's beautiful in it's simplicity and yet counter intuitive.&lt;/p&gt;
&lt;p&gt;It's a beguiling myth that if you want to make a system secure you should make it secret. Hundreds of years of experience have thought us that for a system to be truly robust it needs to be open and auditable.&lt;/p&gt;
&lt;p&gt;Kerckhoffs's principle is applicable to so much more than just cryptography. I think it needs to be much broader, and apply to any system designed to provide security.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A security system should be secure even if everything about the system, except the key, is public knowledge.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I recently spent a little time looking at physical security controls, things like security cameras and digital locks (RFID cards). It makes my blood boil when I see how much vendors try to restrict information and refuse to publish even a basic manual.&lt;/p&gt;
&lt;p&gt;Especially as often once someone takes a good look their products turn out to be &lt;a href="http://demoseen.com/bhpaper.html"&gt;riddled&lt;/a&gt; &lt;a href="http://arstechnica.com/security/2016/01/how-to-search-the-internet-of-things-for-photos-of-sleeping-babies/"&gt;with&lt;/a&gt; &lt;a href="https://en.wikipedia.org/wiki/MIFARE#Security_of_MIFARE_Classic.2C_MIFARE_DESFire_and_MIFARE_Ultralight"&gt;vulnerabilities&lt;/a&gt;. Then rather than fix the vulnerabilities vendors try to use things like the Digital Millennium Copyright Act (DMCA) to &lt;a href="http://blog.cryptographyengineering.com/2016/07/statement-on-dmca-lawsuit.html"&gt;silence security researchers&lt;/a&gt; and prevent the information spreading.&lt;/p&gt;</content><category term="Posts"></category><category term="Philosophy"></category><category term="Kerckhoffs's principle"></category><category term="Security through obscurity"></category><category term="Cryptography"></category><category term="Open source"></category><category term="Security"></category></entry><entry><title>Updating UEFI BIOS on Lenovo ThinkPad X220</title><link href="https://xo.tc/updating-uefi-bios-on-lenovo-thinkpad-x220.html" rel="alternate"></link><published>2016-07-28T07:00:00+08:00</published><updated>2016-07-28T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-07-28:/updating-uefi-bios-on-lenovo-thinkpad-x220.html</id><summary type="html">&lt;p&gt;I've got a ThinkPad X220 and I've been a bit lax about patching the UEFI/BIOS. But recently this &lt;a href="https://support.lenovo.com/au/en/product_security/smm_attack"&gt;SMM "Incursion" Attack&lt;/a&gt; has been getting a bit of publicity and it's spurred me to try to patch it. It's worth noting that this bug is not specific to Lenovo, but …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've got a ThinkPad X220 and I've been a bit lax about patching the UEFI/BIOS. But recently this &lt;a href="https://support.lenovo.com/au/en/product_security/smm_attack"&gt;SMM "Incursion" Attack&lt;/a&gt; has been getting a bit of publicity and it's spurred me to try to patch it. It's worth noting that this bug is not specific to Lenovo, but something that affects most vendors of Intel based hardware. For those interested some of the best coverage I've found was from a recent &lt;a href="http://risky.biz/RB417"&gt;risky business&lt;/a&gt; podcast&lt;sup id="fnref:podcast"&gt;&lt;a class="footnote-ref" href="#fn:podcast"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Unfortunately Lenovo don't provide a way to upgrade the BIOS from Linux. While the ThinkPad X220 is officially supported with Linux (RedHat and Fedora) the only BIOS update utility they provide is for Windows.&lt;/p&gt;
&lt;p&gt;I went on to the &lt;a href="http://support.lenovo.com/au/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x220/"&gt;Lenovo support site&lt;/a&gt; and for the BIOS update, under Operating system I picked "Not Applicable" a few patches BIOS and Firmware patches came up but all of them were .exe files.&lt;/p&gt;
&lt;p&gt;After a long time of searching I found that they do provide a .iso file of a bootable CD to patch your BIOS but you have to pick Windows as the operating system to find it. I have no idea why they think that .exe files are "Not Applicable" but an iso is a Windows specific option but maybe they didn't put much thought into it.&lt;/p&gt;
&lt;p&gt;Now that I had an iso I was half way there, but the ThinkPad X series don't have an optical drive and simply dd'ing the image onto a flash drive didn't work.&lt;/p&gt;
&lt;p&gt;I found some instructions on &lt;a href="http://www.thinkwiki.org/wiki/BIOS_Upgrade#Using_UEFI"&gt;ThinkWiki&lt;/a&gt; with a link to a &lt;a href="https://userpages.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/"&gt;perl script&lt;/a&gt; that could create a bootable image.&lt;/p&gt;
&lt;p&gt;I copied the image onto a flash drive but when I tried to boot it failed, after a bit of experimentation I found that the instructions on ThinkWiki were not quite right, they recommended setting the boot to UEFI only but I found that I needed to use Legacy BIOS to boot the flash drive.&lt;/p&gt;
&lt;p&gt;After that I was able to boot the drive and update my BIOS.&lt;/p&gt;
&lt;h2 id="final-steps"&gt;Final steps&lt;/h2&gt;
&lt;p&gt;So in summary the steps that finally worked were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download the &lt;a href="http://support.lenovo.com/au/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x220/downloads/DS018807"&gt;iso file.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Convert the iso file to a bootable image.&lt;ol&gt;
&lt;li&gt;&lt;code&gt;wget https://userpages.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito.pl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;perl geteltorito.pl -o ThinkPad-x220-bios-update.img 8duj27us.iso&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Copy the image onto a flash drive&lt;ol&gt;
&lt;li&gt;Check the name of your flash drive first! &lt;code&gt;dd if=ThinkPad-x220-bios-update.img of=/dev/sdb&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Set boot to "Both" Legacy and UEFI&lt;ol&gt;
&lt;li&gt;Reboot, pressing F1 while booting to enter setup&lt;/li&gt;
&lt;li&gt;Go to Setup &amp;gt; UEFI/Legacy Boot &amp;gt; Both&lt;/li&gt;
&lt;li&gt;F10 to save and exit&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Boot the flash drive&lt;ol&gt;
&lt;li&gt;Press F12 while booting to and select your flash drive.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Follow the prompts to upgrade your UEFI/BIOS and your done.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:podcast"&gt;
&lt;p&gt;Risky Business #417 from 14:20 to 18:00&amp;#160;&lt;a class="footnote-backref" href="#fnref:podcast" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="UEFI"></category><category term="ThinkPad"></category><category term="Firmware"></category><category term="Linux"></category></entry><entry><title>Setting Up Full Disk Encryption on Arch Linux</title><link href="https://xo.tc/setting-up-full-disk-encryption-on-arch-linux.html" rel="alternate"></link><published>2016-07-21T07:00:00+08:00</published><updated>2016-07-21T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-07-21:/setting-up-full-disk-encryption-on-arch-linux.html</id><summary type="html">&lt;p&gt;I recently switched my laptop over from &lt;a href="https://wiki.debian.org/DebianStretch"&gt;Debian Stretch&lt;/a&gt; to &lt;a href="https://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Debian is still my go to distribution for any server, but I felt like I was in a bit of a no man's land with my laptop. Debian stable (currently Jessie) is rock solid and reliable but I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently switched my laptop over from &lt;a href="https://wiki.debian.org/DebianStretch"&gt;Debian Stretch&lt;/a&gt; to &lt;a href="https://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Debian is still my go to distribution for any server, but I felt like I was in a bit of a no man's land with my laptop. Debian stable (currently Jessie) is rock solid and reliable but I want to install new packages, like the latest version of Firefox. Debian testing and unstable (Stretch and Sid) are well ... unstable, and you really can't complain when things break&lt;sup id="fnref:complain"&gt;&lt;a class="footnote-ref" href="#fn:complain"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;I've been using Arch Linux on my desktop for a while and for a bleeding edge distribution it's surprisingly stable&lt;sup id="fnref:surprisingly-stable"&gt;&lt;a class="footnote-ref" href="#fn:surprisingly-stable"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;These my notes on &lt;a href="https://wiki.archlinux.org/index.php/Installation_guide"&gt;installing Arch Linux&lt;/a&gt; on my laptop with Full Disk Encryption. As I noted in my post on &lt;a href="https://xo.tc/setting-up-full-disk-encryption-on-debian-jessie.html"&gt;Setting Up Full Disk Encryption on Debian Jessie&lt;/a&gt; it's not really "Full" disk encryption, there is still a small partition &lt;code&gt;/boot&lt;/code&gt; that's unencrypted and will contain the kernel and &lt;a href="https://en.wikipedia.org/wiki/Initramfs"&gt;initramfs&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="download"&gt;Download&lt;/h2&gt;
&lt;p&gt;First I &lt;a href="https://www.archlinux.org/download/"&gt;downloaded&lt;/a&gt; the latest Arch Linux iso, verified it, and copied it to a USB flash drive.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;gpg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nv"&gt;recv&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;keys&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;x7f2d434b9741e8ac&lt;/span&gt;
&lt;span class="nv"&gt;gpg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nv"&gt;verify&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;archlinux&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2016&lt;/span&gt;.&lt;span class="mi"&gt;07&lt;/span&gt;.&lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;dual&lt;/span&gt;.&lt;span class="nv"&gt;iso&lt;/span&gt;.&lt;span class="nv"&gt;sig&lt;/span&gt;
&lt;span class="nv"&gt;dd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;archlinux&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2016&lt;/span&gt;.&lt;span class="mi"&gt;07&lt;/span&gt;.&lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;dual&lt;/span&gt;.&lt;span class="nv"&gt;iso&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="nv"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;sdb&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="install"&gt;Install&lt;/h2&gt;
&lt;p&gt;Then I booted the USB drive and, updated the time, because that's what it says in the documentation and it's a good idea.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;timedatectl set-ntp true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I created 3 partitions on my hard drive an 80GB SSD:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;512MB FAT32 partition to boot from.&lt;/li&gt;
&lt;li&gt;A big partition to be used as the root.&lt;/li&gt;
&lt;li&gt;A 4GB partition for swap space.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;parted /dev/sda
 &amp;gt; mklabel gpt
 &amp;gt; mkpart ESP fat32 1MiB 513MiB
 &amp;gt; set 1 boot on
 &amp;gt; mkpart primary 513MiB -4G
 &amp;gt; mkpart primary 76GB 100%
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I setup a LUKs volume on the second partition, formated it to btrfs then mounted it to &lt;code&gt;/mnt/&lt;/code&gt; and mounted the FAT32 volume to &lt;code&gt;/mnt/boot&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cryptsetup luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 arch_root

mkfs.btrfs /dev/mapper/arch_root

mount /dev/mapper/arch_root /mtn/
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I updated the mirrors list and installed Arch Linux following the install guide and installed vim&lt;sup id="fnref:vim"&gt;&lt;a class="footnote-ref" href="#fn:vim"&gt;3&lt;/a&gt;&lt;/sup&gt; and added a host name.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;vim /etc/pacman.d/mirrorlist

pacstrap /mnt base

genfstab -p /mnt &amp;gt;&amp;gt; /mnt/etc/fstab

arch-chroot /mnt

ln -s /usr/share/zoneinfo/Australia/Perth /etc/localtime

nano /etc/locale.gen

locale-gen

nano /etc/locale.conf
&lt;span class="gh"&gt;#&lt;/span&gt; LANG=en_AU.UTF-8

pacman -S vim

vim /etc/hostname
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I edited &lt;code&gt;/etc/mkinitcpio.conf&lt;/code&gt; to add &lt;code&gt;encrypt&lt;/code&gt; after &lt;code&gt;udev&lt;/code&gt; on line 51 and then created my initramfs&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;vim /etc/mkinitcpio.conf
# HOOKS=&amp;quot;base udev encrypt autodetect modconf block filesystems keyboard fsck&amp;quot;
mkinitcpio -p linux
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next I used &lt;a href="https://wiki.archlinux.org/index.php/EFISTUB#efibootmgr"&gt;efibootmgr&lt;/a&gt; to add an entry into my EFI boot options to boot the Linux kernel directly rather than using a boot loader like GRUB which then boots the kernel.&lt;/p&gt;
&lt;p&gt;I think this is an extremely elegant solution as it means I end up with only 3 files in my &lt;code&gt;/boot/&lt;/code&gt; volume: The kernel, The initramfs, and a fallback initramfs (which isn't really necessary). It's much neater than a bunch of GRUB scripts and config files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pacman -S efibootmgr

efibootmgr -d /dev/sda -p 1 -c -L &amp;quot;Arch Linux&amp;quot; -l /vmlinuz-linux -u &amp;quot;cryptdevice=/dev/sda2:arch_root root=/dev/mapper/archroot rw initrd=/initramfs-linux.img&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next I added a user and setup sudo so they could become root.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;useradd michael --create-home --groups wheel
passwd michael

pacman -S sudo
visudo
# Uncomment line 82. %wheel ALL=(ALL) ALL
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Lastly I setup my swap partition to be a LUKs volume with a random key.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;vim /etc/crypttab
&lt;span class="gh"&gt;#&lt;/span&gt; arch_swap /dev/sda3 /dev/urandom swap

vim /etc/fstab
&lt;span class="gh"&gt;#&lt;/span&gt; /dev/mapper/arch_swap none swap sw 0 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I exited the chroot and rebooted.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;exit&lt;/span&gt;
&lt;span class="nv"&gt;reboot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="post-install"&gt;Post install&lt;/h2&gt;
&lt;p&gt;I installed KDE because that's my desktop of choice but the lovely thing about Arch Linux is you can make it almost anything you want.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# Logged in as Michael, but run as root
dhcpcd enp0s25

pacman -S xorg-server
pacman -S plasma-meta
pacman -S kde-applications-meta
pacann -S sddm

systemctl enable sddm.service
systemctl enable NetworkManager.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Added the track pad driver&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pacman -S xf86-input-synaptics
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Set time to NTP, I would have though this would be done automatically because I'd synced the time when I started the installer, but apparently not.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;timedatectl set-ntp true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And set the KDE Wallet to &lt;a href="https://wiki.archlinux.org/index.php/KDE_Wallet#Unlock_KDE_Wallet_automatically_on_login"&gt;automatically unlock&lt;/a&gt; with my user password. This is a slight trade off in security because with the default setup I could have two different passwords, or I could login but choose not to unlock the wallet. But in this case I've decided to go with it because it's much more convenient and secure enough.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo pacman -S kwallet-pam

vim /etc/pam.d/sddm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;My sddm file&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt;%PAM-1.0

auth            include         system-login
auth            optional        pam_kwallet5.so
auth            optional        pam_kwallet.so kdehome=.kde4

account         include         system-login

password        include         system-login

session         include         system-login
session         optional        pam_kwallet5.so
session         optional        pam_kwallet.so
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:complain"&gt;
&lt;p&gt;You can't complain but you can file bug reports, which is helpful to the Debian maintainers.&amp;#160;&lt;a class="footnote-backref" href="#fnref:complain" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:surprisingly-stable"&gt;
&lt;p&gt;Things still break in new and interesting ways on Arch Linux, just less often than I would expect for the rate of package churn.&amp;#160;&lt;a class="footnote-backref" href="#fnref:surprisingly-stable" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:vim"&gt;
&lt;p&gt;Vim is included in the installer .iso file, so you can use it while your installing, but it's not part of the base packages so once you run &lt;code&gt;arch-chroot&lt;/code&gt; you can't use it until you install it &lt;code&gt;pacman -S vim&lt;/code&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:vim" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="Arch Linux"></category><category term="Debian"></category><category term="Full Disk Encryption"></category><category term="UEFI"></category><category term="LUKS"></category></entry><entry><title>StartSSL launches StartEncrypt</title><link href="https://xo.tc/startssl-launches-startencrypt.html" rel="alternate"></link><published>2016-07-14T07:00:00+08:00</published><updated>2016-07-14T07:00:00+08:00</updated><author><name>Michael Van Delft</name></author><id>tag:xo.tc,2016-07-14:/startssl-launches-startencrypt.html</id><summary type="html">&lt;p&gt;Let's Encrypt has been shaking things up in the Certification Authority world. Let's Encrypt certificates are free, automated and easy to install. They have been gaining market share like crazy. Some CA's have reacted to their loss of market share in &lt;a href="https://letsencrypt.org/2016/06/23/defending-our-brand.html"&gt;interesting ways&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let's Encrypt are not &lt;a href="https://xo.tc/perfectly-good.html"&gt;perfict, but they …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;Let's Encrypt has been shaking things up in the Certification Authority world. Let's Encrypt certificates are free, automated and easy to install. They have been gaining market share like crazy. Some CA's have reacted to their loss of market share in &lt;a href="https://letsencrypt.org/2016/06/23/defending-our-brand.html"&gt;interesting ways&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let's Encrypt are not &lt;a href="https://xo.tc/perfectly-good.html"&gt;perfict, but they are good&lt;/a&gt; and they are available &lt;em&gt;now&lt;/em&gt; rather than spending another 6 years in development trying to achieve perfection.&lt;/p&gt;
&lt;p&gt;They have some notable (and largely intentional) limitations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;They don't do Extended Validation certificates.&lt;/li&gt;
&lt;li&gt;They don't do wildcard certificates.&lt;/li&gt;
&lt;li&gt;They don't issue certificates for internal servers can't be accessed from the internet&lt;sup id="fnref:internal"&gt;&lt;a class="footnote-ref" href="#fn:internal"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/li&gt;
&lt;li&gt;They don't issue client certificates to be used for things like S/MIME.&lt;/li&gt;
&lt;li&gt;Certificates are limited to 90 days.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These limitations mean that Let's encrypt is only useful about 99% of the time&lt;sup id="fnref:99-percent-of-the-time"&gt;&lt;a class="footnote-ref" href="#fn:99-percent-of-the-time"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;One thing Let's Encrypt was meant to do was make other Certification Authorities innovate, and &lt;a href="https://www.startcom.org/"&gt;StartCom&lt;/a&gt; have done that. In my opinion they were already one of the innovators in the field. They were giving away free domain validated SSL Certificates and for Extended Validation you could validate once and then get an unlimited number EV of certificates. In other words they were only charging you for things that were not automated which in itself was pretty revolutionary. Their validation process was pretty rigorous and while parts of their UI felt a little clunky it all worked pretty well.&lt;/p&gt;
&lt;p&gt;Now they have released &lt;a href="https://startssl.com/StartEncrypt"&gt;StartEncrypt&lt;/a&gt; which is clearly designed to go head to head with Let's Encrypt, from their announcement email:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Compare with Let’s Encrypt, StartEncrypt support Windows and Linux server for most popular web server software, and have many incomparable advantages as:&lt;/p&gt;
&lt;p&gt;(1) Not just get the SSL certificate automatically, but install it automatically;&lt;/p&gt;
&lt;p&gt;(2) Not just Encrypted, but also identity validated to display EV Green Bar and OV organization name in the certificate;&lt;/p&gt;
&lt;p&gt;(3) Not just 90 days period certificate, but up to 39 months, more than 1180 days;&lt;/p&gt;
&lt;p&gt;(4) Not just low assurance DV SSL certificate, but also high assurance OV SSL certificate and green bar EV SSL certificate;&lt;/p&gt;
&lt;p&gt;(5) Not just for one domain, but up to 120 domains with wildcard support;&lt;/p&gt;
&lt;p&gt;(6) All OV SSL certificate and EV SSL certificate are free, just make sure your StartSSL account is verified as Class 3 or Class 4 identity.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I don't think their points are worded particularly well; The first point implies that Let's Encrypt can't install certificates, but Let's Encrypt can automatically install certificates for Apache. The second and fourth points are basically the same. And the fifth point implies that Let's Encrypt can't handle multiple domain names, but it can have up to &lt;a href="https://community.letsencrypt.org/t/maximum-number-of-sites-on-one-certificate/10634/3?u=xotc"&gt;100 domain names per certificate&lt;/a&gt;, although as said above it won't do wildcards.&lt;/p&gt;
&lt;p&gt;Unfortunately the StartEncrypt client appears to be a closed source binary which is a serious problem for a lot of people. I'll admit that I've not read more than a few hundred lines of the &lt;a href="https://github.com/certbot/certbot"&gt;Certbot's source code&lt;/a&gt; but it's a huge comfort to know that I can if I want to. Also the documentation is fairly thin on the ground, if you download the &lt;a href="https://download.startpki.com/startcom/linux/StartEncrypt-x64.tar.gz"&gt;install file&lt;/a&gt; there is an &lt;a href="https://xo.tc/StartEncrypt-Operation-Manual-V3-Linux.pdf"&gt;Operating Manual&lt;/a&gt; in the doc directory but it's not especially detailed.&lt;/p&gt;
&lt;p&gt;If running a closed source binary is not your thing they also have an API, unfortunately at the time of this writing to access the &lt;a href="https://startssl.com/StartAPI/Docs"&gt;documentation for the API&lt;/a&gt; you need to be signed in. From a quick reading it looks to be a fairly simple REST API that you could use to write your own client.&lt;/p&gt;
&lt;p&gt;Even though I'll probably be sticking with Let's Encrypt for most things, I think it's great to see some competition.&lt;/p&gt;
&lt;p&gt;Also I know StartCom have copped some flack in the past because they gave out free certificates but changed to $25 revoke them. But I think their pricing is reasonable, they charge for manual processes, revocation was a manual process when heartbleed happened so they charged for it. Similarly they offer unlimited free Extended Validation certificates &lt;em&gt;after&lt;/em&gt; you have been validated. Validation costs $199 USD. Some people complain that validation isn't free and so EV certificates should not be advertised as free which is fair, but they are fairly upfront about that. And validation it's a real human process, they look at scanned copies of your passport, they call you up on the phone, they require proof that you represent the organization you say that you do none of that is automated.&lt;/p&gt;
&lt;p&gt;Another poignant comic by the folks over at &lt;a href="http://www.commitstrip.com"&gt;commitStrip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.commitstrip.com/en/2016/06/13/the-end-of-an-expensive-era/"&gt;&lt;img alt="The end of an expensive era" src="https://xo.tc/images/Strip-The-end-of-an-expensive-era-650-final.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:internal"&gt;
&lt;p&gt;I know there are a number of ways you can get a certificate for an internal server, but the design of Let's encrypt is clearly aimed at servers they can directly validate with ACME.&amp;#160;&lt;a class="footnote-backref" href="#fnref:internal" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:99-percent-of-the-time"&gt;
&lt;p&gt;I don't have a source for that, in fact I just made it up. It might be a fun project for someone to run through certificate transparency logs like &lt;a href="https://crt.sh/"&gt;crt.sh&lt;/a&gt; and find out what percentage of certificates issued are just standard dv certs. If anyone does that please let me know.&amp;#160;&lt;a class="footnote-backref" href="#fnref:99-percent-of-the-time" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:head-to-head"&gt;
&lt;p&gt;On their announcement email they directly compare StartEncrypt with Let’s Encrypt&amp;#160;&lt;a class="footnote-backref" href="#fnref:head-to-head" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Posts"></category><category term="TLS"></category><category term="Let's Encrypt"></category><category term="Cryptography"></category><category term="OpenSSL"></category><category term="StartEncrypt"></category><category term="StartSSL"></category></entry></feed>