Allvais wis ze Görmaans: Edward Snowden Edition [en]

So the NDR (a branch of Germany’s public broadcasting service ARD) got to interview Edward Snowden — exclusive stuff apparently. And whom do they send to talk to him? Some nitwit called Hubert Seipel, whose English sounds like a combination of the Simpsons’ Rainier Wolfcastle and Bond-villain Maximilian Largo.

I don’t know much about that man’s eligibility otherwise, but just trying to listen to the first 3 minutes of the interview made me grind my teeth. Harsh stuff. Seriously.

Would I do better myself? Hell no! But neither would I dare to take upon me such a task. Doesn’t the ARD have any qualified staff at all? What am I paying my mandatory fees for, anyway?

Ranting about superficial bullshit aside, I hear the actual contents of the interview are rather disappointing themselves. Well, I guess I’ll have to bite the bullet and watch the whole interview, if I want to find out for myself…

Savage [en]

I’m more and more becoming a fan of Dan Savage. He’s one of these guys, who constantly manage to point out the nuisance of religion, without being a total dick about it.

That may be, because instead of just weighing in on abstract, philosophical questions, he actually does something good for society. He’s an LGBT activist and initiator of the It Gets Better Project, an organization that helps prevent suicide among young people with “non-traditional” sexuality. Also, he is the guy who brought us Santorum.

Last night, Dan Savage was on Bill Maher’s show, and the two were talking about the recent legalization of gay marriage in Hawaii:

Maher:
Their catholic bishop there […] says something about how children who are […] adopted by gay parents have a greater chance of committing suicide. That must be bullshit, right?

Savage:
That’s total bullshit. He’s confusing children with gay parents, with children who where raped by catholic priests.

Maher:
Uuuuuh!

Savage:
Sorry, I’m just done being lectured about children and their safety by catholic fucking bishops, priests, cardinals, …

[…]

Savage:
I hate to always go there, but they don’t have moral high-ground when they talk about the welfare and safety of children. They just don’t! They have squandered that on the tips of their dicks.

Here comes Gentrification [en]

Just stumbled upon an old NY-Times article about good old Glockenbachviertel in Munich. The article is from 2006, and I must say that the foreign autor grasped the essence of this quarter quite well.

Of course, things have changed since back then. Cool places have moved away (X-cess) or even shut down completely (KuK). Others, like Trachtenvogel or Netzer, have been mutilated by bourgeois neighbors and consecutive municipal restrictions.

Moreover, the Glockenbachviertel has been over-run by hoards of zombie hipsters – and rich IT-folks like myself have been taking over the residential properties. There goes the neighborhood!

OpenSSL CLI-Cheat-Sheet [en]

The OpenSSL library is utilized by a wide range of other open-source projects, like web-servers, mail-servers, VPN-servers, etc. When dealing with such software and SSL, it often proves useful to be familiar with the openssl command-line tools.

Of course, OpenSSL does have great man-pages, and a quick web-search reveals plenty of usage examples. However, OpenSSL is packed with features, and I often struggle to find just the information I need. Hence this cheat-sheet of openssl calls that I personally find useful…

Displaying Certificate Information

Once you have a certificate file (e.g. downloaded from a HTTPS website or created with the commands described below) you’ll likely want to check what it says. You can display it in human-friendly form and check its fingerprints with the following commands:

openssl x509 -noout -text -in meeque.crt
openssl x509 -noout -fingerprint -sha1 -in meeque.crt
openssl x509 -noout -fingerprint -md5 -in meeque.crt

This corresponds to the certificate information displayed by popular web-browsers, when you ask them to display details of an SSL-connection.

Likewise you can display the contents of a certificate-signing-request (CSR):

openssl req -noout -text -in meeque.csr

Creating a Certificate Signing Request

To obtain an SSL-Certificate you first need a certificate-signing-request (CSR), which you can then submit to a certification authority, like CAcert. Create a new CSR and a matching private-key like so:

openssl req -newkey rsa:4096 -keyout meeque.key.enc -out meeque.csr

By default, this command asks for all the information you want to include into the certificate along the way. (E.g. it asks for stuff like domain-name or distinguished-name, orgaisation-name, etc.)

