Changeset 305

Show
Ignore:
Timestamp:
05/04/07 22:43:55 (2 years ago)
Author:
kindlund
Message:

Added change file output support back into integrity module.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/kindlund-filesystem/etc/honeyclient.xml

    r303 r305  
    125125        <!-- HoneyClient::Agent::Integrity Options --> 
    126126        <Integrity> 
     127            <changes_found_file description="When an integrity check fails, all changes will be written to this file within the compromized honeyclient VM's filesystem." default="/tmp/changes.txt"> 
     128                /tmp/changes.txt 
     129            </changes_found_file> 
    127130            <!-- HoneyClient::Agent::Integrity::Filesystem Options --> 
    128131            <Filesystem> 
  • honeyclient/branches/exp/kindlund-filesystem/lib/HoneyClient/Agent/Integrity.pm

    r283 r305  
    339339    # (For internal use only.) 
    340340    _filesystem => undef, 
     341 
     342    # XXX: comment this 
     343    _changes_found_file => getVar(name => 'changes_found_file'); 
    341344); 
    342345 
     
    542545    }; 
    543546 
     547    # If any changes were found, write them out to the 
     548    # filesystem. 
     549    if (scalar(@{$changes->{registry}}) || 
     550        scalar(@{$changes->{filesystem}})) { 
     551        if (!open(CHANGE_FILE, ">>" . $self->{_changes_found_file})) { 
     552            $LOG->error("Unable to write changes to file '" . $self->{_changes_found_file} . "'."); 
     553        } else { 
     554            $Data::Dumper::Terse = 1; 
     555            $Data::Dumper::Indent = 1; 
     556            print CHANGE_FILE Dumper($changes); 
     557            close CHANGE_FILE; 
     558        } 
     559    } 
     560 
    544561    return $changes; 
    545562}