NetBSD/usr.sbin/veriexecgen/veriexecgen.8

162 lines
4.4 KiB
Groff
Raw Normal View History

2009-03-11 17:00:29 +03:00
.\" $NetBSD: veriexecgen.8,v 1.16 2009/03/11 14:00:29 joerg Exp $
.\"
.\" 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.
.\"
.Dd February 18, 2008
.Dt VERIEXECGEN 8
2009-03-11 17:00:29 +03:00
.Os
.Sh NAME
2006-09-17 05:02:30 +04:00
.Nm veriexecgen
.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
.Op Fl d Pa dir
.Op Fl o Pa fingerprintdb
.Op Fl p Pa prefix
2006-09-17 05:02:30 +04:00
.Op Fl t Ar algorithm
.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 .
.Pp
If no command line arguments were specified,
.Nm
will resort to default operation, implying
.Fl D Fl o Ar /etc/signatures Fl t Ar sha256 .
.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"
.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,
.Pa /bin ,
.Pa /sbin ,
.Pa /usr/bin ,
.Pa /usr/sbin ,
.Pa /lib ,
.Pa /usr/lib ,
.Pa /libexec ,
and
.Pa /usr/libexec .
.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 .
.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.
.It Fl r
Scan recursively.
.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.
.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.
.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.
.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
and save to the default fingerprint database in
.Pa /etc/signatures :
2006-09-17 05:02:30 +04:00
.Bd -literal -offset indent
# veriexecgen
2006-09-17 01:41:59 +04:00
.Ed
.Pp
Fingerprint files in
.Pa /etc ,
appending to the default fingerprint database:
.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
.Sh SEE ALSO
.Xr veriexec 4 ,
.Xr veriexec 5 ,
.Xr security 8 ,
.Xr veriexec 8 ,
2006-09-17 05:02:30 +04:00
.Xr veriexecctl 8