1.\" $NetBSD: veriexec.8,v 1.4 2014/03/18 18:20:40 riastradh 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.Ss RC Configuration 84.Em Veriexec 85also allows loading signatures and setting the strict level (see below) during 86the boot process using the following variables set in 87.Xr rc.conf 5 : 88.Bd -literal -offset indent 89veriexec=YES 90veriexec_strict=1 # IDS mode 91.Ed 92.Sh STRICT LEVELS 93.Em Veriexec 94can operate in four modes, also referred to as strict levels: 95.Bl -tag -width flag 96.It Learning mode ( strict level 0 ) 97The only level at which the fingerprint tables can be modified, this level is 98used to help fine-tune the signature database. 99No enforcement is made, and verbose information is provided (fingerprint 100matches and mismatches, file removals, incorrect access, etc.). 101.It IDS mode ( strict level 1 ) 102IDS (intrusion detection system) mode provides an adequate level of integrity 103for the files it monitors. 104Implications: 105.Pp 106.Bl -hyphen -compact 107.It 108Monitored files cannot be removed 109.It 110If raw disk access is granted to a disk with monitored files on it, all 111monitored files' fingerprints will be invalidated 112.It 113Access to files with mismatched fingerprints is denied 114.It 115Write access to monitored files is allowed 116.It 117Access type is not enforced 118.El 119.It IPS mode ( strict level 2 ) 120IPS (intrusion prevention system) mode provides a high level of integrity 121for the files it monitors. 122Implications: 123.Pp 124.Bl -hyphen -compact 125.It 126All implications of IDS mode 127.It 128Write access to monitored files is denied 129.It 130Access type is enforced 131.It 132Raw disk access to disk devices with monitored files on them is denied 133.It 134Execution of non-monitored files is denied 135.It 136Write access to kernel memory via 137.Pa /dev/mem 138and 139.Pa /dev/kmem 140is denied 141.El 142.It Lockdown mode ( strict level 3 ) 143Lockdown mode provides high assurance integrity for the entire system. 144Implications: 145.Pp 146.Bl -hyphen -compact 147.It 148All implications of IPS mode 149.It 150Access to non-monitored files is denied 151.It 152Write access to files is allowed only if the file was opened before the 153strict level was raised to this mode 154.It 155Creation of new files is denied 156.It 157Raw access to system disks is denied 158.El 159.El 160.Sh RUNTIME INFORMATION 161.Em Veriexec 162exports runtime information that may be useful for various purposes. 163.Pp 164It reports the currently supported fingerprinting algorithms, for example: 165.Bd -literal -offset indent 166# /sbin/sysctl kern.veriexec.algorithms 167kern.veriexec.algorithms = RMD160 SHA256 SHA384 SHA512 SHA1 MD5 168.Ed 169.Pp 170It reports the current verbosity and strict levels, for example: 171.Bd -literal -offset indent 172# /sbin/sysctl kern.veriexec.{verbose,strict} 173kern.veriexec.verbose = 0 174kern.veriexec.strict = 1 175.Ed 176.Pp 177It reports a summary of currently loaded files and the mount-points they're on, 178for example: 179.Bd -literal -offset indent 180# /sbin/sysctl kern.veriexec.count 181kern.veriexec.count.table0.mntpt = / 182kern.veriexec.count.table0.fstype = ffs 183kern.veriexec.count.table0.nentries = 33 184.Ed 185.Pp 186Other information may be retrieved using 187.Xr veriexecctl 8 . 188.Sh SEE ALSO 189.Xr options 4 , 190.Xr veriexec 5 , 191.Xr sysctl 7 , 192.Xr sysctl 8 , 193.Xr veriexecctl 8 , 194.Xr veriexecgen 8 195.Sh AUTHORS 196.An Elad Efrat Aq Mt elad@NetBSD.org 197