Search Results: "uwe"

23 September 2006

Uwe Hermann: The Top Ten Unix Shell Commands You Use [Update]

IBM has a nice article called UNIX productivity tips. The article mentions this one-liner, which shows the shell commands you use most often:
$ history awk ' print $2 ' awk 'BEGIN  FS=" "   print $1 ' sort uniq -c sort -rn head -10
    471 sl
    222 cd
    217 csl
    155 vi
    140 ..
    112 ls
    106 cls
     70 rm
     64 mv
     58 xpdf
Gee, I didn't know I'm that boring... Note how I mistype "ls" way more often than I type it correctly. Luckily my .bashrc fixes this for me :) Update 2006-09-25: When I posted this, I didn't intend to start a meme, but it seems I did: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14. (via Lifehacker)

22 September 2006

Uwe Hermann: Linux running German Pfandautomat

Linux seems to run on more and more embedded systems all over the place. Nice example I learned about recently: Linux running an ALDI "Pfandautomat" (German)... Yeah, I have no idea how to translate "Pfandautomat" (container deposit?). There's a video (Flash) on the site. A screenshot is here.

20 September 2006

Uwe Hermann: Creative Commons remix culture - a practical example

Autumn Leave As you might know I publish some of my photos in my photoblog and on flickr under a Creative Commons license. A very cool example of the so-called remix culture "happened to me" recently — one of the photos I posted on flickr was used as album art for a music CD, namely J. D. Warrick's "Going, a. The Leaving". Btw., if you want to learn more about remix culture, Creative Commons etc. I can really recommend Larry Lessig's Wizards of OS 4 Keynote titled "The Read-Write Society" (OGG video: 144 MB, MP4 video: 224 MB).

19 September 2006

Uwe Hermann: SELinux by Example - Using Security Enhanced Linux

SELinux by Example Recently in my (physical) mailbox: SELinux by Example by Frank Mayer, Karl MacMillan, David Caplan. The most recent and up-to-date book about SELinux I know about, written by some of the most involved and knowledgeable people in the field. From what I've read until know it seems to be a really in-depth and easy to understand introduction, and what's more important, it covers the practical aspects of how you use, configure, and administer SELinux in real deployed systems. This should make an interesting read...

18 September 2006

Uwe Hermann: Manipulating PDFs from the command line - joining, merging, rotating [Update]

