Merge branch 'develop' of github.com:sleuthkit/autopsy into 7413c-buildForDir

This commit is contained in:
Greg DiCristofaro 2022-09-14 10:46:10 -04:00
commit e21c45e9f3
15 changed files with 929 additions and 156 deletions

View File

@ -44,6 +44,8 @@ public class CentralRepoSettings {
private static final String DEFAULT_DB_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString(); private static final String DEFAULT_DB_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString();
private static final String DEFAULT_DB_NAME = "central_repository.db"; private static final String DEFAULT_DB_NAME = "central_repository.db";
// NOTE: if this changes, an equivalent fix will be needed in CentralRepoDatamodelTest for the String PROPERTIES_FILE
private static final String MODULE_SETTINGS_KEY = Paths.get( private static final String MODULE_SETTINGS_KEY = Paths.get(
Paths.get(PlatformUtil.getUserConfigDirectory()).relativize(Paths.get(PlatformUtil.getModuleConfigDirectory())).toString(), Paths.get(PlatformUtil.getUserConfigDirectory()).relativize(Paths.get(PlatformUtil.getModuleConfigDirectory())).toString(),
CENTRAL_REPOSITORY_FOLDER, CENTRAL_REPOSITORY_FOLDER,

View File

@ -56,6 +56,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestModuleError; import org.sleuthkit.autopsy.ingest.IngestModuleError;
import org.sleuthkit.autopsy.ingest.IngestProfiles; import org.sleuthkit.autopsy.ingest.IngestProfiles;
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile; import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
import org.sleuthkit.autopsy.ingest.profile.IngestProfilePaths;
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet; import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager; import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
import org.sleuthkit.autopsy.report.infrastructure.ReportGenerator; import org.sleuthkit.autopsy.report.infrastructure.ReportGenerator;
@ -75,9 +76,9 @@ public class CommandLineIngestManager extends CommandLineManager {
private Case caseForJob = null; private Case caseForJob = null;
private AutoIngestDataSource dataSource = null; private AutoIngestDataSource dataSource = null;
static int CL_SUCCESS = 0; static final int CL_SUCCESS = 0;
static int CL_RUN_FAILURE = -1; static final int CL_RUN_FAILURE = -1;
static int CL_PROCESS_FAILURE = 1; static final int CL_PROCESS_FAILURE = -2;
public CommandLineIngestManager() { public CommandLineIngestManager() {
} }
@ -260,7 +261,7 @@ public class CommandLineIngestManager extends CommandLineManager {
// run ingest // run ingest
String ingestProfile = inputs.get(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name()); String ingestProfile = inputs.get(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name());
analyze(dataSource, ingestProfile); analyze(dataSource, ingestProfile);
} catch (InterruptedException | CaseActionException ex) { } catch (InterruptedException | CaseActionException | AnalysisStartupException ex) {
String dataSourcePath = command.getInputs().get(CommandLineCommand.InputType.DATA_SOURCE_PATH.name()); String dataSourcePath = command.getInputs().get(CommandLineCommand.InputType.DATA_SOURCE_PATH.name());
LOGGER.log(Level.SEVERE, "Error running ingest on data source " + dataSourcePath, ex); LOGGER.log(Level.SEVERE, "Error running ingest on data source " + dataSourcePath, ex);
System.out.println("Error running ingest on data source " + dataSourcePath); System.out.println("Error running ingest on data source " + dataSourcePath);
@ -520,7 +521,7 @@ public class CommandLineIngestManager extends CommandLineManager {
// unable to find the user specified profile // unable to find the user specified profile
LOGGER.log(Level.SEVERE, "Unable to find ingest profile: {0}. Ingest cancelled!", ingestProfileName); LOGGER.log(Level.SEVERE, "Unable to find ingest profile: {0}. Ingest cancelled!", ingestProfileName);
System.out.println("Unable to find ingest profile: " + ingestProfileName + ". Ingest cancelled!"); System.out.println("Unable to find ingest profile: " + ingestProfileName + ". Ingest cancelled!");
return; throw new AnalysisStartupException("Unable to find ingest profile: " + ingestProfileName + ". Ingest cancelled!");
} }
// get FileSet filter associated with this profile // get FileSet filter associated with this profile
@ -529,7 +530,7 @@ public class CommandLineIngestManager extends CommandLineManager {
// unable to find the user specified profile // unable to find the user specified profile
LOGGER.log(Level.SEVERE, "Unable to find file filter {0} for ingest profile: {1}. Ingest cancelled!", new Object[]{selectedProfile.getFileIngestFilter(), ingestProfileName}); LOGGER.log(Level.SEVERE, "Unable to find file filter {0} for ingest profile: {1}. Ingest cancelled!", new Object[]{selectedProfile.getFileIngestFilter(), ingestProfileName});
System.out.println("Unable to find file filter " + selectedProfile.getFileIngestFilter() + " for ingest profile: " + ingestProfileName + ". Ingest cancelled!"); System.out.println("Unable to find file filter " + selectedProfile.getFileIngestFilter() + " for ingest profile: " + ingestProfileName + ". Ingest cancelled!");
return; throw new AnalysisStartupException("Unable to find file filter " + selectedProfile.getFileIngestFilter() + " for ingest profile: " + ingestProfileName + ". Ingest cancelled!");
} }
} }
@ -543,7 +544,7 @@ public class CommandLineIngestManager extends CommandLineManager {
ingestJobSettings = new IngestJobSettings(UserPreferences.getCommandLineModeIngestModuleContextString()); ingestJobSettings = new IngestJobSettings(UserPreferences.getCommandLineModeIngestModuleContextString());
} else { } else {
// load the custom ingest // load the custom ingest
ingestJobSettings = new IngestJobSettings(selectedProfile.toString()); ingestJobSettings = new IngestJobSettings(IngestProfilePaths.getInstance().getIngestProfilePrefix() + selectedProfile.toString());
ingestJobSettings.setFileFilter(selectedFileSet); ingestJobSettings.setFileFilter(selectedFileSet);
} }

