1 .\" $NetBSD: veriexec.4,v 1.19 2008/02/10 19:32:23 elad Exp $
3 .\" Copyright 2005 Elad Efrat <elad@bsd.org.il>
4 .\" Copyright 2005 Brett Lymn <blymn@netbsd.org>
6 .\" This code is donated to The NetBSD Foundation by the author.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. The name of the Author may not be used to endorse or promote
14 .\" products derived from this software without specific prior written
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd Veriexec pseudo-device
36 .Cd pseudo-device veriexec
39 verifies the integrity of specified executables and files before they are
41 This makes it much more difficult to insert a trojan horse into the system
42 and also makes it more difficult to run binaries that are not supposed to
43 be running, for example, packet sniffers, DDoS clients and so on.
47 pseudo-device is used to load and delete entries to and from the in-kernel
49 databases, as well as query information about them.
50 It can also be used to dump the entire database.
51 .Ss Kernel-userland interaction
55 for communication between the kernel and userland.
58 Load an entry for a file to be monitored by
61 The dictionary passed contains the following elements:
62 .Bl -column entryxtype string
63 .It Sy Name Type Purpose
64 .It file string filename for this entry
65 .It entry-type uint8 entry type ( see below )
66 .It fp-type string fingerprint hashing algorithm
67 .It fp data the fingerprint
71 can be one or more (binary-OR'd) of the following:
72 .Bl -column veriexecxuntrusted effect
74 .It Dv VERIEXEC_DIRECT can execute directly
75 .It Dv VERIEXEC_INDIRECT can execute indirectly (interpreter, Xr mmap 2 )
76 .It Dv VERIEXEC_FILE can be opened
77 .It Dv VERIEXEC_UNTRUSTED located on untrusted storage
79 .It Dv VERIEXEC_DELETE
80 Removes either an entry for a single file or entries for an entire mount from
83 The dictionary passed contains the following elements:
84 .Bl -column file string
85 .It Sy Name Type Purpose
86 .It file string filename or mount-point
91 monitored files database from the kernel.
93 Only files that the filename is kept for them will be dumped.
94 The returned array contains dictionaries with the following elements:
95 .Bl -column entryxtype string
96 .It Sy Name Type Purpose
97 .It file string filename
98 .It fp-type string fingerprint hashing algorithm
99 .It fp data the fingerprint
100 .It entry-type uint8 entry type ( see above )
102 .It Dv VERIEXEC_FLUSH
105 database, removing all entries.
107 This command has no parameters.
108 .It Dv VERIEXEC_QUERY
111 about a file, returning information that may be useful about it.
113 The dictionary passed contains the following elements:
114 .Bl -column file string
115 .It Sy Name Type Purpose
116 .It file string filename
119 The dictionary returned contains the following elements:
120 .Bl -column entryxtype string
121 .It Sy Name Type Purpose
122 .It entry-type uint8 entry type ( see above )
123 .It status uint8 entry status
124 .It fp-type string fingerprint hashing algorithm
125 .It fp data the fingerprint
129 can be one of the following:
130 .Bl -column fingerprintxmismatch effect
131 .It Sy Status Meaning
132 .It Dv FINGERPRINT_NOTEVAL not evaluated
133 .It Dv FINGERPRINT_VALID fingerprint match
134 .It Dv FINGERPRINT_MISMATCH fingerprint mismatch
138 Note that the requests
140 .Dv VERIEXEC_DELETE ,
143 are not permitted once the strict level has been raised past 0.
154 is part of the default configuration on the following architectures: amd64,
157 .An Brett Lymn Aq blymn@NetBSD.org
158 .An Elad Efrat Aq elad@NetBSD.org