#!/bin/blog

May 28, 2009

Opportunistic key signing

Filed under: Scripting — martin @ 6:36 am

Here’s a security practice that many of you folks are not going to like.

Let’s say I’m dealing with some piece of software that can be downloaded as source code, along with a PGP signature, such as, for example, the EXIM MTA:

$ ls exim*
exim-4.69.tar.gz exim-4.69.tar.gz.asc
$ gpg exim-4.69.tar.gz.asc
gpg: Signature made Wed Dec 19 13:37:54 2007 CET using DSA key ID DDC03262
gpg: Can't check signature: public key not found
$ gpg --recv-key DDC03262
gpg: requesting key DDC03262 from hkp server wwwkeys.de.pgp.net
gpg: key DDC03262: public key "Nigel Metheringham (Exim key) " imported
[...]
$ gpg exim-4.69.tar.gz.asc
gpg: Signature made Wed Dec 19 13:37:54 2007 CET using DSA key ID DDC03262
gpg: Good signature from "Nigel Metheringham (Exim key) "
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: FAA1 C7F9 CD07 7DC4 304B C0C8 85AB 833F DDC0 3262

What now? I don’t have a trust path to this key, so what can I do about the software? Of course, I can (and will) do what everyone does in this situation: Have a look at the current list of people who have signed the signing key and decide based on some kind of makeshift criteria, whether I want to use the software anyway.

But I can also do something else. Chances are that I will come back to this situation. In a few months, I might want to check the PGP signature on a new release. For that day, I can add an unverified signature to the key.

$ gpg --edit-key DDC03262
[...]
Command> sign
[...]
How carefully have you verified the key you are about to sign actually belongs
to the person named above? If you don't know what to answer, enter "0".

(0) I will not answer. (default)
(1) I have not checked at all.
(2) I have done casual checking.
(3) I have done very careful checking.

