Stephanie: Installation guide
-----------------------------
First, a little map of the files you have:

kern/
	kern_acl.c: Contains the core for the ACL mechanism. Required for:
			* Trusted Path Execution
			* Privacy
			* ld.so protection
		    Also depends on and requires kern_acl_syscall.c.

	kern_acl_syscall.c: The syscall interface to the ACL mechanism. 

	kern_k5.c: The core of the k5 feature. Required for:
			* k5
		    Also depends on and requires kern_k5_syscall.c.

	kern_k5_syscall.c: The syscall interface for the k5 feature.

	kern_sneek: Core of the execve() logging functionality. Required for:
			* Sneek
		    Also depends on and requires kern_sneek_syscall.c.

	kern_sneek_syscall: Syscall interface for Sneek.

sys/
	kern_acl.h: Header file for the ACL mechanism and also contains 
		    stuff needed by the ld.so protection.

	kern_tpe.h: Header file for TPE. Contains the trusted path 
		    verification macro.

	kern_k5.h: Header for k5.

	kern_sneek.h: Header for Sneek.

aclctl/
	Contains the userspace utility to manage the kernel's list of 
	trusted users. Type 'make' to compile. Has a man page.

k5ctl/
	Userspace utility for maintaining the kernel database of 
	programs/MD5 checksums. Type 'make' to compile. Has a man page.

ldctl/
	Little utility to toggle ld.so protection.

sneekctl/
	Program to control the way Sneek (execve() logging) operates.

doc/
	Contains documentation regarding the new Stephanie. Information 
	about design and other stuff is in there. Read!

ld.patch
	Patch file for ld.so protection. Should be applied from /usr/src/.

Stephanie-3.1.patch
	Patch file for Stephanie. Should be applied from /usr/src/.


First, you have to copy the files to their respective locations. We'll 
start with the source files:

	cp kern/* /usr/src/sys/kern/

Now the headers: (that also need to be copied to userspace)

	cp sys/* /usr/src/sys/sys/
	cp sys/* /usr/include/sys/

Once we're done with that, we need to patch the source tree:

	cp Stephanie-3.1.patch /usr/src/
	cd /usr/src/
	patch -p0 < Stephanie-3.1.patch

Since the patch also modifies the syscall table, let's regenerate it:

	cd /usr/src/sys/kern/
	make

Copy the updated files from the kernel source directory to userland, to 
have our utilities working:

	cp /usr/src/sys/syscall.h /usr/include/sys/
	cp /usr/src/sys/syscallargs.h /usr/include/sys/
	cp /usr/src/sys/sysctl.h /usr/include/sys/

So far so good. If you want the ld.so protection, you also need to:

	cp ld.patch /usr/src/
	cd /usr/src/
	patch -p0 < ld.patch
	<compile ld>

Now that everything is prepared, we can start working. You should edit 
/usr/src/sys/conf/GENERIC and (un)set any Stephanie-related options you 
want before recompiling the kernel. Compile your kernel and reboot:

	cd /usr/src/sys/arch/<your_arch>/conf
	config GENERIC
	cd ../compile/GENERIC
	make clean && make depend && make
	cp /bsd /bsd.old && cp bsd /bsd
	reboot

Wait for the system to come back up and compile the userland utilities you 
need by doing:

	cd <util_name>
	make && make install

If you want the ld.so protection, recompile ld:

	cd /usr/src/gnu/usr.bin/ld/rtld
	make depend && make && make install

IMPORTANT NOTE: If you set the K5_STRICT option in the kernel, compile 
k5ctl *BEFORE* recompiling and rebooting the new kernel! Otherwise you 
will lock yourself out of your own system. Make sure you manage everything 
related to the trusted programs database *BEFORE* you reboot the new 
kernel.

Now make sure everything works. Read the manuals for the userland programs 
and mess with them.

Send any bug reports, suggestions, etc., to brian (at) innu.org