It also asks for a passphrase to protect the private-key with. You can later remove such a passphrase with the following command:

openssl rsa -in meeque.key.enc -out meeque.key

(Depending on one’s security needs, this can be useful, since it facilitates server-restarts without user-interaction. However, keep non-encrypted private-keys extra safe!)

Creating a Self-Signed Certificate

When you need a certificate for test-purposes only, you probably don’t want to involve a certification authority. Instead, you want to sign the certificate yourself. Based on above CSR and private-key it works like this:

openssl x509 -req -days 365 -extensions v3_req -in meeque.csr -signkey meeque.key -out meeuqe.self.crt

Tackling Multi-Domain-Certificates

One aspect, which cannot be handled on the command-line easily, is creation of a multi-domain certificate. More precisely the creation of a respective CSR. Here, you’ll need to create a custom OpenSSL configuration file, with an subjectAltName entry for all additional domains. Just start with one of the sample config-files, and add the following lines:

[ v3_req ]
subjectAltName = DNS:meeque.de,DNS:meeque.org,DNS:foo.example.net

When creating your CSR, you pass your config-file to the command described above:

openssl req -config meeque.openssl.cnf -newkey rsa:4096 -keyout meeque.key.enc -out meeque.csr

Dealing with Ciphers

Once certificates are in place, you might want to tweak other properties of your SSL connections, e.g. enable or disable certain ciphers. The OpenSSL library provides a rather peculiar cipher list format, which is also utilized in the config-files of various SSL-enabled servers. (E.g. Apache’s mod_ssl.) Luckily the openssl command helps you to test such cipher lists. The following command takes a textual cipher list, and tells you to which actual ciphers it resolves:

openssl ciphers '!ADH:!AECDH:!MD5:HIGH'

Testing SSL-Connections

Which leaves us with my new personal favorite: the SSL client command that comes with OpenSSL. It lets you initiate an SSL connection to a given server and port, and dumps plenty of info regarding certificate validation, SSL-handshake, SSL-session, etc. Usage is as simple as this:

openssl s_client -connect meeque.de:443

OpenSSL is also used by the small SSLScan tool. It provides a quick way to check, which ciphers a given server supports:

sslscan --no-failed meeque.de:443

Tobi’s Season-Edit [en]

Tobi was mentioned here before, and now he’s just published his season-edit for 2012:

Check it out! You’ll be amazed how many sports he’s skilled at! Other folks don’t even have that kind of action on their X-Box. Of course Tobi’s been focusing on skiing for a long time. So check out that part (roughly last third of the video) for some more advanced shots!

Oh an just for completeness: here’s an older edit, which focuses on skiing only:

And here is, what his employer thinks about all that (in German).

 

Ubuntu Full-Disk-Encryption – A Field Report [en]

Since my old notebook computer recently gave up on me, I had to install a new one from scratch. I finally decided to give Ubuntu a go, after I had been using Debian (testing) for almost a decade. I must say that I’m really impressed with Ubuntu’s lean installation process, which handles diverse aspects like live-preview, hardware-detection, pre-existing operating systems, partitioning, etc. in a very convenient manner.

However Ubuntu also seems to come with several annoyances and limitations. I plan to figure out solutions for most of these in the following days, but one thing struck me right in the beginning: disk encryption. Sure, Ubuntu comes with easy support for encrypted home directories, but for reasons listed below that’s not exactly what I need.

According to an article by the EFF, the latest (12.10) Ubuntu installer already comes with built-in support for full-disk-encryption. Apparently, this feature only works when you’re installing Ubuntu alone, on an otherwise empty physical disk. Sadly, I wasn’t offered this option when trying to install alongside an existing OS. (Or maybe I just overlooked the feature, which would make most of the information provided here rather less essential. However, this article is still useful as a starting point for more exotic installations and as a reference for trouble-shooting.)

Update: By now I have successfully tested Ubuntu’s built-in support for full-disk-encryption on a different computer. When installing on an empty disc (or completely replacing an existing OS installation) it works as expected. The outcome – in terms of partition, luks, and lvm setup – is very similar to the one presented here. Hence I can fully recommend it, if applicable to one’s pre-existing setup!

Preconditions and encryption requirements