View File

@ -271,6 +271,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir); newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_ID.name(), dataSourceId); newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_ID.name(), dataSourceId);
newCommand.addInputValue(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name(), ingestProfile); newCommand.addInputValue(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name(), ingestProfile);
newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_PATH.name(), dataSourcePath);
commands.add(newCommand); commands.add(newCommand);
runFromCommandLine(true); runFromCommandLine(true);
} }

View File

@ -199,7 +199,7 @@ public final class IngestJobSettings {
public Path getSavedModuleSettingsFolder() { public Path getSavedModuleSettingsFolder() {
return getSavedModuleSettingsFolder(executionContext); return getSavedModuleSettingsFolder(executionContext);
} }
/** /**
* Saves these ingest job settings. * Saves these ingest job settings.
*/ */

View File

@ -202,15 +202,24 @@ public final class IngestProfiles {
* @param selectedProfile * @param selectedProfile
*/ */
synchronized static void deleteProfile(IngestProfile selectedProfile) { synchronized static void deleteProfile(IngestProfile selectedProfile) {
deleteProfile(selectedProfile.getName());
}
/**
* Deletes all of the files which are currently storing a profile.
*
* @param profile name
*/
synchronized static void deleteProfile(String profileName) {
try { try {
File rootSettingsFile = getRootSettingsFile(selectedProfile.getName()); File rootSettingsFile = getRootSettingsFile(profileName);
File settingsDirectory = getSettingsDirectory(selectedProfile.getName()); File settingsDirectory = getSettingsDirectory(profileName);
Files.deleteIfExists(rootSettingsFile.toPath()); Files.deleteIfExists(rootSettingsFile.toPath());
FileUtils.deleteDirectory(settingsDirectory); FileUtils.deleteDirectory(settingsDirectory);
} catch (IOException ex) { } catch (IOException ex) {
logger.log(Level.WARNING, "Error deleting directory for profile " + selectedProfile.getName(), ex); logger.log(Level.WARNING, "Error deleting directory for profile " + profileName, ex);
} }
} }
/** /**
* Renames the files and directories associated with a profile * Renames the files and directories associated with a profile

View File

@ -85,7 +85,15 @@ class ProfilePanel extends IngestModuleGlobalSettingsPanel {
IngestJobSettings getSettings() { IngestJobSettings getSettings() {
return ingestSettingsPanel.getSettings(); return ingestSettingsPanel.getSettings();
} }
String getIngestProfileName() {
if (profile != null) {
return profile.getName();
} else {
return NEW_PROFILE_NAME;
}
}
/** /**
* This method is called from within the constructor to initialize the form. * This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always * WARNING: Do NOT modify this code. The content of this method is always

View File

@ -391,7 +391,7 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
*/ */
private void doProfileDialog(IngestProfile selectedProfile) { private void doProfileDialog(IngestProfile selectedProfile) {
// Create a files set defintion panel. // Create a files set defintion panel.
final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true); final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true);
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//start wait cursor for ingest job settings construction //start wait cursor for ingest job settings construction
if (selectedProfile != null) { if (selectedProfile != null) {
@ -430,6 +430,15 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
} }
panel.saveSettings(); panel.saveSettings();
load(); load();
} else if (option == JOptionPane.CANCEL_OPTION) {
if (selectedProfile == null) {
// for new profiles, if user canlessed a profile create/edit then delete the temp empty profile that was created.
// Otherwise it will remain in "config/ModuleSettings/IngestSettings" and then will get loaded
// next time we open ProfilePanel(), causing an NPE (JIRA-8404). This only needs to be done when creating
// a new ingest profile. If user cancelled editing of an existing profile, then we should not delete
// that profile.
IngestProfile.deleteProfile(panel.getIngestProfileName());
}
} }
} }
@ -479,7 +488,12 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
for (FilesSet fSet : FilesSetsManager.getStandardFileIngestFilters()) { for (FilesSet fSet : FilesSetsManager.getStandardFileIngestFilters()) {
fileIngestFilters.put(fSet.getName(), fSet); fileIngestFilters.put(fSet.getName(), fSet);
} }
filterDescArea.setText(fileIngestFilters.get(selectedProfile.getFileIngestFilter()).getDescription()); String selectedFilter = selectedProfile.getFileIngestFilter();
if (selectedFilter == null) {
filterDescArea.setText(NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.messages.filterLoadFailed"));
} else {
filterDescArea.setText(fileIngestFilters.get(selectedFilter).getDescription());
}
} catch (FilesSetsManager.FilesSetsManagerException ex) { } catch (FilesSetsManager.FilesSetsManagerException ex) {
filterDescArea.setText(NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.messages.filterLoadFailed")); filterDescArea.setText(NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.messages.filterLoadFailed"));
} }

