Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule Class Reference

Inherits org.sleuthkit.autopsy.ingest.FileIngestModule.

Classes

class  IngestJobTotals
 

Public Member Functions

ProcessResult process (AbstractFile file)
 
void shutDown ()
 
void startUp (IngestJobContext context) throws IngestModuleException
 

Static Public Member Functions

static boolean isMimeTypeDetectable (String mimeType)
 

Private Member Functions

void createInterestingFileHit (AbstractFile file, FileType fileType)
 
FileType detectUserDefinedFileType (AbstractFile file) throws CustomFileTypesManager.CustomFileTypesException
 
FileType detectUserDefinedFileType (AbstractFile file, byte[] startOfFileBuffer, int bufLen) throws CustomFileTypesManager.CustomFileTypesException
 

Static Private Member Functions

static synchronized void addToTotals (long jobId, long matchTimeInc)
 

Private Attributes

FileTypeDetector fileTypeDetector
 
long jobId
 

Static Private Attributes

static final Logger logger = Logger.getLogger(FileTypeIdIngestModule.class.getName())
 
static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter()
 
static final HashMap< Long, IngestJobTotalstotalsForIngestJobs = new HashMap<>()
 

Detailed Description

Detects the type of a file based on signature (magic) values. Posts results to the blackboard.

Definition at line 50 of file FileTypeIdIngestModule.java.

Member Function Documentation

static synchronized void org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.addToTotals ( long  jobId,
long  matchTimeInc 
)
staticprivate

Update the match time total and increment number of files processed for this ingest job.

Parameters
jobIdThe ingest job identifier.
matchTimeIncAmount of time to add.

Definition at line 258 of file FileTypeIdIngestModule.java.

void org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.createInterestingFileHit ( AbstractFile  file,
FileType  fileType 
)
private

Create an Interesting File hit using the specified file type rule.

Parameters
fileThe file from which to generate an artifact.
fileTypeThe file type rule for categorizing the hit.

Definition at line 182 of file FileTypeIdIngestModule.java.

References org.sleuthkit.autopsy.casemodule.Case.getCurrentCaseThrows(), org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdModuleFactory.getModuleName(), and org.sleuthkit.autopsy.casemodule.Case.getSleuthkitCase().

FileType org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.detectUserDefinedFileType ( AbstractFile  file) throws CustomFileTypesManager.CustomFileTypesException
private

Determines whether or not a file matches a user-defined custom file type.

Parameters
fileThe file to test.
Returns
The file type if a match is found; otherwise null.
Exceptions
CustomFileTypesExceptionIf there is an issue getting an instance of CustomFileTypesManager.

Definition at line 129 of file FileTypeIdIngestModule.java.

FileType org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.detectUserDefinedFileType ( AbstractFile  file,
byte[]  startOfFileBuffer,
int  bufLen 
) throws CustomFileTypesManager.CustomFileTypesException
private

Determines whether or not a file matches a user-defined custom file type.

Parameters
fileThe file to test.
startOfFileBufferThe beginning of the file data.
bufLenThe length of startOfFileBuffer.
Returns
The file type if a match is found; otherwise null.
Exceptions
CustomFileTypesExceptionIf there is an issue getting an instance of CustomFileTypesManager.

Definition at line 161 of file FileTypeIdIngestModule.java.

static boolean org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.isMimeTypeDetectable ( String  mimeType)
static

Validate if a given mime type is in the detector's registry.

Deprecated:
Use FileTypeDetector.mimeTypeIsDetectable(String mimeType) instead.
Parameters
mimeTypeFull string of mime type, e.g. "text/html"
Returns
true if detectable

Definition at line 69 of file FileTypeIdIngestModule.java.

References org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector.isDetectable().

ProcessResult org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.process ( AbstractFile  file)

Processes a file. Called between calls to startUp() and shutDown(). Will be called for each file in a data source.

