2009-03-11 17:00:29 +03:00
|
|
|
.\" $NetBSD: veriexecgen.8,v 1.16 2009/03/11 14:00:29 joerg Exp $
|
2006-09-17 00:54:42 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Matt Fleming.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2008-02-18 13:37:19 +03:00
|
|
|
.Dd February 18, 2008
|
2006-09-17 00:54:42 +04:00
|
|
|
.Dt VERIEXECGEN 8
|
2009-03-11 17:00:29 +03:00
|
|
|
.Os
|
2006-09-17 00:54:42 +04:00
|
|
|
.Sh NAME
|
2006-09-17 05:02:30 +04:00
|
|
|
.Nm veriexecgen
|
2006-09-17 00:54:42 +04:00
|
|
|
.Nd generate fingerprints for Veriexec
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
Some Veriexec stuff that's been rotting in my tree for months.
Bug fixes:
- Fix crash reported by Scott Ellis on current-users@.
- Fix race conditions in enforcing the Veriexec rename and remove
policies. These are NOT security issues.
- Fix memory leak in rename handling when overwriting a monitored
file.
- Fix table deletion logic.
- Don't prevent query requests if not in learning mode.
KPI updates:
- fileassoc_table_run() now takes a cookie to pass to the callback.
- veriexec_table_add() was removed, it is now done internally. As a
result, there's no longer a need for VERIEXEC_TABLESIZE.
- veriexec_report() was removed, it is now internal.
- Perform sanity checks on the entry type, and enforce default type
in veriexec_file_add() rather than in veriexecctl.
- Add veriexec_flush(), used to delete all Veriexec tables, and
veriexec_dump(), used to fill an array with all Veriexec entries.
New features:
- Add a '-k' flag to veriexecctl, to keep the filenames in the kernel
database. This allows Veriexec to produce slightly more accurate
logs under certain circumstances. In the future, this can be either
replaced by vnode->pathname translation, or combined with it.
- Add a VERIEXEC_DUMP ioctl, to dump the entire Veriexec database.
This can be used to recover a database if the file was lost.
Example usage:
# veriexecctl dump > /etc/signatures
Note that only entries with the filename kept (that is, were loaded
with the '-k' flag) will be dumped.
Idea from Brett Lymn.
- Add a VERIEXEC_FLUSH ioctl, to delete all Veriexec entries. Sample
usage:
# veriexecctl flush
- Add a 'veriexec_flags' rc(8) variable, and make its default have
the '-k' flag. On systems using the default signatures file
(generaetd from running 'veriexecgen' with no arguments), this will
use additional 32kb of kernel memory on average.
- Add a '-e' flag to veriexecctl, to evaluate the fingerprint during
load. This is done automatically for files marked as 'untrusted'.
Misc. stuff:
- The code for veriexecctl was massively simplified as a result of
eliminating the need for VERIEXEC_TABLESIZE, and now uses a single
pass of the signatures file, making the loading somewhat faster.
- Lots of minor fixes found using the (still under development)
Veriexec regression testsuite.
- Some of the messages Veriexec prints were improved.
- Various documentation fixes.
All relevant man-pages were updated to reflect the above changes.
Binary compatibility with existing veriexecctl binaries is maintained.
2007-05-15 23:47:43 +04:00
|
|
|
.Op Fl AaDrSTvW
|
2006-09-17 00:54:42 +04:00
|
|
|
.Op Fl d Pa dir
|
|
|
|
.Op Fl o Pa fingerprintdb
|
2006-12-20 00:21:28 +03:00
|
|
|
.Op Fl p Pa prefix
|
2006-09-17 05:02:30 +04:00
|
|
|
.Op Fl t Ar algorithm
|
2006-09-17 00:54:42 +04:00
|
|
|
.Nm
|
|
|
|
.Op Fl h
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
Some Veriexec stuff that's been rotting in my tree for months.
Bug fixes:
- Fix crash reported by Scott Ellis on current-users@.
- Fix race conditions in enforcing the Veriexec rename and remove
policies. These are NOT security issues.
- Fix memory leak in rename handling when overwriting a monitored
file.
- Fix table deletion logic.
- Don't prevent query requests if not in learning mode.
KPI updates:
- fileassoc_table_run() now takes a cookie to pass to the callback.
- veriexec_table_add() was removed, it is now done internally. As a
result, there's no longer a need for VERIEXEC_TABLESIZE.
- veriexec_report() was removed, it is now internal.
- Perform sanity checks on the entry type, and enforce default type
in veriexec_file_add() rather than in veriexecctl.
- Add veriexec_flush(), used to delete all Veriexec tables, and
veriexec_dump(), used to fill an array with all Veriexec entries.
New features:
- Add a '-k' flag to veriexecctl, to keep the filenames in the kernel
database. This allows Veriexec to produce slightly more accurate
logs under certain circumstances. In the future, this can be either
replaced by vnode->pathname translation, or combined with it.
- Add a VERIEXEC_DUMP ioctl, to dump the entire Veriexec database.
This can be used to recover a database if the file was lost.
Example usage:
# veriexecctl dump > /etc/signatures
Note that only entries with the filename kept (that is, were loaded
with the '-k' flag) will be dumped.
Idea from Brett Lymn.
- Add a VERIEXEC_FLUSH ioctl, to delete all Veriexec entries. Sample
usage:
# veriexecctl flush
- Add a 'veriexec_flags' rc(8) variable, and make its default have
the '-k' flag. On systems using the default signatures file
(generaetd from running 'veriexecgen' with no arguments), this will
use additional 32kb of kernel memory on average.
- Add a '-e' flag to veriexecctl, to evaluate the fingerprint during
load. This is done automatically for files marked as 'untrusted'.
Misc. stuff:
- The code for veriexecctl was massively simplified as a result of
eliminating the need for VERIEXEC_TABLESIZE, and now uses a single
pass of the signatures file, making the loading somewhat faster.
- Lots of minor fixes found using the (still under development)
Veriexec regression testsuite.
- Some of the messages Veriexec prints were improved.
- Various documentation fixes.
All relevant man-pages were updated to reflect the above changes.
Binary compatibility with existing veriexecctl binaries is maintained.
2007-05-15 23:47:43 +04:00
|
|
|
can be used to create a fingerprint database for use with
|
|
|
|
.Em Veriexec .
|
2006-09-17 00:54:42 +04:00
|
|
|
.Pp
|
2006-09-17 14:14:36 +04:00
|
|
|
If no command line arguments were specified,
|
2006-09-17 00:54:42 +04:00
|
|
|
.Nm
|
2006-09-17 14:14:36 +04:00
|
|
|
will resort to default operation, implying
|
|
|
|
.Fl D Fl o Ar /etc/signatures Fl t Ar sha256 .
|
2006-09-17 00:54:42 +04:00
|
|
|
.Pp
|
|
|
|
If the output file already exists,
|
|
|
|
.Nm
|
|
|
|
will save a backup copy in the same file only with a
|
|
|
|
.Dq .old
|
|
|
|
suffix.
|
|
|
|
.Pp
|
|
|
|
The following options are available:
|
2009-03-11 17:00:29 +03:00
|
|
|
.Bl -tag -width ".Fl p Ar prefix"
|
2006-09-17 00:54:42 +04:00
|
|
|
.It Fl A
|
|
|
|
Append to the output file, don't overwrite it.
|
|
|
|
.It Fl a
|
|
|
|
Add fingerprints for non-executable files as well.
|
|
|
|
.It Fl D
|
2006-09-17 05:02:30 +04:00
|
|
|
Search system directories,
|
2006-09-17 00:54:42 +04:00
|
|
|
.Pa /bin ,
|
|
|
|
.Pa /sbin ,
|
|
|
|
.Pa /usr/bin ,
|
|
|
|
.Pa /usr/sbin ,
|
2006-09-23 23:08:48 +04:00
|
|
|
.Pa /lib ,
|
|
|
|
.Pa /usr/lib ,
|
|
|
|
.Pa /libexec ,
|
2006-09-17 00:54:42 +04:00
|
|
|
and
|
2006-09-23 23:08:48 +04:00
|
|
|
.Pa /usr/libexec .
|
2006-09-17 00:54:42 +04:00
|
|
|
.It Fl d Ar dir
|
|
|
|
Scan for files in
|
|
|
|
.Ar dir .
|
|
|
|
Multiple uses of this flag can specify more than one directory.
|
|
|
|
.\" .It Fl F
|
|
|
|
.\" Try to guess the correct flags for every file.
|
|
|
|
.It Fl h
|
|
|
|
Display the help screen.
|
|
|
|
.It Fl o Ar fingerprintdb
|
|
|
|
Save the generated fingerprint database to
|
|
|
|
.Ar fingerprintdb .
|
2006-12-20 00:21:28 +03:00
|
|
|
.It Fl p Ar prefix
|
|
|
|
When storing files in the fingerprint database,
|
|
|
|
store the full pathnames of files with the leading
|
|
|
|
.Dq prefix
|
|
|
|
of the filenames removed.
|
2006-09-17 00:54:42 +04:00
|
|
|
.It Fl r
|
|
|
|
Scan recursively.
|
2006-09-18 21:47:25 +04:00
|
|
|
.It Fl S
|
|
|
|
Set the immutable flag on the created signatures file when done writing it.
|
Some Veriexec stuff that's been rotting in my tree for months.
Bug fixes:
- Fix crash reported by Scott Ellis on current-users@.
- Fix race conditions in enforcing the Veriexec rename and remove
policies. These are NOT security issues.
- Fix memory leak in rename handling when overwriting a monitored
file.
- Fix table deletion logic.
- Don't prevent query requests if not in learning mode.
KPI updates:
- fileassoc_table_run() now takes a cookie to pass to the callback.
- veriexec_table_add() was removed, it is now done internally. As a
result, there's no longer a need for VERIEXEC_TABLESIZE.
- veriexec_report() was removed, it is now internal.
- Perform sanity checks on the entry type, and enforce default type
in veriexec_file_add() rather than in veriexecctl.
- Add veriexec_flush(), used to delete all Veriexec tables, and
veriexec_dump(), used to fill an array with all Veriexec entries.
New features:
- Add a '-k' flag to veriexecctl, to keep the filenames in the kernel
database. This allows Veriexec to produce slightly more accurate
logs under certain circumstances. In the future, this can be either
replaced by vnode->pathname translation, or combined with it.
- Add a VERIEXEC_DUMP ioctl, to dump the entire Veriexec database.
This can be used to recover a database if the file was lost.
Example usage:
# veriexecctl dump > /etc/signatures
Note that only entries with the filename kept (that is, were loaded
with the '-k' flag) will be dumped.
Idea from Brett Lymn.
- Add a VERIEXEC_FLUSH ioctl, to delete all Veriexec entries. Sample
usage:
# veriexecctl flush
- Add a 'veriexec_flags' rc(8) variable, and make its default have
the '-k' flag. On systems using the default signatures file
(generaetd from running 'veriexecgen' with no arguments), this will
use additional 32kb of kernel memory on average.
- Add a '-e' flag to veriexecctl, to evaluate the fingerprint during
load. This is done automatically for files marked as 'untrusted'.
Misc. stuff:
- The code for veriexecctl was massively simplified as a result of
eliminating the need for VERIEXEC_TABLESIZE, and now uses a single
pass of the signatures file, making the loading somewhat faster.
- Lots of minor fixes found using the (still under development)
Veriexec regression testsuite.
- Some of the messages Veriexec prints were improved.
- Various documentation fixes.
All relevant man-pages were updated to reflect the above changes.
Binary compatibility with existing veriexecctl binaries is maintained.
2007-05-15 23:47:43 +04:00
|
|
|
.It Fl T
|
|
|
|
Put a timestamp on the generated file.
|
2006-09-17 00:54:42 +04:00
|
|
|
.It Fl t Ar algorithm
|
|
|
|
Use
|
|
|
|
.Ar algorithm
|
|
|
|
for the fingerprints.
|
|
|
|
Must be one of
|
|
|
|
.Dq md5 ,
|
|
|
|
.Dq sha1 ,
|
|
|
|
.Dq sha256 ,
|
|
|
|
.Dq sha384 ,
|
|
|
|
.Dq sha512 ,
|
|
|
|
or
|
|
|
|
.Dq rmd160 .
|
|
|
|
.It Fl v
|
|
|
|
Verbose mode.
|
|
|
|
Print messages describing what operations are being done.
|
2006-12-04 10:06:56 +03:00
|
|
|
.It Fl W
|
|
|
|
By default,
|
|
|
|
.Nm
|
|
|
|
will exit when an error condition is encountered.
|
|
|
|
This option will
|
|
|
|
treat errors such as not being able to follow a symbolic link,
|
|
|
|
not being able to find the real path for a directory entry, or
|
|
|
|
not being able to calculate a hash of an entry as a warning,
|
|
|
|
rather than an error.
|
|
|
|
If errors are treated as warnings,
|
|
|
|
.Nm
|
|
|
|
will continue processing.
|
|
|
|
The default behaviour is to treat errors as fatal.
|
2006-09-17 00:54:42 +04:00
|
|
|
.El
|
2006-09-17 14:27:54 +04:00
|
|
|
.Sh FILES
|
|
|
|
.Pa /etc/signatures
|
2006-09-17 01:41:59 +04:00
|
|
|
.Sh EXAMPLES
|
|
|
|
Fingerprint files in the common system directories using the default hashing
|
|
|
|
algorithm
|
|
|
|
.Dq sha256
|
2006-09-17 14:14:36 +04:00
|
|
|
and save to the default fingerprint database in
|
|
|
|
.Pa /etc/signatures :
|
2006-09-17 05:02:30 +04:00
|
|
|
.Bd -literal -offset indent
|
2006-09-17 14:14:36 +04:00
|
|
|
# veriexecgen
|
2006-09-17 01:41:59 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Fingerprint files in
|
|
|
|
.Pa /etc ,
|
|
|
|
appending to the default fingerprint database:
|
2006-09-17 14:14:36 +04:00
|
|
|
.Bd -literal -offset indent
|
2006-09-17 01:41:59 +04:00
|
|
|
# veriexecgen -A -d /etc
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Fingerprint files in
|
|
|
|
.Pa /path/to/somewhere using
|
|
|
|
.Dq rmd160
|
|
|
|
as the hashing algorithm, saving to
|
|
|
|
.Pa /etc/somewhere.fp :
|
2006-09-17 05:02:30 +04:00
|
|
|
.Bd -literal -offset indent
|
2006-09-17 01:41:59 +04:00
|
|
|
# veriexecgen -d /path/to/somewhere -t rmd160 -o /etc/somewhere.fp
|
|
|
|
.Ed
|
2006-09-17 00:54:42 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr veriexec 4 ,
|
2008-02-18 13:37:19 +03:00
|
|
|
.Xr veriexec 5 ,
|
2008-02-10 22:32:23 +03:00
|
|
|
.Xr security 8 ,
|
2008-02-18 13:37:19 +03:00
|
|
|
.Xr veriexec 8 ,
|
2006-09-17 05:02:30 +04:00
|
|
|
.Xr veriexecctl 8
|