View File

@ -43,6 +43,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.report.GeneralReportModule; import org.sleuthkit.autopsy.report.GeneralReportModule;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileReader; import java.io.FileReader;
import java.util.Comparator;
/** /**
* Finds and loads Autopsy modules written using the Jython variant of the * Finds and loads Autopsy modules written using the Jython variant of the
@ -124,6 +125,8 @@ public final class JythonModuleLoader {
} }
} }
} }
Collections.sort(objects, Comparator.comparing((T obj) -> obj.getClass().getSimpleName(), (s1, s2) -> s1.compareToIgnoreCase(s2)));
return objects; return objects;
} }

View File

@ -0,0 +1,47 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2022 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.report.infrastructure;
/**
* Instances of this exception class are thrown when there is an error while
* generating a report.
*/
public final class ReportGenerationException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with the specified message.
*
* @param message The message.
*/
public ReportGenerationException(String message) {
super(message);
}
/**
* Constructs a new exception with the specified message and cause.
*
* @param message The message.
* @param cause The cause.
*/
public ReportGenerationException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2013-2020 Basis Technology Corp. * Copyright 2013-2022 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -107,7 +107,7 @@ public class ReportGenerator {
this.reportGenerationPanel = null; this.reportGenerationPanel = null;
this.configName = configName; this.configName = configName;
} }
/** /**
* Constructs a report generator that generates one or more reports by * Constructs a report generator that generates one or more reports by
* running user-selected report modules and uses a report generation panel * running user-selected report modules and uses a report generation panel
@ -121,12 +121,15 @@ public class ReportGenerator {
this.progressIndicator = panel.getProgressPanel(); this.progressIndicator = panel.getProgressPanel();
this.configName = configName; this.configName = configName;
} }
/** /**
* Generates the reports specified by the reporting configuration passed * Generates the reports specified by the reporting configuration passed in
* in via the constructor. Does lookup of all existing report modules. * via the constructor. Does lookup of all existing report modules.
*
* @throws ReportGenerationException if an error occurred while generating
* the report.
*/ */
public void generateReports() { public void generateReports() throws ReportGenerationException {
// load all report modules // load all report modules
Map<String, ReportModule> modules = new HashMap<>(); Map<String, ReportModule> modules = new HashMap<>();
for (TableReportModule module : ReportModuleLoader.getTableReportModules()) { for (TableReportModule module : ReportModuleLoader.getTableReportModules()) {
@ -143,38 +146,51 @@ public class ReportGenerator {
// special case for PortableCaseReportModule // special case for PortableCaseReportModule
modules.put(FactoryClassNameNormalizer.normalize(PortableCaseReportModule.class.getCanonicalName()), new PortableCaseReportModule()); modules.put(FactoryClassNameNormalizer.normalize(PortableCaseReportModule.class.getCanonicalName()), new PortableCaseReportModule());
generateReports(modules); generateReports(modules);
} }
@NbBundle.Messages({
"ReportGenerator.error.noReportModules=No report modules found",
"# {0} - report configuration name", "ReportGenerator.error.unableToLoadConfig=Unable to load reporting configuration {0}.",
"# {0} - report module name", "ReportGenerator.error.moduleNotFound=Report module {0} not found",
"# {0} - report module name", "ReportGenerator.error.noTableReportSettings=No table report settings for report module {0}",
"# {0} - report module name", "ReportGenerator.error.noFileReportSettings=No file report settings for report module {0}",
"# {0} - report module name", "ReportGenerator.error.invalidSettings=Invalid settings for report module {0}",
"# {0} - report module name", "ReportGenerator.error.unsupportedType=Report module {0} has unsupported report module type",
"# {0} - report module name", "ReportGenerator.error.exception=Exception while running report module {0}"})
/** /**
* Generates the reports specified by the reporting configuration passed in * Generates the reports specified by the reporting configuration passed in
* via the constructor. * via the constructor.
* *
* @param modules Map of report module objects to use. This is useful when we want to * @param modules Map of report module objects to use. This is useful when
* re-use the module instances or limit which reports are generated. * we want to re-use the module instances or limit which
* reports are generated.
*
* @throws ReportGenerationException if an error occurred while generating
* the report.
*/ */
public void generateReports(Map<String, ReportModule> modules) { public void generateReports(Map<String, ReportModule> modules) throws ReportGenerationException {
if (modules == null || modules.isEmpty()) { if (modules == null || modules.isEmpty()) {
logger.log(Level.SEVERE, "No report modules found"); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_noReportModules());
progressIndicator.updateStatusLabel("No report modules found. Exiting"); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_noReportModules());
return; throw new ReportGenerationException(Bundle.ReportGenerator_error_noReportModules());
} }
ReportingConfig config = null; ReportingConfig config = null;
try { try {
config = ReportingConfigLoader.loadConfig(configName); config = ReportingConfigLoader.loadConfig(configName);
} catch (ReportConfigException ex) { } catch (ReportConfigException ex) {
logger.log(Level.SEVERE, "Unable to load reporting configuration " + configName + ". Exiting", ex); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_unableToLoadConfig(configName), ex);
progressIndicator.updateStatusLabel("Unable to load reporting configuration " + configName + ". Exiting"); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_unableToLoadConfig(configName));
return; throw new ReportGenerationException(Bundle.ReportGenerator_error_unableToLoadConfig(configName));
} }
if (config == null) { if (config == null) {
logger.log(Level.SEVERE, "Unable to load reporting configuration {0}. Exiting", configName); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_unableToLoadConfig(configName));
progressIndicator.updateStatusLabel("Unable to load reporting configuration " + configName + ". Exiting"); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_unableToLoadConfig(configName));
return; throw new ReportGenerationException(Bundle.ReportGenerator_error_unableToLoadConfig(configName));
} }
try { try {
@ -189,8 +205,8 @@ public class ReportGenerator {
String moduleName = entry.getKey(); String moduleName = entry.getKey();
ReportModule module = modules.get(moduleName); ReportModule module = modules.get(moduleName);
if (module == null) { if (module == null) {
logger.log(Level.SEVERE, "Report module {0} not found", moduleName); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_moduleNotFound(moduleName));
progressIndicator.updateStatusLabel("Report module " + moduleName + " not found"); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_moduleNotFound(moduleName));
continue; continue;
} }
@ -216,8 +232,8 @@ public class ReportGenerator {
// get table report settings // get table report settings
TableReportSettings tableSettings = config.getTableReportSettings(); TableReportSettings tableSettings = config.getTableReportSettings();
if (tableSettings == null) { if (tableSettings == null) {
logger.log(Level.SEVERE, "No table report settings for report module {0}", moduleName); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_noTableReportSettings(moduleName));
progressIndicator.updateStatusLabel("No table report settings for report module " + moduleName); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_noTableReportSettings(moduleName));
continue; continue;
} }
@ -228,8 +244,8 @@ public class ReportGenerator {
// get file report settings // get file report settings
FileReportSettings fileSettings = config.getFileReportSettings(); FileReportSettings fileSettings = config.getFileReportSettings();
if (fileSettings == null) { if (fileSettings == null) {
logger.log(Level.SEVERE, "No file report settings for report module {0}", moduleName); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_noFileReportSettings(moduleName));
progressIndicator.updateStatusLabel("No file report settings for report module " + moduleName); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_noFileReportSettings(moduleName));
continue; continue;
} }
@ -240,20 +256,20 @@ public class ReportGenerator {
if (settings instanceof NoReportModuleSettings) { if (settings instanceof NoReportModuleSettings) {
settings = new PortableCaseReportModuleSettings(); settings = new PortableCaseReportModuleSettings();
} else if (!(settings instanceof PortableCaseReportModuleSettings)) { } else if (!(settings instanceof PortableCaseReportModuleSettings)) {
logger.log(Level.SEVERE, "Invalid settings for report module {0}", moduleName); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_invalidSettings(moduleName));
progressIndicator.updateStatusLabel("Invalid settings for report module " + moduleName); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_invalidSettings(moduleName));
continue; continue;
} }
generatePortableCaseReport((PortableCaseReportModule) module, (PortableCaseReportModuleSettings) settings); generatePortableCaseReport((PortableCaseReportModule) module, (PortableCaseReportModuleSettings) settings);
} else { } else {
logger.log(Level.SEVERE, "Report module {0} has unsupported report module type", moduleName); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_unsupportedType(moduleName));
progressIndicator.updateStatusLabel("Report module " + moduleName + " has unsupported report module type"); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_unsupportedType(moduleName));
} }
} catch (IOException e) { } catch (IOException e) {
logger.log(Level.SEVERE, "Exception while running report module {0}: {1}", new Object[]{moduleName, e.getMessage()}); logger.log(Level.SEVERE, Bundle.ReportGenerator_error_exception(moduleName));
progressIndicator.updateStatusLabel("Exception while running report module " + moduleName); progressIndicator.updateStatusLabel(Bundle.ReportGenerator_error_exception(moduleName));
} }
} }
} finally { } finally {
@ -321,15 +337,15 @@ public class ReportGenerator {
TableReportGenerator generator = new TableReportGenerator(tableReportSettings, progressIndicator, tableReport); TableReportGenerator generator = new TableReportGenerator(tableReportSettings, progressIndicator, tableReport);
generator.execute(); generator.execute();
tableReport.endReport(); tableReport.endReport();
// finish progress, wrap up // finish progress, wrap up
errorList = generator.getErrorList(); errorList = generator.getErrorList();
// if error list is empty, the operation has completed successfully. If not there is an error // if error list is empty, the operation has completed successfully. If not there is an error
ReportProgressPanel.ReportStatus finalStatus = (errorList == null || errorList.isEmpty()) ? ReportProgressPanel.ReportStatus finalStatus = (errorList == null || errorList.isEmpty())
ReportProgressPanel.ReportStatus.COMPLETE : ? ReportProgressPanel.ReportStatus.COMPLETE
ReportProgressPanel.ReportStatus.ERROR; : ReportProgressPanel.ReportStatus.ERROR;
progressIndicator.complete(finalStatus); progressIndicator.complete(finalStatus);
} }
} }
@ -368,10 +384,10 @@ public class ReportGenerator {
int i = 0; int i = 0;
// Add files to report. // Add files to report.
for (AbstractFile file : files) { for (AbstractFile file : files) {
if(shouldFilterFromReport(file, fileReportSettings)) { if (shouldFilterFromReport(file, fileReportSettings)) {
continue; continue;
} }
// Check to see if any reports have been cancelled. // Check to see if any reports have been cancelled.
if (progressIndicator.getStatus() == ReportStatus.CANCELED) { if (progressIndicator.getStatus() == ReportStatus.CANCELED) {
return; return;
@ -393,9 +409,9 @@ public class ReportGenerator {
progressIndicator.complete(ReportStatus.COMPLETE); progressIndicator.complete(ReportStatus.COMPLETE);
} }
} }
private boolean shouldFilterFromReport(AbstractFile file, FileReportSettings fileReportSettings) { private boolean shouldFilterFromReport(AbstractFile file, FileReportSettings fileReportSettings) {
if(fileReportSettings.getSelectedDataSources() == null) { if (fileReportSettings.getSelectedDataSources() == null) {
return false; return false;
} }
// Filter if the data source id is not in the list to process // Filter if the data source id is not in the list to process

View File

@ -2,7 +2,7 @@
* *
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2012-2020 Basis Technology Corp. * Copyright 2012-2022 Basis Technology Corp.
* *
* Copyright 2012 42six Solutions. * Copyright 2012 42six Solutions.
* Contact: aebadirad <at> 42six <dot> com * Contact: aebadirad <at> 42six <dot> com
@ -108,7 +108,12 @@ public final class ReportWizardAction extends CallableSystemAction implements Pr
Map<String, ReportModule> modules = (Map<String, ReportModule>) wiz.getProperty("modules"); Map<String, ReportModule> modules = (Map<String, ReportModule>) wiz.getProperty("modules");
ReportGenerator generator = new ReportGenerator(configName, panel); //NON-NLS ReportGenerator generator = new ReportGenerator(configName, panel); //NON-NLS
ReportWorker worker = new ReportWorker(() -> { ReportWorker worker = new ReportWorker(() -> {
generator.generateReports(modules); try {
generator.generateReports(modules);
} catch (ReportGenerationException ex) {
// do nothing. the error message will be logged and
// displayed by the progress panel.
}
}); });
worker.execute(); worker.execute();
generator.displayProgressPanel(); generator.displayProgressPanel();

View File

@ -43,7 +43,6 @@ import org.sleuthkit.autopsy.casemodule.CaseDetails;
import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
import org.sleuthkit.autopsy.coreutils.FileUtil; import org.sleuthkit.autopsy.coreutils.FileUtil;
/** /**
@ -57,7 +56,10 @@ import org.sleuthkit.autopsy.coreutils.FileUtil;
*/ */
public class CentralRepoDatamodelTest extends TestCase { public class CentralRepoDatamodelTest extends TestCase {
private static final String PROPERTIES_FILE = CentralRepoSettings.getInstance().getModuleSettingsKey(); // Classloader for qa functional tests is having trouble with loading NbBundle.
// Path is hard-coded to avoid that issue instead of using
// CentralRepoSettings.getInstance().getModuleSettingsKey()
private static final String PROPERTIES_FILE = "ModuleConfig/CentralRepository/CentralRepository";
private static final String CR_DB_NAME = "testcentralrepo.db"; private static final String CR_DB_NAME = "testcentralrepo.db";
private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest");

View File

@ -3,6 +3,14 @@ OpenIDE-Module-Long-Description=Recent Activity ingest module.\n\n The module ex
OpenIDE-Module-Name=RecentActivity OpenIDE-Module-Name=RecentActivity
OpenIDE-Module-Short-Description=Recent Activity finder ingest module OpenIDE-Module-Short-Description=Recent Activity finder ingest module
Chrome.moduleName=Chromium Analyzer Chrome.moduleName=Chromium Analyzer
Chrome.getLocalState.errMsg.errGettingFiles=Error when trying to get Local State file.
Chrome.getLocalState.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome Local State files.
Chrome.getLocalState.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1}
Chrome.getLocalState.displayName=Chromium Profiles
Chrome.getExtensions.errMsg.errGettingFiles=Error when trying to get Secure Preferences file.
Chrome.getExtensions.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome Secure Preferences file.
Chrome.getExtensions.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1}
Chrome.getExtensions.displayName=Chromium Extensions
Chrome.getHistory.errMsg.errGettingFiles=Error when trying to get Chrome history files. Chrome.getHistory.errMsg.errGettingFiles=Error when trying to get Chrome history files.
Chrome.getHistory.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome history files. Chrome.getHistory.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome history files.
Chrome.getHistory.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1} Chrome.getHistory.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1}
@ -15,6 +23,10 @@ Chrome.getCookie.errMsg.errGettingFiles=Error when trying to get Chrome history
Chrome.getCookie.errMsg.errAnalyzeFile={0}: Error while trying to analyze file:{1} Chrome.getCookie.errMsg.errAnalyzeFile={0}: Error while trying to analyze file:{1}
Chrome.getDownload.errMsg.errGettingFiles=Error when trying to get Chrome history files. Chrome.getDownload.errMsg.errGettingFiles=Error when trying to get Chrome history files.
Chrome.getDownload.errMsg.errAnalyzeFiles1={0}: Error while trying to analyze file:{1} Chrome.getDownload.errMsg.errAnalyzeFiles1={0}: Error while trying to analyze file:{1}
Chrome.getFavicon.errMsg.errGettingFiles=Error when trying to get Chrome favicon files.
Chrome.getFavicon.errMsg.errAnalyzeFiles1={0}: Error while trying to analyze file:{1}
Chrome.getFavicon.errMsg.errCreateArtifact=Error creating Favicon artifact
Chrome.getFavicon.displayName=Favicon
Chrome.getLogin.errMsg.errGettingFiles=Error when trying to get Chrome history files. Chrome.getLogin.errMsg.errGettingFiles=Error when trying to get Chrome history files.
Chrome.getLogin.errMsg.errAnalyzingFiles={0}: Error while trying to analyze file:{1} Chrome.getLogin.errMsg.errAnalyzingFiles={0}: Error while trying to analyze file:{1}
Chrome.getAutofill.errMsg.errGettingFiles=Error when trying to get Chrome Web Data files. Chrome.getAutofill.errMsg.errGettingFiles=Error when trying to get Chrome Web Data files.

View File

@ -12,7 +12,6 @@ ChromeCacheExtractor.progressMsg={0}: Extracting cache entry {1} of {2} entries
DataSourceUsage_AndroidMedia=Android Media Card DataSourceUsage_AndroidMedia=Android Media Card
DataSourceUsage_DJU_Drone_DAT=DJI Internal SD Card DataSourceUsage_DJU_Drone_DAT=DJI Internal SD Card
DataSourceUsage_FlashDrive=Flash Drive DataSourceUsage_FlashDrive=Flash Drive
# {0} - OS name
DataSourceUsageAnalyzer.customVolume.label=OS Drive ({0}) DataSourceUsageAnalyzer.customVolume.label=OS Drive ({0})
DataSourceUsageAnalyzer.displayName=Data Source Usage Analyzer DataSourceUsageAnalyzer.displayName=Data Source Usage Analyzer
DefaultPriorityDomainCategorizer_searchEngineCategory=Search Engine DefaultPriorityDomainCategorizer_searchEngineCategory=Search Engine
@ -25,7 +24,7 @@ ExtractEdge_process_errMsg_errGettingWebCacheFiles=Error trying to retrieving Ed
ExtractEdge_process_errMsg_spartanFail=Failure processing Microsoft Edge spartan.edb file ExtractEdge_process_errMsg_spartanFail=Failure processing Microsoft Edge spartan.edb file
ExtractEdge_process_errMsg_unableFindESEViewer=Unable to find ESEDatabaseViewer ExtractEdge_process_errMsg_unableFindESEViewer=Unable to find ESEDatabaseViewer
ExtractEdge_process_errMsg_webcacheFail=Failure processing Microsoft Edge WebCacheV01.dat file ExtractEdge_process_errMsg_webcacheFail=Failure processing Microsoft Edge WebCacheV01.dat file
# {0} - sub module name ExtractFavicon_Display_Name=Favicon
ExtractIE_executePasco_errMsg_errorRunningPasco={0}: Error analyzing Internet Explorer web history ExtractIE_executePasco_errMsg_errorRunningPasco={0}: Error analyzing Internet Explorer web history
ExtractOs.androidOs.label=Android ExtractOs.androidOs.label=Android
ExtractOs.androidVolume.label=OS Drive (Android) ExtractOs.androidVolume.label=OS Drive (Android)
@ -58,7 +57,6 @@ ExtractOs.windowsVolume.label=OS Drive (Windows)
ExtractOs.yellowDogLinuxOs.label=Linux (Yellow Dog) ExtractOs.yellowDogLinuxOs.label=Linux (Yellow Dog)
ExtractOs.yellowDogLinuxVolume.label=OS Drive (Linux Yellow Dog) ExtractOs.yellowDogLinuxVolume.label=OS Drive (Linux Yellow Dog)
ExtractOS_progressMessage=Checking for OS ExtractOS_progressMessage=Checking for OS
# {0} - sub module name
ExtractPrefetch_errMsg_prefetchParsingFailed={0}: Error analyzing prefetch files ExtractPrefetch_errMsg_prefetchParsingFailed={0}: Error analyzing prefetch files
ExtractPrefetch_module_name=Windows Prefetch Analyzer ExtractPrefetch_module_name=Windows Prefetch Analyzer
ExtractRecycleBin_module_name=Recycle Bin Analyzer ExtractRecycleBin_module_name=Recycle Bin Analyzer
@ -93,6 +91,14 @@ OpenIDE-Module-Long-Description=Recent Activity ingest module.\n\n The module ex
OpenIDE-Module-Name=RecentActivity OpenIDE-Module-Name=RecentActivity
OpenIDE-Module-Short-Description=Recent Activity finder ingest module OpenIDE-Module-Short-Description=Recent Activity finder ingest module
Chrome.moduleName=Chromium Analyzer Chrome.moduleName=Chromium Analyzer
Chrome.getLocalState.errMsg.errGettingFiles=Error when trying to get Local State file.
Chrome.getLocalState.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome Local State files.
Chrome.getLocalState.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1}
Chrome.getLocalState.displayName=Chromium Profiles
Chrome.getExtensions.errMsg.errGettingFiles=Error when trying to get Secure Preferences file.
Chrome.getExtensions.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome Secure Preferences file.
Chrome.getExtensions.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1}
Chrome.getExtensions.displayName=Chromium Extensions
Chrome.getHistory.errMsg.errGettingFiles=Error when trying to get Chrome history files. Chrome.getHistory.errMsg.errGettingFiles=Error when trying to get Chrome history files.
Chrome.getHistory.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome history files. Chrome.getHistory.errMsg.couldntFindAnyFiles=Could not find any allocated Chrome history files.
Chrome.getHistory.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1} Chrome.getHistory.errMsg.errAnalyzingFile={0}: Error while trying to analyze file:{1}
@ -105,6 +111,10 @@ Chrome.getCookie.errMsg.errGettingFiles=Error when trying to get Chrome history
Chrome.getCookie.errMsg.errAnalyzeFile={0}: Error while trying to analyze file:{1} Chrome.getCookie.errMsg.errAnalyzeFile={0}: Error while trying to analyze file:{1}
Chrome.getDownload.errMsg.errGettingFiles=Error when trying to get Chrome history files. Chrome.getDownload.errMsg.errGettingFiles=Error when trying to get Chrome history files.
Chrome.getDownload.errMsg.errAnalyzeFiles1={0}: Error while trying to analyze file:{1} Chrome.getDownload.errMsg.errAnalyzeFiles1={0}: Error while trying to analyze file:{1}
Chrome.getFavicon.errMsg.errGettingFiles=Error when trying to get Chrome favicon files.
Chrome.getFavicon.errMsg.errAnalyzeFiles1={0}: Error while trying to analyze file:{1}
Chrome.getFavicon.errMsg.errCreateArtifact=Error creating Favicon artifact
Chrome.getFavicon.displayName=Favicon
Chrome.getLogin.errMsg.errGettingFiles=Error when trying to get Chrome history files. Chrome.getLogin.errMsg.errGettingFiles=Error when trying to get Chrome history files.
Chrome.getLogin.errMsg.errAnalyzingFiles={0}: Error while trying to analyze file:{1} Chrome.getLogin.errMsg.errAnalyzingFiles={0}: Error while trying to analyze file:{1}
Chrome.getAutofill.errMsg.errGettingFiles=Error when trying to get Chrome Web Data files. Chrome.getAutofill.errMsg.errGettingFiles=Error when trying to get Chrome Web Data files.
@ -166,11 +176,14 @@ Progress_Message_Chrome_Cache=Chrome Cache
Progress_Message_Chrome_Cookies=Chrome Cookies Browser {0} Progress_Message_Chrome_Cookies=Chrome Cookies Browser {0}
# {0} - browserName # {0} - browserName
Progress_Message_Chrome_Downloads=Chrome Downloads Browser {0} Progress_Message_Chrome_Downloads=Chrome Downloads Browser {0}
Progress_Message_Chrome_Extensions=Chrome Extensions {0}
Progress_Message_Chrome_Favicons=Chrome Downloads Favicons {0}
Progress_Message_Chrome_FormHistory=Chrome Form History Progress_Message_Chrome_FormHistory=Chrome Form History
# {0} - browserName # {0} - browserName
Progress_Message_Chrome_History=Chrome History Browser {0} Progress_Message_Chrome_History=Chrome History Browser {0}
# {0} - browserName # {0} - browserName
Progress_Message_Chrome_Logins=Chrome Logins Browser {0} Progress_Message_Chrome_Logins=Chrome Logins Browser {0}
Progress_Message_Chrome_Profiles=Chrome Profiles {0}
Progress_Message_Edge_Bookmarks=Microsoft Edge Bookmarks Progress_Message_Edge_Bookmarks=Microsoft Edge Bookmarks
Progress_Message_Edge_Cookies=Microsoft Edge Cookies Progress_Message_Edge_Cookies=Microsoft Edge Cookies
Progress_Message_Edge_History=Microsoft Edge History Progress_Message_Edge_History=Microsoft Edge History
@ -225,7 +238,6 @@ Recently_Used_Artifacts_Winrar=Recently opened according to WinRAR MRU
Registry_System_Bam=Recently Executed according to Background Activity Moderator (BAM) Registry_System_Bam=Recently Executed according to Background Activity Moderator (BAM)
RegRipperFullNotFound=Full version RegRipper executable not found. RegRipperFullNotFound=Full version RegRipper executable not found.
RegRipperNotFound=Autopsy RegRipper executable not found. RegRipperNotFound=Autopsy RegRipper executable not found.
# {0} - file name
SearchEngineURLQueryAnalyzer.init.exception.msg=Unable to find {0}. SearchEngineURLQueryAnalyzer.init.exception.msg=Unable to find {0}.
SearchEngineURLQueryAnalyzer.moduleName.text=Search Engine Query Analyzer SearchEngineURLQueryAnalyzer.moduleName.text=Search Engine Query Analyzer
SearchEngineURLQueryAnalyzer.engineName.none=NONE SearchEngineURLQueryAnalyzer.engineName.none=NONE