Your selection? (enter `?' for more information):
[...]
$ gpg --send-key DDC03262

(Don’t bother looking; I haven’t actually signed and uploaded the EXIM key.)

I tend to prefer the sig1 here due to the clear statement that “no check was made at all”, but sig0 works just as well. The important part is that I sign the signing key, but without making any claim about its validity. When I get back to that same key at a later date, I can however tell for sure that I have deemed this key to be usable in the past.

I believe that this is a legitimate use of sig0 and sig1 signatures, although I have to acknowledge that I have met people who disagree with me about this.

May 23, 2009

Freakshow ‘49-’90

Filed under: Paranoia, Politics — Tags: , — martin @ 9:36 pm

Sehr schöner Artikel in der Zeit, “Helden wie ihr“:

Offenbar ist in Zeiten der Krise das Bedürfnis des Staates nach Legitimation enorm und der historische Fehlschluss nützlich, dass aus einem gelungenen Jahr 1989 das Gelingen des Jahres 2009 folgt. Deshalb war es kein Zufall, dass Angela Merkel die vereinten Bürger kürzlich zum Optimismus ermahnte. Bitte in der Krise keine destruktive Kritik! Bitte positiv denken! Das erinnert an die Feiertagsgepflogenheiten der DDR. Damals war das Land, in dem man lebte, immer auch dasjenige, von dem man geträumt haben sollte.

Die Diskussion um den “Unrechtsstaat” DDR weist ziemliche Parallelen zu meinen Nazi-Thesen auf, die ich hier in ziemlich ermüdender Weise schon oft geäußert habe. Wie bei den Nazis, so trübt auch hier die Geschichte den Blick und steht einer objektiven Bewertung der Gegenwart im Weg.

Allein schon der “Unrechtsstaat”. Ein Unwort, das in der allwissenden Müllhalde Wikipedia erst vor ein paar Wochen Einzug gehalten hat. Aber klar, daß langsam ein neues Vokabular her muß. Wenn man von Diktaturen und Polizeistaaten sprechen würde, liefe man immerhin Gefahr, plötzlich die eigene Nähe zu Überwachungs- und Polizeistaaten zu erkennen,

  • in denen Blogger und Oppositionelle mal eben zwischendurch Mundtot gemacht werden können,

  • in denen es keine Rechtssicherheit im Hinblick auf Meinungs- und Versammlungsfreiheit gibt,
  • in denen korrupte Regierungsmitglieder die Legitimation des Verfassungsgerichts in Frage stellen,
  • und in denen unter vorgeschobenen Gründen die Einführung der Internetzensur betrieben wird.

Gut, daß es in Deutschland nie wieder so kommen wird, wie es mal war. Amen.

May 16, 2009

Mei, Hammer

Filed under: Internet — Tags: — martin @ 4:52 pm

So, ich hab grade meine erste MyHammer-Ausschreibung abgewickelt, und ich muß sagen: Ätzend.

Zum einen ist das große MyHammer-Märchen nicht wahrgeworden und meine Preisvorstellung wurde nicht um die Hälfte unterboten. Zum anderen stört es mich gewaltig, daß MyHammer groß mit dem unverbindlichen Einstellen einer Ausschreibung wirbt, aber am Ende recht deutlich mit der automatischen Auftragsvergabe an den Niedrigstbietenden droht.

Der Notausgang aus dieser Situation ist nur schwierig zu finden (zumindest ist er im Gegensatz zu allen anderen Optionen nicht mit einem dicken roten Grafikbutton unterlegt), und selbst dann gibt sich MyHammer nicht mit einem einfachen “kein Interesse mehr” zufrieden, sondern verlangt in jedem Fall die Eingabe eines Begründungstextes. Hat man den Auftrag an einen anderen Handwerker außerhalb vergeben, wird mindestens der Firmenname verlangt, und wer die Anschrift dazu angibt, bekommt 5 € Prämie. Eine ziemliche Unverfrorenheit.

MyHammer hat sicherlich die offensivste Fernsehwerbung, aber ich glaube nicht, daß ich mich damit ein weiteres mal auseinandersetzen werde. Ich fand die Vorstellung, so offensiv den Preis runterzufeilschen und den billigsten Höker an meiner Immobilie herumdoktern zu lassen, noch nie in Ordnung. Das Drumherum bei der Auftragsvergabe gibt mir aber persönlich den Rest.

P.S.: Der Gewinner der Ausschreibung und ich wickeln den Auftrag jetzt an MyHammer vorbei ab. Wird schon schiefgehen. ;-)

Debian VMware woes

Filed under: UNIX & Linux — Tags: , , , , — martin @ 8:28 am

Had some trouble with Debian in VMware Server 2.0: I/O was horribly slow, 100% IOwait when doing the simplest things, hdparm showing 11MB/s throughput.

This was fixed by shutting down the VM, changing the SCSI adapter from Buslogic to LSI logic and booting up again. hdparm is at 63MB/s now. The machine, which will be an SMTP mail exchanger, now scans 8 mails per second (Postfix before-queue filter via amavisd-new+ClamAV) in 10 concurrent sessions. Not bad at all.

Debian is by far the simplest choice for an SMTP content filter because it’s not neccessary to bring in any dependencies by hand. Cool. :-)

May 8, 2009

Meta-Freakshow

Filed under: Politics — Tags: — martin @ 6:28 am

Oh, wow, die Polen sind um ihren unverkrampften Umgang mit dem Nationalsozialismus wirklich zu beneiden:

Schocktherapie für Straftäter in Polen – Kann ein Besuch in der KZ-Gedenkstätte Auschwitz bei der Resozialisierung helfen? – “Wir möchten in den Häftlingen das Bewusstsein dafür wecken, wohin die Toleranz des Bösen führen kann. Was für ein furchtbares System man in einer Gesellschaft schaffen kann, die Gewalt und Verfolgung akzeptiert. Die Häftlinge sollen wissen, was in Auschwitz geschah. Das soll eine Schocktherapie sein.”

Zumindest scheint Auschwitz in Polen nicht wie ein Nationalheiligtum behandelt zu werden. In Deutschland stehen Konzentrationslager schließlich unauslöschlich dafür, wie schlimm es mal war, aber nie wieder werden kann.

May 6, 2009

Webseiten in-place editieren

Filed under: Internet — martin @ 7:25 pm

Was Mikko Hypponen da twittert, ist schon ziemlich lässig:

To edit any web page, type this to address bar:
javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 42

Da muß man sich praktisch garnicht mehr krummlegen, um Screenshots zu fälschen.

fake-spiegel

Proposed Additions to the PDP-11 Instruction Set

Filed under: fun — Tags: — martin @ 7:09 am

Fortune des Tages, wirklich sehr schön, selbst wenn man (so wie ich) vielleicht nicht den ganz großen Kontext kennt:

Proposed Additions to the PDP-11 Instruction Set:

DC      Divide and Conquer
DMPK    Destroy Memory Protect Key
DO      Divide and Overflow
EMPC    Emulate Pocket Calculator
EPI     Execute Programmer Immediately
EROS    Erase Read Only Storage
EXCE    Execute Customer Engineer
HCF     Halt and Catch Fire
IBP     Insert Bug and Proceed
INSQSW  Insert into queue somewhere (for FINO queues [First in never out])
PBC     Print and Break Chain
PDSK    Punch Disk

April 24, 2009

OpenSSH connection multiplexing

Filed under: Security, UNIX & Linux — Tags: , , — martin @ 6:44 am

The Challenge

I was in touch with a developer the other day who used SSH to programmatically connect to a remote machine where he would start some kind of processing job. Unfortunately, he was in trouble when he wanted to kill the remote process. Killing the local SSH client would leave his job active. He claimed that there used to be some sort of signal forwarding feature in OpenSSH on the machine where he had developed his application in OpenSSH 3.x days, but this feature seems to have been removed by now.

I wasn’t able to confirm anything of this, but this gentleman’s problem got me curious. I started to wonder: Is there some kind of sideband connection that I might use in SSH to interact with a program that is running on a remote machine?

The first thing I thought of were port forwards. These might actually be used to maintain a control channel to a running process on the other side. On the other hand, sockets aren’t trivial to implement for a /bin/ksh type of guy, such as the one I was dealing with. Also, this approach just won’t scale. Coordination of local and remote ports is bound to turn into a bureaucratic nightmare.

I then started to skim the SSH man pages for anything that looked like a “sideband”, “session control” or “signaling” feature. What I found, were the options ControlMaster and ControlPath. These configure connection multiplexing in SSH.

Proof Of Concept

Manual one-shot multiplexing can be demonstrated using the -M and -S options:

1) The first connection to the remote machine is opened in Master mode (-M). A UNIX socket is specified using the -S option. This socket enables the connection to be shared with other SSH clients:

localhost$ ssh -M -S ~/.ssh/controlmaster.test.socket remotehost

2) A second SSH session is attached to the running session. The socket that was opened before is specified with the -S option. The remote shell opens without further authentication:

localhost$ ssh -S ~/.ssh/controlmaster.test.socket remotehost

The interesting thing about this is that we now have two login sessions running on the remote machine, who are children of the same sshd process:

remotehost$ pstree -p $PPID
sshd(4228)─┬─bash(4229)
           └─bash(4252)───pstree(4280)

What About The Original Challenge?

Well, he can start his transaction by connecting to the remote machine in Master mode. For simplicity’s sake, let’s say he starts top in one session and wants to be able to kill it from another session:

localhost$ ssh -t -M -S ~/.ssh/controlmaster.mytopsession.socket remotehost top

Now he can pick up the socket and find out the PIDs of all other processes running behind the same SSH connection:

localhost$ ssh -S ~/.ssh/controlmaster.mytopsession.socket remotehost 'ps --ppid=$PPID | grep -v $$'
  PID TTY          TIME CMD
 4390 pts/0    00:00:00 top

This, of course, leads to:

localhost$ ssh -S ~/.ssh/controlmaster.mytopsession.socket remotehost 'ps --no-headers -o pid --ppid=$PPID | grep -v $$ | xargs kill'

Then again, our shell jockey could just use PID or touch files. I think this is what he’s doing now anyway.

Going Fast And Flexible With Multiplexed Connections

With my new developer friend’s troubles out of the way, what else could be done with multiplexed connections? The SSH docs introduce “opportunistic session sharing”, which I believe might actually be quite useful for me.

It is possible to prime all SSH connections with a socket in ~/.ssh/config. If the socket is available, the actual connection attempt is bypassed and the ssh client hitches a ride on a multiplexed connection. In order for the socket to be unique per multiplexed connection, it should be assigned a unique name through the tokens %r (remote user), %h (remote host) and %p (destination port):

ControlPath ~/.ssh/controlmaster.socket.%r.%h.%p
# Will create socket as e.g.: ~/.ssh/controlmaster.socket.root.remotehost.example.com.22

If there is no socket available, SSH connects directly to the remote host. In this case, it is possible to automatically pull up a socket for subsequent connections using the following option in ~/.ssh/config:

ControlMaster auto

So Where’s The Actual Benefit?

I use a lot of complex proxied SSH connections who take ages to come up. However, connecting through an already established connection goes amazingly fast:

# Without multiplexing:
localhost$ time ssh remotehost /bin/true
real    0m1.376s
...
# With an already established shared connection:
localhost$ time ssh remotehost /bin/true
real    0m0.129s
...

I will definitely give this a try for a while, to see if it is usable for my daily tasks.

Update, 2009/05/04: No, it isn’t. Disconnecting slave sessions upon logout of the master session are too much of a nuisance for me.

April 17, 2009

Internetfilterung in Deutschland

Filed under: Politics — Tags: , , — martin @ 7:26 pm

Diesen Artikel hatte ich eigentlich für eine Lokalzeitung geschrieben. Ich habe ihn trotz der durch Konjunktiv und Verwendung der dritten Person erfolgten Distanzierung nicht veröffentlicht. Als jemand, der kleine Kinder und verschlüsselte Festplatten hat, muß man heutzutage gut aufpassen, was man sagt, und was die Leute einem deshalb andichten könnten. Auch wenn hier nichts geschrieben steht, was meine Leser nicht ohnehin schon wissen, ist der Artikel hiermit zur beliebigen Verwendung unter eurem eigenem Namen freigegeben.

Internetfilterung in Deutschland

Am heutigen Freitag wurden vom Bundesfamilienministerium mit mehreren großen deutschen Internetanbietern Vereinbarungen zur Filterung von Internetzugängen abgeschlossen.

Für Ministerin Ursula von der Leyen handelt es sich beim Abschluß der Vereinbarungen um einen großen Durchbruch. Die beteiligten Anbieter sollen auf dieser Basis den Zugang zu Webseiten sperren, auf denen kinderpornographische Darstellungen angeboten werden. Zu diesem Zweck wird den Internetanbietern vom Bundeskriminalamt eine Sperrliste zur Verfügung gestellt.

Die Einführung dieser Filtermaßnahmen wurde im Vorfeld von Technikern, Datenschützern und auch Opfern heftig kritisiert. Die Kritikpunkte waren dabei vielfältig. Die Filterung könnte etwa mit einfachsten Mitteln umgangen werden und sei somit in der Realität wirkungslos.

Kritisiert wurde weiterhin, daß Sperrlisten, die trotz Geheimhaltung an die Öffentlichkeit gedrungen waren, zum großen Teil auf Server verwiesen, die in Deutschland und den europäischen Nachbarländern betrieben werden. Die sollten an Stelle von Sperrungen besser direkt selbst vom Netz genommen werden. Mit den nun in Umsetzung befindlichen Filtermaßnahmen würde das Problem lediglich ausgeblendet, aber effektiv nichts zu einer Lösung beigetragen.

Des weiteren sei zu befürchten, daß die nun vereinbarte Filterregelung als Vehikel genutzt werden könnte, über das etwa die finanzstarke Medienindustrie die Sperrung des Zugangs zu Webseiten betreiben könnte, durch die sie ihre Rechte verletzt sieht. Letztlich könnte über die Filterregelung auch der Zugang zu politisch kritischen Seiten, wie etwa von Globalisierungsgegnern, gesperrt werden. Dies wäre eine beträchtliche Einschränkung der vom Grundgesetz zugesicherten Meinungsfreiheit.

Sollte es so weit kommen, würde aus dem vermeintlichen Kinderschutzsystem eine Infrastruktur für die Zensur des Internet. Deutschland würde sich damit in bester Gesellschaft von Staaten wie etwa China, Pakistan oder Irak befinden.

Ob es so weit kommt, wie die Kritiker befürchten, wird die Zukunft zeigen. Der heutige Tag könnte sich dabei als Wendepunkt für die Freiheit des Internetzugangs in Deutschland entpuppen.

April 15, 2009

Freakshow revisited

Filed under: Politics — Tags: , — martin @ 12:05 am

Irgendwo in USA läuft also noch irgendein 90 Jahre altes todkrankes KZ-Sadistenarschloch im Rahmen seiner Möglichkeiten frei rum. Und dem glaubt man nun, in Deutschland den Prozeß machen zu müssen.

Schön, wenn irgendwo nochmal so ein Alt-Nazi auftaucht. Auch wenn die Umstände, unter denen man ihn vor Gericht zerren muß, einem Rechtsstaat nicht notwendigerweise gut zu Gesicht stehen. Aber man muß halt manchmal gewisse Zugeständnisse machen.

Hauptsache, man hat nochmal jemanden, den man als ganz realen moralischen Abschaum geißeln kann.

Older Posts »

Blog at WordPress.com.