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