I partially use my computer for  development work, and I like to toy around with system-wide settings. That’s why:

  • Encryption should cover all the files on my Ubuntu disk partition. In particular files in etc (might contain passwords) and var (e.g. MySQL DBs) must also be covered. This helps prevent data leakage.
  • Encryption must cover Linux swap areas. These might contain secret data of running programs,  like passwords and keys.
  • Additional un-encrypted disks and partitions should still be possible. In particular other operating systems should still run in a multi-boot fashion. These may be encrypted by their own means, or not at all.
  • Encryption should integrate neatly with Ubuntu. It must work with latest Ubuntu 12.10 (Qunatal) and should be ready for future versions.
  • Encryption does not need to isolate data of multiple users against each other. I’m the only one using the machine most of the time. And the only one with root access.

I used to have a setup that addressed all these requirements on my old Debian box. As far as I remember the Debian installer had offered a rather reasonable partitioning scheme with luks encryption and lvm volumes – though some manual interaction may have been needed. It is this kind of setup I was aiming to reproduce with Ubuntu.

Setting up full-disk-encryption while installing Ubuntu

So I first checked the encryption capabilities of the Ubuntu installer. The presets it offers are very convenient, but as mentioned above, support for full-disk encryption seems somewhat limited. Even the manual partitioning tool of the installer, only seems  to provide very basic support for encryption. E.g. it offers dm_crypt, but does not have any (good) luks support.

So I had to abort the install, which got me back to the Ubuntu live-session. Being a GUI junkie, I first did some basic partitioning work (shrinking and moving old windows partitions) with gparted. Then I used the same to create the following 2 new partitions:

  • /dev/sda5 – ext4, 1GB:
    intended for an unencrypted /boot partition
  • /dev/sda6 – unallocated, a gazillion GB (I wish):
    intended for my encrypted Ubuntu installation and data

Next I used the CLI-tool cryptsetup to initialize an encrypted luks-container:

sudo cryptsetup luksFormat /dev/sda6
sudo luksOpen /dev/sda6 crypt1

The first command generates a new encryption-container on sda6 and asks for a passphrase to protect it. (Should be chosen wisely! However, luks also gives you the possibility to add or remove passphrases later.) The second command opens the new encryption-container (asking for the passphrase) and makes its contents available under /dev/mapper/crypt1.

Now, lvm comes into play:

sudo pvcreate /dev/mapper/crypt1
sudo vgcreate system-volumes /dev/mapper/crypt1
sudo lvcreate --name swap --size 3G system-volumes
sudo lvcreate --name root --extents 100%FREE system-volumes

This creates a new physical volume (pv) and a new volume group (vg) called system-volumes inside the encryption container. It then creates two logical volumes in this volume-group:

  • /dev/system-volumes/swap – 3GB:
    intended for a linux swap
  • /dev/system-volumes/root – the rest of the free space (extents):
    intended for the root file-system

That’s basically it. Without exiting the Ubuntu live-session, I started the installer tool again, and did the rest of the work with its GUI. GParted didn’t seem to recognize the new logical volume devices, but the partitioning-tool of the installer did. So I formatted the new volumes, and mapped everything to the following mount-points:

  • /dev/sda5   →   /boot   (ext4)
  • /dev/system-volumes/root   →   /   (ext4)
  • /dev/system-volumes/swap   (linux-swap)

I also chose to install Grub into the MBR of /dev/sda and continued installing Ubuntu.

Post-Install Fix-Ups

The installation finished flawlessly – but the first boot into the new system did not. It did not ask to decrypt the encryption-container on sda6 and therefore could not find any root file-system to mount. Instead, the boot process fell back to a BusyBox shell, and I had to decrypt it manually. As above, the following command does the trick:

luksOpen /dev/sda6 crypt1
exit

The exit command terminates the shell and resumes the boot process, which will now find the root file-system and continue to boot. In my case, this lead me all the way to a working Ubuntu desktop.

Since I did not want to do this manually on each boot, a few more steps were necessary. After my Ubuntu system fully booted, I created the following entry in /etc/crypttab:

#   <target>   <source device>   <key file>   <options>
crypt1   /dev/sda6   none   luks