IMPORTANT: In addition to returning ProcessResult.OK or ProcessResult.ERROR, modules should log all errors using methods provided by the org.sleuthkit.autopsy.coreutils.Logger class. Log messages should include the name and object ID of the data being processed and any other information that would be useful for debugging. If an exception has been caught by the module, the exception should be sent to the logger along with the log message so that a stack trace will appear in the application log.

Parameters
fileThe file to analyze.
Returns
A result code indicating success or failure of the processing.

Attempt to detect the file type. Do it within an exception firewall, so that any issues with reading file content or complaints from tika do not take the module down.

Implements org.sleuthkit.autopsy.ingest.FileIngestModule.

Definition at line 97 of file FileTypeIdIngestModule.java.

References org.sleuthkit.autopsy.ingest.IngestModule.ProcessResult.ERROR, org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector.getMIMEType(), and org.sleuthkit.autopsy.ingest.IngestModule.ProcessResult.OK.

void org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.shutDown ( )

Invoked by Autopsy when an ingest job is completed (either because the data has been analyzed or because the job was cancelled), before the ingest module instance is discarded. The module should respond by doing things like releasing private resources, submitting final results, and posting a final ingest message.

IMPORTANT: If the module instances must share resources, the modules are responsible for synchronizing access to the shared resources and doing reference counting as required to release those resources correctly. Also, more than one ingest job may be in progress at any given time. This must also be taken into consideration when sharing resources between module instances. See IngestModuleReferenceCounter.

If this is the instance of this module for this ingest job, post a summary message to the ingest messages box.

Implements org.sleuthkit.autopsy.ingest.IngestModule.

Definition at line 222 of file FileTypeIdIngestModule.java.

References org.sleuthkit.autopsy.ingest.IngestMessage.createMessage(), org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter.decrementAndGet(), org.sleuthkit.autopsy.ingest.IngestServices.getInstance(), org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdModuleFactory.getModuleName(), org.sleuthkit.autopsy.ingest.IngestMessage.MessageType.INFO, and org.sleuthkit.autopsy.ingest.IngestServices.postMessage().

void org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.startUp ( IngestJobContext  context) throws IngestModuleException

Invoked by Autopsy to allow an ingest module instance to set up any internal data structures and acquire any private resources it will need during an ingest job. If the module depends on loading any resources, it should do so in this method so that it can throw an exception in the case of an error and alert the user. Exceptions that are thrown from startUp() are logged and stop processing of the data source.

IMPORTANT: If the module instances must share resources, the modules are responsible for synchronizing access to the shared resources and doing reference counting as required to release those resources correctly. Also, more than one ingest job may be in progress at any given time. This must also be taken into consideration when sharing resources between module instances. See IngestModuleReferenceCounter.

IMPORTANT: Start up IngestModuleException messages are displayed to the user, if a user is present. Therefore, an exception to the policy that exception messages are not localized is appropriate in this method. Also, the exception messages should be user-friendly.

Parameters
contextProvides data and services specific to the ingest job and the ingest pipeline of which the module is a part.
Exceptions
org.sleuthkit.autopsy.ingest.IngestModule.IngestModuleException

Implements org.sleuthkit.autopsy.ingest.IngestModule.

Definition at line 86 of file FileTypeIdIngestModule.java.

References org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter.incrementAndGet().

Member Data Documentation

FileTypeDetector org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.fileTypeDetector
private

Definition at line 57 of file FileTypeIdIngestModule.java.

long org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.jobId
private

Definition at line 56 of file FileTypeIdIngestModule.java.

final Logger org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.logger = Logger.getLogger(FileTypeIdIngestModule.class.getName())
staticprivate

Definition at line 52 of file FileTypeIdIngestModule.java.

final IngestModuleReferenceCounter org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.refCounter = new IngestModuleReferenceCounter()
staticprivate

Definition at line 54 of file FileTypeIdIngestModule.java.

final HashMap<Long, IngestJobTotals> org.sleuthkit.autopsy.modules.filetypeid.FileTypeIdIngestModule.totalsForIngestJobs = new HashMap<>()
staticprivate

Definition at line 53 of file FileTypeIdIngestModule.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Tue Sep 27 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.