One of the single most useful packages when it comes to PDFs in Linux is pdfjam. From the website: The installation is easy as always: apt-get install pdfjam PDF is not exactly the most easily editable format out there, but these tools can save you lots of time and trouble. Just recently I needed to merge two PDFs into one (and I didn't have any source format of the files). A simple pdfjoin foo1.pdf foo2.pdf --outfile bar.pdf does the job in a few seconds. Equally useful when you need to print huge documents is pdfnup --nup 2x2 foo.pdf, which sticks four PDF pages into one (thus drastically reducing the amount of pages you have to print)... Update 2006-09-20: As was noted by several people, pdftk is very cool, too. It can do some other things such as split PDFs, encrypt/decrypt them, manipulate metadata and more...

16 September 2006

Erich Schubert: SELinux is like TPM

To a certain extend, SELinux is like TPM. On one hand, it can be used to increase security of your system a lot. On the other hand, it can be used to lock you out some more. Like from your Linux-running Motorola phone. (Note: this phone is not running SELinux, but some other LSM) The combination of both of course increases security even more. I was wondering if I should maybe starting using these on the next server I install. Make a mini boot system with an SSHD and use the TPM module to secure this boot system. Then whenever the system is booted, I connect via SSH to type in the passphrase to unlock the encrypted disks. So when some police decides to seize a TOR server, they'll not be able to read any of the data, even when they seize the complete hardware. The only attack vector (apart from breaking crypto) I see is that they use the TPM to decrypt the boot systems sshd key, and then setup a modified boot system to capture my passphrase. They'll probably need more time to set that up than me to be informed the server was seized (or wonder why it's down). They're not exactly prepared for such defensive measures, I guess. OTOH, I'm not planning to setup any server anytime soon, and for a laptop using an encrypted harddrive should be enough. Maybe add some extra SELinux policy to defend against software bugs and maybe keyloggers. Uwe Hermann just measured the overhead and to me this doesn't look very bad. I mean... it will still be much faster than my current laptop, and this laptop is fast enough for me 99.9% of the time.

15 September 2006

Uwe Hermann: Benchmarking an encrypted dm-crypt/LVM/ext3/SELinux hard drive with bonnie++ and hdparm

I'm going to set up a new laptop system soonish (more on that later) which shall have a completely encrypted hard drive. Hence, I'm testing a few setups wrt security, performance, manageability and fault-tolerance. Here's a few performance tests I did on an 80 GB laptop hard drive (in an Intel Celeron based laptop, 1.7 GHz, 256 MB RAM, Linux 2.6.17, Debian unstable).
I ran bonnie++ (with no options) and hdparm as hdparm -tT /dev/hda each time. I haven't put too much thought into the test setup, so if I made some stupid mistakes, please let me know. Unencrypted plain ext3 partitions: bonnie++:
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
forest         432M 19857  84 21831  10  9536   4 16355  58 22165   3 148.8   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  1650  98 +++++ +++ +++++ +++  1734  98 +++++ +++  3820  96
forest,432M,19857,84,21831,10,9536,4,16355,58,22165,3,148.8,0,16,1650,98,+++++,+++,+++++,+++,1734,98,+++++,+++,3820,96
bonnie++ with SELinux:
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
forest         432M 20321  90 21036  13  9473   5 16742  61 21978   4 148.1   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  1398  98 +++++ +++ +++++ +++  1473  98 +++++ +++  3305  98
forest,432M,20321,90,21036,13,9473,5,16742,61,21978,4,148.1,0,16,1398,98,+++++,+++,+++++,+++,1473,98,+++++,+++,3305,98
hdparm:
 Timing cached reads:   1416 MB in  2.00 seconds = 707.48 MB/sec
 Timing buffered disk reads:   82 MB in  3.06 seconds =  26.80 MB/sec
hdparm with SELinux:
 Timing cached reads:   1404 MB in  2.00 seconds = 700.59 MB/sec
 Timing buffered disk reads:   80 MB in  3.02 seconds =  26.53 MB/sec
Ext3 partitions on top of LVM on top of dm-crypt: bonnie++:
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
forest         464M 11149  54 16660  20  6461   5  7472  58 11129   5 136.4   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  1564  98 +++++ +++ +++++ +++  1650  98 +++++ +++  2640  97
forest,464M,11149,54,16660,20,6461,5,7472,58,11129,5,136.4,0,16,1564,98,+++++,+++,+++++,+++,1650,98,+++++,+++,2640,97
bonnie++ with SELinux:
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
forest         464M  9878  52 12138  11  5457   6  6834  56 11037   5 137.2   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  1426  97 +++++ +++ +++++ +++  1451  98 +++++ +++  2433  97
forest,464M,9878,52,12138,11,5457,6,6834,56,11037,5,137.2,0,16,1426,97,+++++,+++,+++++,+++,1451,98,+++++,+++,2433,97
hdparm:
 Timing cached reads:   1408 MB in  2.00 seconds = 704.01 MB/sec
 Timing buffered disk reads:   80 MB in  3.02 seconds =  26.53 MB/sec
hdparm with SELinux:
 Timing cached reads:   1396 MB in  2.00 seconds = 698.06 MB/sec
 Timing buffered disk reads:   82 MB in  3.07 seconds =  26.69 MB/sec
So yes, there is some overhead, but it's nothing too serious, IMHO. And quite honestly, I don't care too much about performance here — security is more important than performance. I think you'll agree; if you don't agree now, you will agree with me on the very day someone steals your laptop ;-)

Uwe Hermann: Why voting machines suck and undermine democracy [Update]

If there are electronic voting machines where you live, and you've ever considered using one of those... well, you should probably reconsider. In this CNN report (M4V video, 13 MB) Avi Rubin explains why voting machines are a really, really bad idea. To quote some issues raised in the video: , especially so in such important scenarios) The CCC Berlin has a very detailed analysis of the topic (German), with many links to further articles. I'd recommend everyone to not use voting machines at all, but rather perform traditional pen-and-paper voting, if you value your vote... Also, make sure to inform relatives and friends about the risks of voting machines, and complain to your local responsible authorities, and ask them to remove these unreliable, insecure machines. Update 2006-09-18: Just in case you thought that maybe you can trust the Diebold machines after all - their locks can be opened with a standard hotel minibar key. (via The Lunatic Fringe)

13 September 2006

Erich Schubert: SELinux in etch progress

Just a quick update for SELinux in etch. With Manoj picking up work on it again (you might have noticed the large influx of new SELinux related packages these days, bringing our toolchain up to date again), and rjc having setup a SELinux development box for me, we're actually making some progress on SELinux for etch now. Uwe Hermann also blogged about SELinux on Debian recently. There are tons of small nuisances with SELinux on Debian left. I've started filing bugs and tagging them with the "selinux" usertag. It's in the details. For example mawk and gawk both try to ioctl any file they read as if it were a serial terminal. Which of course causes SELinux to log an audit error, since the init script or whichever was calling awk didn't have the permissions to ioctl a config file. Then there is /dev/xconsole - it's created by the syslogd init script (shouldn't maybe this be handled by udev), it's barely used by anyone, and SELinux policy upstream wants to keep it in the xserver policy, and claims its main use is to be able to feed it the output from programs started by the window manager (instead of .xsession-errors). Which is a seriously broken design, since it's not multiuser capable. Anyway, our current options are to Of course I was quickly flamed for filing a bug against exim stating that there currently is no SELinux policy for it, and people thus will have to use postfix or sendmail instead. But heck: people trying out SELinux on Debian will run into this problem, you know. I'd certainly prefer people to use exim instead of sendmail (I'm more of a postfix guy), but unless someone writes a policy for exim, people can't use it with SELinux. I have no idea how exim works (where its queues live, expected behaviour and so on), so I can't write a policy. Now to start a real flamewar - how about making postfix the new default MTA for Debian with etch? /me runs and hides.

