1*c86011f6Ssevan.\" $NetBSD: veriexec.8,v 1.8 2018/01/17 12:49:06 sevan Exp $ 252cf460aSelad.\" 352cf460aSelad.\" Copyright (c) 2008 Elad Efrat <elad@NetBSD.org> 452cf460aSelad.\" All rights reserved. 552cf460aSelad.\" 652cf460aSelad.\" Redistribution and use in source and binary forms, with or without 752cf460aSelad.\" modification, are permitted provided that the following conditions 852cf460aSelad.\" are met: 952cf460aSelad.\" 1. Redistributions of source code must retain the above copyright 1052cf460aSelad.\" notice, this list of conditions and the following disclaimer. 1152cf460aSelad.\" 2. Redistributions in binary form must reproduce the above copyright 1252cf460aSelad.\" notice, this list of conditions and the following disclaimer in the 1352cf460aSelad.\" documentation and/or other materials provided with the distribution. 1452cf460aSelad.\" 3. The name of the author may not be used to endorse or promote products 1552cf460aSelad.\" derived from this software without specific prior written permission. 1652cf460aSelad.\" 1752cf460aSelad.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1852cf460aSelad.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1952cf460aSelad.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2052cf460aSelad.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2152cf460aSelad.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2252cf460aSelad.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2352cf460aSelad.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2452cf460aSelad.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2552cf460aSelad.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2652cf460aSelad.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2752cf460aSelad.\" 28383c6761Ssevan.Dd September 13, 2017 2952cf460aSelad.Dt VERIEXEC 8 3052cf460aSelad.Os 3152cf460aSelad.Sh NAME 3252cf460aSelad.Nm veriexec 3352cf460aSelad.Nd 3452cf460aSeladfile integrity subsystem 3552cf460aSelad.Sh DESCRIPTION 3652cf460aSelad.Em Veriexec 3752cf460aSeladis an in-kernel, real-time, file-system independent, file integrity 3852cf460aSeladsubsystem. 3952cf460aSeladIt can be used for a variety of purposes, including defense against trojaned 4052cf460aSeladbinaries, indirect attacks via third-party remote file-systems, and malicious 4152cf460aSeladconfiguration file corruption. 4252cf460aSelad.Sh CONFIGURATION 4352cf460aSelad.Ss Signatures Database 4452cf460aSelad.Em Veriexec 4552cf460aSeladrequires a signatures database -- a list of monitored files, along with their 4652cf460aSeladdigital fingerprint and (optionally) access modes. 4752cf460aSeladThe format of this file is described by 4852cf460aSelad.Xr veriexec 5 . 4952cf460aSelad.Pp 5052cf460aSelad.Nx 5152cf460aSeladprovides a tool, 5252cf460aSelad.Xr veriexecgen 8 , 5352cf460aSeladfor generating the signatures database. 5452cf460aSeladExample usage: 5552cf460aSelad.Bd -literal -offset indent 5652cf460aSelad# veriexecgen 5752cf460aSelad.Ed 5852cf460aSelad.Pp 5952cf460aSeladAlthough it should be loaded on system boot (see 6052cf460aSelad.Dq RC Configuration 6152cf460aSeladbelow), this list can be loaded manually using 6252cf460aSelad.Xr veriexecctl 8 : 6352cf460aSelad.Bd -literal -offset indent 6452cf460aSelad# veriexecctl load 6552cf460aSelad.Ed 6652cf460aSelad.Ss Kernel Configuration 6752cf460aSelad.Em Veriexec 68*c86011f6Ssevanrequires a kernel with 69*c86011f6Ssevan.Xr fileassoc 9 70*c86011f6Ssevansupport and a pseudo-device to run: 7152cf460aSelad.Bd -literal -offset indent 72*c86011f6Ssevanoptions FILEASSOC 730096e719Ssevanpseudo-device veriexec 7452cf460aSelad.Ed 7552cf460aSelad.Pp 7652cf460aSeladAdditionally, one or more options for digital fingerprint algorithm support: 7752cf460aSelad.Bd -literal -offset indent 7852cf460aSeladoptions VERIFIED_EXEC_FP_SHA256 79383c6761Ssevanoptions VERIFIED_EXEC_FP_SHA384 8052cf460aSeladoptions VERIFIED_EXEC_FP_SHA512 8152cf460aSelad.Ed 8252cf460aSelad.Pp 8352cf460aSeladSome kernels already enable 8452cf460aSelad.Em Veriexec 8552cf460aSeladby default. 8652cf460aSeladSee your kernel's config file for more information. 8752cf460aSelad.Ss RC Configuration 8852cf460aSelad.Em Veriexec 8952cf460aSeladalso allows loading signatures and setting the strict level (see below) during 9052cf460aSeladthe boot process using the following variables set in 9152cf460aSelad.Xr rc.conf 5 : 9252cf460aSelad.Bd -literal -offset indent 9352cf460aSeladveriexec=YES 9452cf460aSeladveriexec_strict=1 # IDS mode 9552cf460aSelad.Ed 9652cf460aSelad.Sh STRICT LEVELS 9752cf460aSelad.Em Veriexec 9852cf460aSeladcan operate in four modes, also referred to as strict levels: 9952cf460aSelad.Bl -tag -width flag 10052cf460aSelad.It Learning mode ( strict level 0 ) 10152cf460aSeladThe only level at which the fingerprint tables can be modified, this level is 10252cf460aSeladused to help fine-tune the signature database. 10352cf460aSeladNo enforcement is made, and verbose information is provided (fingerprint 10452cf460aSeladmatches and mismatches, file removals, incorrect access, etc.). 10552cf460aSelad.It IDS mode ( strict level 1 ) 10652cf460aSeladIDS (intrusion detection system) mode provides an adequate level of integrity 10752cf460aSeladfor the files it monitors. 10852cf460aSeladImplications: 10952cf460aSelad.Pp 11052cf460aSelad.Bl -hyphen -compact 11152cf460aSelad.It 11252cf460aSeladMonitored files cannot be removed 11352cf460aSelad.It 11452cf460aSeladIf raw disk access is granted to a disk with monitored files on it, all 11552cf460aSeladmonitored files' fingerprints will be invalidated 11652cf460aSelad.It 11752cf460aSeladAccess to files with mismatched fingerprints is denied 11852cf460aSelad.It 11952cf460aSeladWrite access to monitored files is allowed 12052cf460aSelad.It 12152cf460aSeladAccess type is not enforced 12252cf460aSelad.El 12352cf460aSelad.It IPS mode ( strict level 2 ) 12452cf460aSeladIPS (intrusion prevention system) mode provides a high level of integrity 12552cf460aSeladfor the files it monitors. 12652cf460aSeladImplications: 12752cf460aSelad.Pp 12852cf460aSelad.Bl -hyphen -compact 12952cf460aSelad.It 13052cf460aSeladAll implications of IDS mode 13152cf460aSelad.It 13252cf460aSeladWrite access to monitored files is denied 13352cf460aSelad.It 13452cf460aSeladAccess type is enforced 13552cf460aSelad.It 13652cf460aSeladRaw disk access to disk devices with monitored files on them is denied 13752cf460aSelad.It 13852cf460aSeladExecution of non-monitored files is denied 13952cf460aSelad.It 14052cf460aSeladWrite access to kernel memory via 14152cf460aSelad.Pa /dev/mem 14252cf460aSeladand 14352cf460aSelad.Pa /dev/kmem 14452cf460aSeladis denied 14552cf460aSelad.El 14652cf460aSelad.It Lockdown mode ( strict level 3 ) 14752cf460aSeladLockdown mode provides high assurance integrity for the entire system. 14852cf460aSeladImplications: 14952cf460aSelad.Pp 15052cf460aSelad.Bl -hyphen -compact 15152cf460aSelad.It 15252cf460aSeladAll implications of IPS mode 15352cf460aSelad.It 15452cf460aSeladAccess to non-monitored files is denied 15552cf460aSelad.It 15652cf460aSeladWrite access to files is allowed only if the file was opened before the 15752cf460aSeladstrict level was raised to this mode 15852cf460aSelad.It 15952cf460aSeladCreation of new files is denied 16052cf460aSelad.It 16152cf460aSeladRaw access to system disks is denied 16252cf460aSelad.El 16352cf460aSelad.El 16452cf460aSelad.Sh RUNTIME INFORMATION 16552cf460aSelad.Em Veriexec 16652cf460aSeladexports runtime information that may be useful for various purposes. 16752cf460aSelad.Pp 16852cf460aSeladIt reports the currently supported fingerprinting algorithms, for example: 16952cf460aSelad.Bd -literal -offset indent 17052cf460aSelad# /sbin/sysctl kern.veriexec.algorithms 171684872c7Ssevankern.veriexec.algorithms = SHA256 SHA384 SHA512 17252cf460aSelad.Ed 17352cf460aSelad.Pp 17452cf460aSeladIt reports the current verbosity and strict levels, for example: 17552cf460aSelad.Bd -literal -offset indent 17652cf460aSelad# /sbin/sysctl kern.veriexec.{verbose,strict} 17752cf460aSeladkern.veriexec.verbose = 0 17852cf460aSeladkern.veriexec.strict = 1 17952cf460aSelad.Ed 18052cf460aSelad.Pp 18152cf460aSeladIt reports a summary of currently loaded files and the mount-points they're on, 18252cf460aSeladfor example: 18352cf460aSelad.Bd -literal -offset indent 18452cf460aSelad# /sbin/sysctl kern.veriexec.count 18552cf460aSeladkern.veriexec.count.table0.mntpt = / 18652cf460aSeladkern.veriexec.count.table0.fstype = ffs 18752cf460aSeladkern.veriexec.count.table0.nentries = 33 18852cf460aSelad.Ed 18952cf460aSelad.Pp 19052cf460aSeladOther information may be retrieved using 19152cf460aSelad.Xr veriexecctl 8 . 19252cf460aSelad.Sh SEE ALSO 19352cf460aSelad.Xr options 4 , 19452cf460aSelad.Xr veriexec 5 , 19552cf460aSelad.Xr sysctl 7 , 19652cf460aSelad.Xr sysctl 8 , 19752cf460aSelad.Xr veriexecctl 8 , 19852cf460aSelad.Xr veriexecgen 8 19952cf460aSelad.Sh AUTHORS 200a5684d07Swiz.An Elad Efrat Aq Mt elad@NetBSD.org 201