1.\" $NetBSD: veriexec.8,v 1.1 2008/02/18 10:37:20 elad Exp $ 2.\" 3.\" Copyright (c) 2008 Elad Efrat <elad@NetBSD.org> 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. The name of the author may not be used to endorse or promote products 15.\" derived from this software without specific prior written permission. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27.\" 28.Dd February 18, 2008 29.Dt VERIEXEC 8 30.Os 31.Sh NAME 32.Nm veriexec 33.Nd 34file integrity subsystem 35.Sh DESCRIPTION 36.Em Veriexec 37is an in-kernel, real-time, file-system independent, file integrity 38subsystem. 39It can be used for a variety of purposes, including defense against trojaned 40binaries, indirect attacks via third-party remote file-systems, and malicious 41configuration file corruption. 42.Sh CONFIGURATION 43.Ss Signatures Database 44.Em Veriexec 45requires a signatures database -- a list of monitored files, along with their 46digital fingerprint and (optionally) access modes. 47The format of this file is described by 48.Xr veriexec 5 . 49.Pp 50.Nx 51provides a tool, 52.Xr veriexecgen 8 , 53for generating the signatures database. 54Example usage: 55.Bd -literal -offset indent 56# veriexecgen 57.Ed 58.Pp 59Although it should be loaded on system boot (see 60.Dq RC Configuration 61below), this list can be loaded manually using 62.Xr veriexecctl 8 : 63.Bd -literal -offset indent 64# veriexecctl load 65.Ed 66.Ss Kernel Configuration 67.Em Veriexec 68requires a pseudo-device to run: 69.Bd -literal -offset indent 70pseudo-device veriexec 1 71.Ed 72.Pp 73Additionally, one or more options for digital fingerprint algorithm support: 74.Bd -literal -offset indent 75options VERIFIED_EXEC_FP_SHA256 76options VERIFIED_EXEC_FP_SHA512 77.Ed 78.Pp 79Some kernels already enable 80.Em Veriexec 81by default. 82See your kernel's config file for more information. 83.Pp 84.Ss RC Configuration 85.Em Veriexec 86also allows loading signatures and setting the strict level (see below) during 87the boot process using the following variables set in 88.Xr rc.conf 5 : 89.Bd -literal -offset indent 90veriexec=YES 91veriexec_strict=1 # IDS mode 92.Ed 93.Sh STRICT LEVELS 94.Em Veriexec 95can operate in four modes, also referred to as strict levels: 96.Bl -tag -width flag 97.It Learning mode ( strict level 0 ) 98The only level at which the fingerprint tables can be modified, this level is 99used to help fine-tune the signature database. 100No enforcement is made, and verbose information is provided (fingerprint 101matches and mismatches, file removals, incorrect access, etc.). 102.It IDS mode ( strict level 1 ) 103IDS (intrusion detection system) mode provides an adequate level of integrity 104for the files it monitors. 105Implications: 106.Pp 107.Bl -hyphen -compact 108.It 109Monitored files cannot be removed 110.It 111If raw disk access is granted to a disk with monitored files on it, all 112monitored files' fingerprints will be invalidated 113.It 114Access to files with mismatched fingerprints is denied 115.It 116Write access to monitored files is allowed 117.It 118Access type is not enforced 119.El 120.It IPS mode ( strict level 2 ) 121IPS (intrusion prevention system) mode provides a high level of integrity 122for the files it monitors. 123Implications: 124.Pp 125.Bl -hyphen -compact 126.It 127All implications of IDS mode 128.It 129Write access to monitored files is denied 130.It 131Access type is enforced 132.It 133Raw disk access to disk devices with monitored files on them is denied 134.It 135Execution of non-monitored files is denied 136.It 137Write access to kernel memory via 138.Pa /dev/mem 139and 140.Pa /dev/kmem 141is denied 142.El 143.It Lockdown mode ( strict level 3 ) 144Lockdown mode provides high assurance integrity for the entire system. 145Implications: 146.Pp 147.Bl -hyphen -compact 148.It 149All implications of IPS mode 150.It 151Access to non-monitored files is denied 152.It 153Write access to files is allowed only if the file was opened before the 154strict level was raised to this mode 155.It 156Creation of new files is denied 157.It 158Raw access to system disks is denied 159.El 160.El 161.Sh RUNTIME INFORMATION 162.Em Veriexec 163exports runtime information that may be useful for various purposes. 164.Pp 165It reports the currently supported fingerprinting algorithms, for example: 166.Bd -literal -offset indent 167# /sbin/sysctl kern.veriexec.algorithms 168kern.veriexec.algorithms = RMD160 SHA256 SHA384 SHA512 SHA1 MD5 169.Ed 170.Pp 171It reports the current verbosity and strict levels, for example: 172.Bd -literal -offset indent 173# /sbin/sysctl kern.veriexec.{verbose,strict} 174kern.veriexec.verbose = 0 175kern.veriexec.strict = 1 176.Ed 177.Pp 178It reports a summary of currently loaded files and the mount-points they're on, 179for example: 180.Bd -literal -offset indent 181# /sbin/sysctl kern.veriexec.count 182kern.veriexec.count.table0.mntpt = / 183kern.veriexec.count.table0.fstype = ffs 184kern.veriexec.count.table0.nentries = 33 185.Ed 186.Pp 187Other information may be retrieved using 188.Xr veriexecctl 8 . 189.Sh SEE ALSO 190.Xr options 4 , 191.Xr veriexec 5 , 192.Xr sysctl 7 , 193.Xr sysctl 8 , 194.Xr veriexecctl 8 , 195.Xr veriexecgen 8 196.Sh AUTHORS 197.An Elad Efrat Aq elad@NetBSD.org 198