{"id":1996,"date":"2015-11-01T22:50:25","date_gmt":"2015-11-01T20:50:25","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=1996"},"modified":"2015-11-01T23:07:30","modified_gmt":"2015-11-01T21:07:30","slug":"keys-void-gr-a-gpg-keyserver-in-greece","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2015\/11\/01\/keys-void-gr-a-gpg-keyserver-in-greece\/","title":{"rendered":"keys.void.gr &#8211; A GPG Keyserver in Greece"},"content":{"rendered":"<p>After some months of entertaining the idea of setting up a public gpg keyserver I finally managed to find some time and do it this weekend.<\/p>\n<p>Habemus <strong><a href=\"https:\/\/keys.void.gr\" target=\"_blank\">keys.void.gr<\/a><\/strong> Keyserver!<\/p>\n<p><strong>Some history<\/strong><br \/>\nThe first time I set up a <a href=\"http:\/\/people.spodhuis.org\/phil.pennock\/pgp-keyservers\" target=\"_blank\">gpg keyserver<\/a> was 3 years ago. Its purpose was to make it possible for a researcher to get more results than the default on a single query from a keyserver. Using that keyserver the <a href=\"https:\/\/www.void.gr\/kargig\/blog\/2013\/07\/08\/greek-pgp-web-of-trust-2012-edition\/\" target=\"_blank\">Greek PGP Web of Trust 2012 edition<\/a> was created. After the original import of the keys, I refreshed the keys just 2 or 3 times in the following years.<\/p>\n<p><strong>The setup<\/strong><br \/>\nThe keyserver is running on Debian Linux with <a href=\"https:\/\/bitbucket.org\/skskeyserver\/sks-keyserver\/wiki\/Home\" target=\"_blank\">SKS<\/a> version 1.1.5. Port 80 and 443 are being handled by nginx which acts as a reverse proxy for SKS. I originally had port 11371, the default port that gpg client uses, behind nginx as well but I had to remove it due to the following issue. I like using <a href=\"https:\/\/en.wikipedia.org\/wiki\/HSTS\" target=\"_blank\">HSTS header<\/a> for the HTTPS port, but browsers trying to access <strong>http<\/strong>:\/\/keys.void.gr:11371, were switching to <strong>https<\/strong>:\/\/keys.void.gr:11371 (because of HSTS) which couldn&#8217;t work because port 11371 does not use TLS. So once a browser visited https:\/\/keys.void.gr and got the HSTS header, every future connection towards http:\/\/keys.void.gr:11371 would fail. The solution was to use a protocol multiplexer called <a href=\"http:\/\/www.rutschle.net\/tech\/sslh.shtml\" target=\"_blank\">sslh<\/a>. What this does, is that it sniffs the connections coming towards port 11371 and if it finds a TLS connection, it sends it to port 443, if it finds an HTTP connection it sends it to port 80. That way you can either visit http:\/\/keys.void.gr:11371 or https:\/\/keys.void.gr:11371 and they both work. <\/p>\n<p>For ports 80,443 the connection path looks like: client -> nginx -> sks<br \/>\nFor port 11317 the connection path looks like: client -> sslh -> nginx -> sks<\/p>\n<p>keys.void.gr is available in both IPv4 and IPv6.<\/p>\n<p>I&#8217;ve also setup an onion\/hidden service for the keyserver, so if you prefer visiting the onion address, here it is: <strong><a href=\"http:\/\/wooprzddebtxfhnq.onion\" target=\"_blank\">wooprzddebtxfhnq.onion<\/a><\/strong> (available on port 11371 as well).<\/p>\n<p><strong>Difficulties<\/strong><br \/>\nI&#8217;m not sure if it&#8217;s the Debian package&#8217;s fault or I did something stupid, but if you plan on running your own keyserver be very careful with permissions on the your filesystem. sks errors are not very friendly. Make sure that \/var\/spool\/sks, \/var\/lib\/sks and \/var\/log\/sks are all owned by debian-sks:debian-sks.<br \/>\n<code># chown -R debian-sks:debian-sks \/var\/spool\/sks \/var\/lib\/sks \/var\/log\/sks <\/code><br \/>\nDon&#8217;t run the DB building script as root, run it as debian-sks user:<br \/>\n<code># sudo -u debian-sks \/usr\/lib\/sks\/sks_build.sh<\/code><br \/>\nThere are a quite some tunables referenced in the sks man page regarding pagesizes, I went with the default options for now.<\/p>\n<p><strong>The pool<\/strong><br \/>\nTo enter the pool of keyservers and start interacting with other keyservers you have to join the <a href=\"https:\/\/lists.gnu.org\/mailman\/listinfo\/sks-devel\" target=\"_blank\">sks-devel mailing list<\/a> and announce your server existence by sending your &#8220;membership line&#8221; which looks like this:<br \/>\n<code>keys.void.gr    11370    # George K. &lt;keyserver [don't spam me] void [a dot goes here] gr&gt; #0x721006E470459C9C<\/code><\/p>\n<p>If people place this line in their membership config file and you place theirs, then the keyservers start communicating, or &#8220;gossiping&#8221; as it is called in the sks language. It needs to be mutual.<\/p>\n<p>Because of the minimal traffic I was seeing on the mailing list archives I thought that finding peers would take weeks, if not months. I was very very wrong. I got 6 replies to my email in less than 2 hours. Impressive. Thanks a lot people!<\/p>\n<p><strong>UI<\/strong><br \/>\nI&#8217;ve taken the boostrap-ed HTML from <a href=\"https:\/\/github.com\/mattrude\/pgpkeyserver-lite\" target=\"_blank\">https:\/\/github.com\/mattrude\/pgpkeyserver-lite<\/a>.<\/p>\n<p><strong>TODO<\/strong><br \/>\nhkps support will be added in the following days or weeks.<\/p>\n<p><strong>Stats<\/strong><br \/>\n<a href=\"https:\/\/keys.void.gr\/pks\/lookup?op=stats\" target=\"_blank\">keys.void.gr Keyserver statistics<\/a><br \/>\n<a href=\"https:\/\/sks-keyservers.net\/status\/info\/keys.void.gr\" target=\"_blank\">sks-keyservers.net pool Status for keys.void.gr<\/a><\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After some months of entertaining the idea of setting up a public gpg keyserver I finally managed to find some time and do it this weekend. Habemus keys.void.gr Keyserver! Some history The first time I set up a gpg keyserver was 3 years ago. Its purpose was to make it possible for a researcher to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[6,5,414,3,8,4],"tags":[33,82,579,301,604,606,608,607,474,605],"class_list":["post-1996","post","type-post","status-publish","format-standard","hentry","category-encryption","category-internet","category-ipv6-networking","category-linux","category-networking","category-privacy","tag-debian","tag-gpg","tag-hidden-service","tag-ipv6","tag-keys","tag-keyserver","tag-onion-service","tag-sks","tag-tor","tag-wot"],"aioseo_notices":[],"views":13765,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=1996"}],"version-history":[{"count":19,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1996\/revisions"}],"predecessor-version":[{"id":2016,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1996\/revisions\/2016"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=1996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=1996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=1996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}