I was planning to set up my laptop from scratch for a while now... so I did.
MD5SUMS and MD5SUMS.sign files:
wget http://cdimage.debian.org/cdimage/etch_di_beta3/i386/iso-cd/debian-testing-i386-binary-1.iso
wget http://cdimage.debian.org/cdimage/etch_di_beta3/i386/iso-cd/MD5SUMS
wget http://cdimage.debian.org/cdimage/etch_di_beta3/i386/iso-cd/MD5SUMS.sign
gpg --verify MD5SUMS.sign, which will fail but tell you the signing key ID (88C7C1F7 in this case). Get the key and re-run the verification: gpg --recv-key --keyserver subkeys.pgp.net 88C7C1F7 && gpg --verify MD5SUMS.sign. The output should now say "Good signature from [...]".
md5sum -c MD5SUMS. The output should contain debian-testing-i386-binary-1.iso: OK.wodim debian-testing-i386-binary-1.iso./boot (ext3) as primary partition, and make the rest of the hard drive one huge partition which has "Use as:" set to "physical volume for encryption"./boot reside on a dm-crypt device)! Never set up unencrypted swap!/root and /home/uwe. Log out and log in again to make ~/.bashrc and ~/.inputrc take effect.mkdir /etc/rc.boot && cp fw_laptop /etc/rc.boot && chmod 700 /etc/rc.boot/fw_laptop && sh /etc/rc.boot/fw_laptop/etc/init.d/foo stop.chmod 700 /root /home/uwe./etc/passwd: give all users except for root, sync, uucp and your user account /usr/sbin/nologin as login shell. None of these accounts really needs a valid login shell (nologin will log any login attempts for those accounts)./etc/group: remove your user account from the dialout, cdrom, and floppy group. The groups audio, video, and plugdev can stay./etc/fstab: add some mount options such as ro, nosuid, noexec, or nodev as you see fit. Example:/dev/mapper/vg--whole-lv--root / ext3 defaults,errors=remount-ro 0 0 /dev/sda2 /boot ext3 defaults,nodev,nosuid,noexec,ro 0 0 /dev/mapper/vg--whole-lv--home /home ext3 defaults,nodev,nosuid 0 0 /dev/mapper/vg--whole-lv--tmp /tmp ext3 defaults,nodev,nosuid 0 0 /dev/mapper/vg--whole-lv--usr /usr ext3 defaults,nodev,ro 0 0 /dev/mapper/vg--whole-lv--var /var ext3 defaults,nodev 0 0 /dev/mapper/vg--whole-lv--swap none swap sw 0 0 /dev/scd0 /media/cdrom iso9660 noauto,nodev,nosuid,noexec,uid=uwe,gid=uwe 0 0
ro) file systems, configure Apt so that it can remount them read-write when installing/removing packages. Add this to /etc/apt/apt.conf:
DPkg
{
Pre-Invoke { "mount -o remount,rw /usr; mount -o remount,rw /boot"; }
Post-Invoke { "mount -o remount,ro /usr; mount -o remount,ro /boot"; }
}
password foo" line (which contains the GRUB password in plain-text) from your /boot/grub/menu.lst with a "password --md5 $1$1234567890..." line, where the MD5 hash ($1$1234567890...) can be generated with grub-md5-crypt. Additionally, add such a password line after each "title" line in the GRUB config-file, so that nobody can boot any OS installed on the laptop without a password!/etc/network/interfaces:auto eth0 iface eth0 inet dhcp pre-up /etc/rc.boot/fw_laptop
Run /etc/init.d/networking restart. The firewall script will run every time the network is started.
/etc/apt/sources.list:
deb http://ftp.de.debian.org/debian unstable main
deb-src http://ftp.de.debian.org/debian unstable main
apt-get update && apt-get dist-upgrade. All packages are GnuPG-signed and will be verified by Apt. The installer already ships the required key (for 2006), so everything should just work. Still, you should read about SecureApt.sysv-rc-conf to disable all daemons you don't want to start per default: sysv-rc-conf foo off.apt-get install samhain. You want to be notified if your system files are being tampered with (e.g. replaced by a rootkit).Now install and set up SELinux. This section is based on notes from Erich Schubert (thanks!), and will soon appear in the SELinuxSetup wiki page, too.
apt-get install selinux-basics selinux-policy-refpolicy-targeted./boot/grub/menu.lst and add selinux=1 to your kernel command line to enable SELinux upon booting./etc/pam.d/login uncomment the "session required pam_selinux.so multiple" line. Do the same in /etc/pam.d/ssh if you have ssh installed./etc/default/rcS set FSCKFIX=yes./etc/init.d/bootmisc.sh search for "Update motd" and comment the two lines below that line. Then rm /var/run/motd.n" in /etc/postfix/master.cf and execute echo 'SYNC_CHROOT="n" >> /etc/default/postfix').check-selinux-installation to check for common SELinux problems on Debian (such as the above mentioned).touch /.autorelabel. Reboot. touch /.autorelabel (again). Reboot (again).setenforce 1 or by adding enforcing=1 to the kernel command line in /boot/grub/menu.lst./boot partition is still unencrypted, so an attacker can tamper with it. Boot from a CD-R, forbid booting from hard drive (BIOS). Sign/mark the CD-R physically, so you'll know when someone replaced your CD-R with his own, back-doored one.qemu -snapshot -net none foo.img.That's it. You can take off that stupid tin-foil hat now.
Update 2006-09-29: Fixed typos. Mentioned sxid. Added two-factor authentication.
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 now 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...
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:
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)
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:
Help->Software Updates->Find and install...Search for new features to install, then New remote sitehttp://www.tresys.com/files/eclipse-update/" as URL, click Finish.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
Update: "Testing stuff with QEMU"-articles published so far:
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:
apt-get install qemu
wget http://cdimage.debian.org/cdimage/etch_di_beta3/i386/iso-cd/debian-testing-i386-binary-1.iso
qemu-img create -f qcow /path/to/debian.img 5000M
qemu -hda /path/to/debian.img -boot d -cdrom debian-testing-i386-binary-1.iso
/etc/apt/sources.list if needed, and then dist-upgrade to the latest stuff:apt-get update && apt-get dist-upgrade
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).
qemu-img create -b /path/to/debian.img -f qcow /path/to/debian_selinux_overlay.img
qemu -hda /path/to/debian_selinux_overlay.img
Basic SELinux setup:
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.
apt-get install checkpolicy policycoreutils selinux-policy-refpolicy-src
setfiles utility is in the wrong place, see #384850), but there's a simple workaround:ln -s /sbin/setfiles /usr/sbin/setfiles
cd /etc/selinux/refpolicy/src/policymake relabelln -s /etc/selinux/refpolicy/src /etc/selinux/targeted
selinux=1 to enable SELinux in the kernel (press "e" to edit the boot options).
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 2006-08-28: 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).
Recent comments
21 weeks 2 days ago
47 weeks 3 days ago
1 year 2 weeks ago
1 year 3 weeks ago
1 year 3 weeks ago