12 September 2006

Uwe Hermann: Democracy Player 0.9.0 - one step closer to world do... a very cool Internet video/podcast application

Democracy Player 0.9 screenshot Democracy Player 0.9.0 has been released yesterday, which has been announced in quite a number of places already, e.g. Boing Boing. It's available for Mac, Windows, and Linux; if you're on Debian unstable the installation is as simple as apt-get install democracyplayer (I uploaded the new packages yesterday, they should have reached all mirrors by now). If you want to know what this is all about, but you're reluctant to install yet another program, check out this screencast (MOV, 37MB) which shows the basic functionality and user interface and discusses some of the new features... I think you'll like it. You can use it for all kinds of video blogs and podcasts, it'll download and play almost anything with an RSS feed.

11 September 2006

Uwe Hermann: Mac OS command line suckage

Situation: program foobar is running on a Mac OS box and on a Linux box. I verified that using "top" (I'm working in an 80x25 xterm btw). Now the funny part: Linux:
user@linux$ ps aux   grep foobar
root     xxxxx   x.x  x.x   xxxxx  xxxx  xx       xxx  xx:xx   x:xx /usr/sbin/foobar --some-options --more --options --even --more --options
Mac OS:
user@macos$ ps aux   grep foobar
Huh? What's going on? I know the program is running on both boxes! Mind-boggling solution after a long time of swearing and wasting time:
user@macos$ ps auxww   grep foobar
root     xxxxx   x.x  x.x   xxxxx  xxxx  xx       xxx  xx:xx   x:xx /usr/sbin/foobar --some-options --more --options --even --more --options
WTF? I mean... WTF??? Mac OS sticks the physical output on the terminal — 80 characters per line — into the pipe (instead of the full content). That's why the grep for "foobar" returns nothing - the "foobar" part is beyond the 80 character mark... So if I resize my terminal to 20x10, only 20 characters per line would go into the pipe?!? How stupid is that? Do all BSD-type OSes do that?

10 September 2006

Uwe Hermann: GPL confirmed in regular civil court in Germany

Good news for the Free Software world: From Harald Welte's blog, who started the gpl-violations.org project:
Today I have receive news that we've won the first regular civil court case on the GPL in Germany. This is really good news, since so far we've only had a hand full of preliminary injunctions been granted (and an appeal case against an injunction), but not a regular civil trial. The judge has ruled, but the details of the court order have not been publicised yet. I'll publicised the full details as soon as thus details are available in the next couple of weeks.
See also this Heise News article (German).

6 September 2006

Uwe Hermann: User-friendly SELinux policy editing in vim or Eclipse (using SLIDE)

SLIDE screenshot
SELinux file in vim After you have installed a minimum SELinux setup in QEMU, you might want to tweak and edit the policy to fit your needs. A nice, graphical method to do so is to use SLIDE, written by Tresys (and released under the terms of the GPL). SLIDE is an Eclipse (>= 3.1) plugin, which you can install easily: Of course, you can also easily use your favourite text-editor to edit the plain policy files (if you use the te.vim file from Thomas Bleher you get syntax highlighting, at least for *.te files). After placing the file in the ~/.vim/syntax directory, add this to your ~/.vimrc:
if has("autocmd")
  filetype plugin on
  augroup te
    autocmd BufRead,BufNewFile          *.te set filetype=te
  augroup END
endif

1 September 2006

Uwe Hermann: Security Engineering book available online for free

A great book about computer security is now available online for free — Ross Andersons Security Engineering (originally published 2001), and hence is now on my reading-list. I've recently read Practical Cryptography (by Niels Ferguson and Bruce Schneier) which is a must-read for everybody who even merely thinks about designing or implementing a crypto-protocol of any sort. If Security Engineering is only half as good as this book, it'll definately be well worth reading. (via Bruce Schneier)

30 August 2006

Uwe Hermann: LinuxBIOS Symposium 2006 Europe

For everybody who might be interested in this kind of stuff: the LinuxBIOS project's annual LinuxBIOS Symposium will take place October 1st-3rd, 2006 in the nice German city Hamburg. In the light of the recent discussions about "sourceless firmware" and similar issues in Debian, some people might be interesting in helping with (or at least getting informed about) a practical project related to this - a free (GPL'd) BIOS replacement. It's quite likely that some OLPC people will be there, too, as the OLPC (One Laptop Per Child) project employs LinuxBIOS on their hardware... Deadline for workshop and talk proposals is September 10th (if you should plan to give a talk), and a preliminary agenda is already available online. The registration process has also recently started (deadline is September 11th). See this post for the full announcement. Now, if I manage to somehow gather a reasonably large amount of Euros, I'll probably be there.

