Commit Graph

73 Commits

Author SHA1 Message Date
elad 52cf460a76 Following input from Matthew Mondor, some Veriexec documentation changes:
- Document the signatures file format in a veriexec(5) man-page,
  - Document the strict levels and a general Veriexec intro in veriexec(8)
    instead of security(8).

Okay blymn@.
2008-02-18 10:37:19 +00:00
elad d6faea9863 Allow no signatures file to be specified for the "load" command, and use
the default one in such cases.

Update command usage and documentation to reflect the above.
2008-02-15 15:33:56 +00:00
elad 8f8e9e057c Xref security(8) from veriexec(4), veriexec(9), veriexecctl(8), and
veriexecgen(8).

Suggested by Matthew Mondor.
2008-02-10 19:32:23 +00:00
wiz 3a8a3f8310 Whitespace and HTML output fixes. 2007-12-13 22:06:45 +00:00
xtraeme 9ab6815f21 Remove intval from %union, it's unused... ok christos@. 2007-10-01 17:01:55 +00:00
xtraeme a0b933c5b2 CID 4498: print_entry() returning without freeing 'fp'.
Ok by rmind@.
2007-09-06 03:01:55 +00:00
pavel 5e809e89c6 Attempt at fixing build failures after proplib was converted to bool:
FALSE -> false, TRUE -> true, boolean_t -> bool, int -> bool when
appropriate, include stdbool.h . proplib.h no longer provides boolean_t,
so it is necessary to change to bool.

From Tom Spindler (dogcow@).
2007-08-17 17:59:15 +00:00
oster 9a9131c20f Add missing #include <sys/ioctl.h> to make this build without warnings. 2007-05-15 22:01:19 +00:00
elad 6700cfccd6 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 19:47:43 +00:00
elad 031bd982f9 Don't reset entry-type for every flag_spec. 2006-12-08 23:22:19 +00:00
elad 95513f79fe Support escaping characters in the path so that spaces etc. are allowed
in entries for Veriexec.

This has been requested for a long time, most recently by Brad Harder.

Thanks a lot to Michael van Elst for the patch, done during the latest
hackathon.
2006-11-29 14:28:30 +00:00
elad 6b6dc6a617 Type changed from size_t to uint64_t, adjust format string.
Pointed out by Tom Spindler, thanks!
2006-11-29 01:12:00 +00:00
elad 646f2112d3 Make Veriexec use proplib(3) for kernel-userland data passing.
Obviously, this breaks the already unstable Veriexec ABI, but that's
it. Some cool additions are planned to be introduced, and this just
makes it so that NetBSD 4.0 users will be able to easily use them as
well.

This also removes the fingerprint type name limit, so relevant code
was adjusted.

Thoroughly tested (even uncovered a bug in proplib! thanks for fixing
that cube@!). Documentation updated.
2006-11-28 22:22:02 +00:00
elad 0ba2154297 Update my email address. 2006-11-21 00:22:04 +00:00
elad 53ca07b4d7 If Veriexec enforces access type, don't allow mmap() to use PROT_EXEC on
files that don't have the "indirect" flag. Also change the "library" alias
in veriexecctl(8) to mean "file, indirect".

okay blymn@
2006-09-30 10:56:31 +00:00
elad 58375355b4 .Sh -> .Ss
mmm mdoclint. :)
2006-09-17 13:03:02 +00:00
elad efffcc37c4 Reference veriexecgen(8) instead of the old scripts. Bump date. 2006-09-16 21:06:13 +00:00
elad 3ea3b1e63e Scripts don't have to be *shell* scripts. 2006-09-16 17:17:23 +00:00
elad 95ed982c27 Fix two horrible bugs found during a routine audit session with Brett Lymn.
First one was incorrectly loading entries -- we were treating each file as
a mount, which resulted in huge mess. I have no excuse for how I didn't
catch this earlier.

Second, use the table name we create for the Veriexec sysctl node and not
the fixed "table0".

Both are fileassoc(9) integration fallout.
2006-09-05 13:02:16 +00:00
elad 0f70b7df59 no VERIFIED_EXEC anymore, just a pseudo-device. 2006-07-22 10:43:51 +00:00
elad b2b73a2973 misc cleanup: remove #if 0 code, unused var, and make pretty. 2006-07-14 23:00:09 +00:00
elad bb74ea2d6b oops, forgot to handle new abi for "query", noted by he@, thanks! 2006-07-14 22:42:05 +00:00
elad b5d09ef065 okay, since there was no way to divide this to two commits, here it goes..
introduce fileassoc(9), a kernel interface for associating meta-data with
files using in-kernel memory. this is very similar to what we had in
veriexec till now, only abstracted so it can be used more easily by more
consumers.

this also prompted the redesign of the interface, making it work on vnodes
and mounts and not directly on devices and inodes. internally, we still
use file-id but that's gonna change soon... the interface will remain
consistent.

as a result, veriexec went under some heavy changes to conform to the new
interface. since we no longer use device numbers to identify file-systems,
the veriexec sysctl stuff changed too: kern.veriexec.count.dev_N is now
kern.veriexec.tableN.* where 'N' is NOT the device number but rather a
way to distinguish several mounts.