This tells the system about the encrypted disks that are available. And the boot process will try to open them, and see if they contain the root file-system. In order for this to actually take effect at boot time, I also reinstalled the linux kernel, the initrd, and grub. (In my case I did it in the course of pending system updates, but one could also trigger package reinstalls manually with apt-get or synaptic.) From there on, the Ubuntu boot process has always asked me for a passphrase to access my disk, and booted flawlessly. Yeah!

Explanations and Implications

You might wonder, why one couldn’t adjust /etc/crypttab before or during the install? And, why a reinstall of the kernel is necessary? Well, maybe the first approach might work, but I didn’t test it. As for the kernel reinstall, it is not strictly necessary. The only thing that is strictly necessary is building a new initrd file, which will then contain its own copy of the above /etc/crypttab file. (I know there are other tools to achieve that, but a reinstall of the package seemed the easiest.)

But why is that necessary? And what is the initrd anyways? Well, you also might have been wondering how the boot process can access any configuration before the root file-system is mounted? Well, that’s where the initrd, the initial RAM disk, comes in: it contains all the files that are necessary for the boot-process, before the actual root file-system is available. That may be stuff like kernel-modules, low-level user-space tools (e.g. cryptsetup, lvm, BusyBox, etc.) and basic configuration files (e.g. fstab and crypttab). That’s why it is not sufficient to adjust the /etc/crypttab file in the actual root file-system. It is the /etc/crypttab inside the initrd that is relevant at boot-time!

After so much configuration hassle related to luks/cryptsetup, what about the layer above? What about lvm? Well, as you might have guessed by now, there is no further configuration necessary here. The lvm subsystem heavily relies on meta-data stored in the pvs, vgs, and lvs themselves. Apparently, the lvm kernel module together with the lvm user-land tools (from the initrd) automatically recognize the physical-volume /dev/mapper/crypt1 once it is created by cryptsetup. And lvm makes all the included logical-volumes available automatically, in particular the one containing the root file-system. Also, the installer already added a suitable entry for / in /etc/fstab. So this part of the problem seems to solve itself under Ubuntu.

Oh, one more thing: As you may have noticed, this approach leaves a couple of weaknesses open. In particular, the /boot partition itself is not encrypted. Neither is the grub code in the MBR. Or the partition table. This does not impose a huge problem, since those don’t usually contain any data that needs protection.

However, someone could tamper with them, when you leave your computer unattended! This might enable an eavesdropper to sniff your password. So when in doubt, you should probably re-install the /boot partition and the MBR! However, when someone has access to your computer, they might aswell tamper with the hardware. So I don’t consider this weakness overly relevant.

29C3 Talk: Certificate Authority Collapse [en]

Just watching axelarnbak‘s 29C3 talk on Certificate Authority Collapse, which covers structural flaws in SSL. I’ve reported on the mess with SSL before, and you may notice related complications (see CAcert) while browsing this page.

After a good summary, the talk mainly focuses on structural problems and regulatory solution approaches. But apparently there are other talks at the 29C3, which focus on the technical side of the problem…

Flashback: Home, To Where The Powder Is [en]

This is a flashback post, that is, it refers to a long-passed event, or contains content that was originally published through a different channel.
In this case it’s based on an e-mail I sent to a bunch of friends on 2008-06-25 from my trip to New Zealand.

Merry Christmas Everyone!

Just a quick update this time, since my life has not been overly eventful recently. At least not in a positively exciting way.

P1: Tauranga – Sunset at a bay
P2: Tauranga – Scenic Walk by an Inlet

As mentioned, I spent autumn in Tauranga [P1][P2], which is in the Bay of Plenty on the North Island. In the beginning I was staying in a suburb called Mount Maunganui, right on the beach [P3][P4]. Many of the other hostel guests had surf boards, and some of them would lend one to me for an hour or two. Problem was, all of them were riding short boards, which are not exactly right for beginners. However, after a few days out I became good enough to catch a wave from time to time! I was really stoked it worked out so well, but admittedly it all depended on good wave conditions. Anyways, I guess I’m getting there…