27 August 2006

Uwe Hermann: Testing stuff with QEMU - Part 1: SELinux support in Debian unstable [Update]

Here's a quick HOWTO to get you started with the QEMU emulator, the Debian installer (etch beta 3), and SELinux. If you execute the following steps you'll be left with an SELinux-enabled Debian unstable QEMU image, but not with a complete working and perfectly configured SELinux system. A more detailed article about SELinux will probably follow... Basic Debian unstable install in QEMU:
  1. Install QEMU:
    apt-get install qemu
  2. Download the latest Debian etch installer ISO image (etch beta 3, currently):
    wget http://cdimage.debian.org/cdimage/etch_di_beta3/i386/iso-cd/debian-testing-i386-binary-1.iso
  3. Create a QEMU image which will hold the Debian installation:
    qemu-img create -f qcow /path/to/debian.img 5000M
  4. Boot directly from the ISO image and install Debian into the QEMU image (I won't go into the details of the installation itself; Wolfang Lonien has nice HOWTOs for that: part 1, part 2, video):
    qemu -hda /path/to/debian.img -boot d -cdrom debian-testing-i386-binary-1.iso
  5. After the installation is done, configure the system, tweak /etc/apt/sources.list if needed, and then dist-upgrade to the latest stuff:
    apt-get update && apt-get dist-upgrade
  6. That's about it for the basic Debian install, you can now shutdown the OS and QEMU (type "halt" in the emulated Debian, wait for the shutdown to complete, press CTRL+ALT+2 to switch to the QEMU console, and type "quit").
Creating a QEMU overlay image: QEMU has a nice feature called overlay images which allows you to "clone" an image, where the new (overlay) image will only store the "diffs" to the original one, thus saving lots of space. This also allows you to remove the overlay image at any time and restart from the original image (which is nice for testing stuff which may break).
  1. Create an overlay image based on the previously installed Debian image:
    qemu-img create -b /path/to/debian.img -f qcow /path/to/debian_selinux_overlay.img
  2. Now boot into the new overlay image:
    qemu -hda /path/to/debian_selinux_overlay.img
Basic SELinux setup: SELinux / sestatus screenshot
  1. SELinux wants to label all the files on your system (all inodes actually), so your filesystem(s) need the so-called extended attributes (xattr) and "security labels" (both are kernel options) which most modern file systems now support. For ext3 (for example) you need these config options:
    CONFIG_EXT3_FS=y
    CONFIG_EXT3_FS_XATTR=y
    CONFIG_EXT3_FS_SECURITY=y
    Luckily the Debian kernels are xattr-enabled by default so we don't have to do anything at all here.
  2. Install the basic SELinux packages and the source package of the SELinux reference policy:
    apt-get install checkpolicy policycoreutils selinux-policy-refpolicy-src
  3. I noticed a bug in the current Debian packages (the setfiles utility is in the wrong place, see #384850), but there's a simple workaround:
    ln -s /sbin/setfiles /usr/sbin/setfiles
  4. Now we can (re-)label the file system:
    cd /etc/selinux/refpolicy/src/policy
    make relabel
    This will build the reference policy from source and relabel your file system (this will take a while).
    There might be some warnings (and maybe you'll notice further bugs), but they seem not to be critical.
  5. We can now (almost) enable SELinux, but before we can reboot we need to work around another bug (#384852), otherwise SELinux will not be enabled when we reboot:
    ln -s /etc/selinux/refpolicy/src /etc/selinux/targeted
  6. Now reboot the emulated Debian system, and at the GRUB console add the kernel option selinux=1 to enable SELinux in the kernel (press "e" to edit the boot options).
  7. You'll get tons of SELinux log messages while the system boots, that's normal at this point, don't worry.
    Then you can type "sestatus", which should print some information on the running SELinux system. If it says "SELinux status: disabled" something went wrong.
Congratulations! You now have a QEMU image with minimal SELinux support and you can start playing with it, tweaking the policy, finding and reporting bugs, reading tons of documentation on how SELinux actually works etc. etc. As SELinux is (half?) a release-goal for Debian etch, it would be nice if many people could test it before the release, and this is one method to do so without breaking your production systems. Update: You don't really need user_xattr support for SELinux, only xattr support (for security.selinux xattrs) for the filesystem you use, which is available per default in Debian kernels (thanks Russell Coker).

25 August 2006

Uwe Hermann: FSF/UNESCO Free Software Directory

It's strange that the FSF/UNESCO Free Software Directory project has managed to remain hidden from my eye until today...
The Free Software Directory is a project of the Free Software Foundation (FSF) and United Nations Education, Scientific and Cultural Organization (UNESCO). We catalog useful free software that runs under free operating systems particularly the GNU operating system and its GNU/Linux variants.
The main difference to similar software directories (Freshmeat, SourceForge, ...) is that "licenses are verified for each and every program listed in this directory", which is a good thing. If you've got too much time on your hands, here's an idea how to get rid of it and at the same time help the Free Software community...

24 August 2006

Uwe Hermann: Unmaintained Free Software is no longer... um... unmaintained

Just when I was thinking that the Unmaintained Free Software wiki was finally dead, Joey Hess mentioned it in his blog (thanks!), which (it seems) has resulted in a few new contributors (thanks!). In addition, I got motivated to work on it again; I had neglected the wiki for quite a while, partly because I was busy with tons of other projects (which I always am, so I guess that doesn't count), and partly also because it was a one-man project for a long time. Even after being mentioned on Slashdot, Newsforge and a bunch of other sites it never reached a state of halfway constant contributions from other people. But, it somehow survived while one or two similar projects I was aware of died away. As it's the only project of its kind which exists at the moment (to the best of my knowledge) and I really think it's a worthwhile cause, I'll continue searching and adding more projects , in the hope that some interested programmers take over maintainance of one or the other... Any help and contributions are of course very welcome! Joey: As for Xgalaga, it was not yet re-added after I switched from a custom-made CMS to a wiki, but it's there now. That'll hopefully increase it's chances to find a new maintainer ;)

21 August 2006

Uwe Hermann: Encrypted SMS Solutions?

Dear Lazyweb, I was recently thinking about SMS encryption (you know, the short messages sent from your cell phone). Or MMS encryption for that matter. Are there any Free Software solutions to implement such a thing, based on well-known crypto primitives and proven implementations thereof? From a quick glance I could not find anything usable, only lots of commercial, closed-source "solutions" which cost money and are basically crap. I was thinking about hacking together a small Java application (so that most modern phones can run it) which basically asks for a password and pipes your text through AES before sending the SMS. On the receiver's side, you enter the same password and get to see the plaintext. That's pretty much it. If you want something more elaborate you can use public-key crypto (basically embed GnuPG or similar into the application), but the above should be fine for most uses. Anyways, I do not want to start implementing something like this if there are other, more mature projects out there which do the same... Why you'd want to do this (other than simple paranoia, or the fact that governments and other institutions are spying on everyone these days, whether they're allowed to or not)? Well, one good reason for SMS encryption is when you're using some kind of SMS gateways, e.g. a website which gives you 2-3 free SMS per month if you sign up with them and give them tons of personal data. That alone is crappy enough, but you don't want their admins to be able to read and store all your SMSes in addition (which consist of simple plain-text, transmitted though HTTP in this case!). Neither should any local or remote scriptkiddy who knows how to use a sniffer be able to read your private SMSes. Solution: Write the text in your favorite text editor, pipe it through aespipe (for example), cut'n'paste the result in the web form of the SMS service. The receiver does everthing backwards and you're done.

19 August 2006

Uwe Hermann: OSI Fights Free Software License Proliferation

OSI's License Proliferation Committee has published a first draft report which categorizes Free Software (or Open Source, if you want) licenses. The categories are The charter of the committee states "[t]he purpose of the Committee is to identify and lessen or remove issues caused by license proliferation", which is a good thing, IMHO. I'm fed up with the recent trend that every company or organization invents their own "open source" license (often I would not even consider such licenses remotely open of free, but that's another issue). In total, the report categorizes 59 licenses into the above categories. I'm sure most people would agree that such a huge amount of licenses is totally useless and only creates confusion and problems. Please, if you have to decide on a Free Software license one of these days, choose a major, well-known one. Or even better, if you currently use a non-standard license in one of your projects, please consider switching to a more streamline license which fits your needs. Thanks! (via Heise)

Next.

Previous.