also worth noting is the plugging of unmount/delete operations
wrt/fileassoc and veriexec.

tons of input from yamt@, wrstuden@, martin@, and christos@.
2006-07-14 18:41:40 +00:00
mrg aadd7d4847 sprinkle some -fno-strict-aliasing and -Wno-pointer-sign with GCC4. 2006-05-11 23:16:28 +00:00
elad 9eed84a6ae Allow multiple lines entries using '\' at the end of the line.
Simplified by martin@, thanks. :)
2006-01-05 20:16:20 +00:00
dsl 24c43e28bb Use PRIu64 to print ino_t (maybe there should be a PRIino_t somewhere....) 2005-12-13 10:56:16 +00:00
wiz fe79b0c9bd Grammar improvement. 2005-12-12 22:29:37 +00:00
elad a9505be892 Add and document a "query" keyword to veriexecctl. Usage:
/sbin/veriexecctl query /path/to/file

will print out filename, device, inode, evaluation status, entry flags,
fingerprint, and fingerprinting algorithm.
2005-12-12 21:47:58 +00:00
elad f39afe3e47 Add and document a VERIEXEC_DELETE operation for Veriexec.
We can now delete an entry from the tables using

	veriexecctl delete /path/to/file

or remove an entire table using

	veriexecctl delete /mount_point

(any directory will work for the mount point it's on)
2005-12-10 02:10:00 +00:00
wiz 42c5a0b8fd Make sentence more readable. 2005-10-05 13:58:49 +00:00
elad 8fc0d7a9c3 Introduce per-page fingerprints in Veriexec.
This closes a hole pointed out by Thor Lancelot Simon on tech-kern ~3
years ago.

The problem was with running binaries from remote storage, where our
kernel (and Veriexec) has no control over any changes to files.

An attacker could, after the fingerprint has been verified and
program loaded to memory, inject malicious code into the backing
store on the remote storage, followed by a forced flush, causing
a page-in of the malicious data from backing store, bypassing
integrity checks.

Initial implementation by Brett Lymn.
2005-10-05 13:48:48 +00:00
wiz f309f02fd0 Bump date for previous; use more markup. 2005-08-07 11:17:31 +00:00
blymn b7550dc6d4 Add and document some convenience aliases for commonly required option
combinations.
2005-08-06 09:00:20 +00:00
elad 42735a8747 Sync with reality.
- Verified Exec -> Veriexec
- pseudo-device is `veriexec'
- veriexec.conf -> signatures, and mention /etc/signatures as the default
  location
- We use veriexec's strict level, not the system securelevel
- Mention the `direct' option
- Mention that the signatures file can have multiple options in a single
  entry, comma-separated
- Mention that both `direct' and `indirect' access modes are implied
  if no access modes are explicitly mention in the options
- Bump date
2005-08-02 18:06:14 +00:00
elad 6e4a854552 Support multiple entry types. Direct, indirect, and file can now be
combined in the signatures file using commas.
2005-08-02 16:14:10 +00:00
christos 2c6eadc9ce Move WARNS=3 to the Makefile.inc, and add a little const to the remaining
programs that did not compile before.
2005-06-27 01:00:04 +00:00
elad db6ca056ee Some refactoring and bugfixes:
- Report line numbers correctly.
  - Don't perform a 2nd pass when there are were errors during 1st.
  - Support multiple, comma-separated flags. This is mostly a reworking of
    some parser internals preparing for planned features.
2005-06-13 15:18:44 +00:00
wiz 8dcbfbbb96 Bump date for previous. 2005-06-13 13:07:56 +00:00
elad 471eb59186 Remove bits about deprecated 'fingerprints' command. 2005-06-13 13:05:29 +00:00
elad 0f9ec14004 No need for this one, apparently. Reported by Hisashi T Fujinaka. 2005-06-03 16:12:07 +00:00
elad 055b86e224 Don't create duplicate tables for the same device. 2005-06-03 13:21:35 +00:00
elad 9a23dc795f Newline in end of usage. 2005-06-01 18:29:16 +00:00
elad 98425e4a9e Warn when failing to load an entry; don't fail the whole process. 2005-05-30 18:02:31 +00:00
elad 0f2f650859 Don't access a NULL pointer. 2005-05-27 15:46:23 +00:00
skrll ff8785b1da Remove unused variables. 2005-05-21 09:25:21 +00:00
elad 18afb98204 Remove leftovers from Vexec. 2005-05-20 20:06:34 +00:00
elad cd0c4134f1 Remove common code for returning supported fingerprints. This is done now
via sysctl(8) using kern.veriexec.algorithms.

Also add an entry for the 'algorithms' variable in sysctl.8 forgotten in
the last commit.
2005-05-20 19:52:52 +00:00
jmc 6e682c8cda Need -I. here as well so OBJDIR's work correctly in all cases 2005-05-06 21:51:21 +00:00
blymn 3c941b3ee9 Remove veriexec(4) man page. 2005-04-25 00:40:31 +00:00
blymn f83fbb398f Add bugs sub-heading to warn about whitespace in filenames. 2005-04-24 13:23:55 +00:00