Unfortunately I didn’t do as much surfing as I had hoped to do. First of all, Mount Maunganui does not have great condition all year round — the water got fucking cold soon and we had heaps of flat days and weeks. Also, I moved away from the beach after a few weeks, because of my new job…

P3: Mount Maunganui – Afternoon at the Beach
P4: Mount Maunganui – The Surf Beach

By that of course I mean my employment at the new hamburger bistro called Wünder Burger [P5]. As the place only just opened, I spent my first two weeks with occasional building and painting jobs and helping to figure out how to grill good burgers. However, once we opened the place a few weeks later I actually liked the food we were selling quite a lot! I had at least one burger, panini, or sandwich each shift. So once I’m back home I’ll be the burger man at every BBQ!

Wünder Burger was still quite a new place, and while we were quite busy at lunch time, at dinner time, and late night on weekends, most of the time the job was pretty boring. I was tending the place all alone most of the time, a big contrast to the busy bar I used to work at in Queenstown (QT), where I always had nice colleagues around.

P5: Wünder Burger

But the worst trouble I had during my stay in Tauranga was definitely related to my van. I’ve had problems with it before, but things kept getting worse and worse. First, one day when I wanted to drive to work, the drive shaft simply broke. (That’s a big solid metal bar connecting the engine to the wheels!) I waited a few weeks till I had more money to fix it and I spent another two weeks calling and visiting several wreckers to find an appropriate spare part.

Next, it turned out the battery had finally given up and I had to buy a new one. Moreover, I had to obtain a new Warrant Of Fitness for the van. While there were no severe problems to it, there were lots of small fixes to do before the van could pass the recheck. In the end all of this cost me a lot of time and money, and kept me busy until my last day in Tauranga!

As you may know, this was the first car I ever owned, and I really hated all the hassle related to it. Luckily I don’t need a car back home in Munich!

Due to all that trouble I did not do all the weekend trips I had planed. In the end I had to skip the Taranaki peninsula (with its impressive volcano) and Northland (anything north of Auckland).

However, I did go to Raglan, a lovely little town on the west cost, surrounded by probably the most beautiful scenery in all of New Zealand [P6]. Since it was also featured in the legendary “Endless Summer” movie I was expecting great surf there, but unfortunately I just hit some down-days. One afternoon we had some half-meter waves at least, so I grabbed the biggest rental board they had — about 9 feet. It turned out to be one of my best surfing days ever, the waves being small but nicely shaped and pretty constant. And with that huge board, I caught almost every single wave!

[Update: I should mention that Raglan has these great backpackers, two of the best I’ve ever stayed at in NZ. Also, they have Denise now:) ]

P6: Reglan – Manu Bay

The only other place I visited recently was Auckland [P7][P8], from were I was flying back to the South Island. A nice city, although I could not make out any killer sights. Being a fan of tall buildings, I liked the Sky Tower, but other than that the city center seems rather mediocre. However, Auckland is situated in a remarkable landscape with lots of hills (ancient volcanoes) and is situated in between several bays — the ocean is never far.

Unfortunately I spent the first 3 days in Auckland trying to sell that damn van. In the end I succeeded to get rid of it for a ridiculously low price — it’s just not the right season to sell backpacker vans. The rest of my days in Auckland were tainted with a really nasty cold I caught shortly before leaving Tauranga. So I could not enjoy much of the city and its nightlife.

P7: Auckland – Skyline by the Pier
P8: Auckland – Skyline with Marina and Sky Tower

I still felt pretty weak when I came back to QT, but it was really good to be back “home”. Five minutes after getting off the bus I already had my first free drink at my old and new workplace, The World Bar. The next day we were invited to a Drink Safe Workshop. by the local police authorities. Appropriately we had a staff party the same night, with lots of free food and drinks! The day after, I finally picked up work… sweet as!

However, some aspects of coming home to QT were slightly disappointing. The weather for instance: after my QT mates had already reported heaps of snow about a month ago, all of it melted away just the weekend before I arrived. The local ski resort has only been open for about one week and is currently closed until further notice. Well, right now it seems to improve, as it’s getting pretty cold again and it may be snowing during the next few days. If I’m lucky I’ll have my first snowboarding day by the end of the week:-) I’ll keep you up to date about the season…

Keep on ridin’,
Michael