diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties b/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties index 1ee80973b3..6d3f5b4b66 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties @@ -12,9 +12,6 @@ GeoFilterPanel.mostRecentButton.text=Only last GeoFilterPanel.applyButton.text=Apply GeoFilterPanel.showWaypointsWOTSCheckBox.text=Include waypoints with no time stamps GeoFilterPanel.daysLabel.text=days of activity -CheckBoxListPanel.titleLabel.text=jLabel1 -CheckBoxListPanel.checkButton.text=Check All -CheckBoxListPanel.uncheckButton.text=Uncheck All GeoFilterPanel.optionsLabel.text=Dates OptionsCategory_Name_Geolocation=Geolocation OptionsCategory_Keywords_Geolocation=Geolocation Settings diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties-MERGED index a27f92c887..f3dab8dd7e 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/geolocation/Bundle.properties-MERGED @@ -51,9 +51,6 @@ GeoFilterPanel.mostRecentButton.text=Only last GeoFilterPanel.applyButton.text=Apply GeoFilterPanel.showWaypointsWOTSCheckBox.text=Include waypoints with no time stamps GeoFilterPanel.daysLabel.text=days of activity -CheckBoxListPanel.titleLabel.text=jLabel1 -CheckBoxListPanel.checkButton.text=Check All -CheckBoxListPanel.uncheckButton.text=Uncheck All GeoFilterPanel.optionsLabel.text=Dates OptionsCategory_Name_Geolocation=Geolocation OptionsCategory_Keywords_Geolocation=Geolocation Settings diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/GeoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/geolocation/GeoFilterPanel.java index d8121e68a1..2aa820b12f 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/GeoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/geolocation/GeoFilterPanel.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.geolocation; +import org.sleuthkit.autopsy.guiutils.CheckBoxListPanel; import java.awt.Color; import java.awt.Graphics; import java.awt.GridBagConstraints; diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/GeoPath.java b/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/GeoPath.java index 99b5db351f..c61dea93be 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/GeoPath.java +++ b/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/GeoPath.java @@ -126,7 +126,7 @@ public class GeoPath { * * @return */ - final BlackboardArtifact getArtifact() { + public final BlackboardArtifact getArtifact() { return artifact; } diff --git a/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties b/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties new file mode 100755 index 0000000000..01a3056f45 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties @@ -0,0 +1,3 @@ +CheckBoxListPanel.titleLabel.text= +CheckBoxListPanel.checkButton.text=Check All +CheckBoxListPanel.uncheckButton.text=Uncheck All \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties-MERGED index d01a4381df..e60f64b854 100755 --- a/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/guiutils/Bundle.properties-MERGED @@ -1,3 +1,6 @@ +CheckBoxListPanel.titleLabel.text= +CheckBoxListPanel.checkButton.text=Check All +CheckBoxListPanel.uncheckButton.text=Uncheck All StatusIconCellRenderer.tooltiptext.error=An error occurred StatusIconCellRenderer.tooltiptext.ok=OK StatusIconCellRenderer.tooltiptext.warning=A warning occurred diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxJList.java b/Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxJList.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxJList.java rename to Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxJList.java index 7763d1a19a..ab17187c4b 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxJList.java +++ b/Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxJList.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.geolocation; +package org.sleuthkit.autopsy.guiutils; import java.awt.BorderLayout; import java.awt.Component; diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxListPanel.form b/Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxListPanel.form similarity index 89% rename from Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxListPanel.form rename to Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxListPanel.form index 75fb1d4c62..4b6dd5b7c9 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxListPanel.form +++ b/Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxListPanel.form @@ -19,7 +19,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxListPanel.java b/Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxListPanel.java similarity index 94% rename from Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxListPanel.java rename to Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxListPanel.java index bf74ba1a56..775c99eb77 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/CheckBoxListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/guiutils/CheckBoxListPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.geolocation; +package org.sleuthkit.autopsy.guiutils; import java.util.ArrayList; import java.util.Enumeration; @@ -26,9 +26,9 @@ import javax.swing.DefaultListModel; import javax.swing.Icon; /** - * A panel for showing Content objects in a check box list. + * A panel for showing any object in a check box list. */ -final class CheckBoxListPanel extends javax.swing.JPanel { +public final class CheckBoxListPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -38,7 +38,7 @@ final class CheckBoxListPanel extends javax.swing.JPanel { /** * Creates new CheckboxFilterPanel */ - CheckBoxListPanel() { + public CheckBoxListPanel() { initComponents(); checkboxList = new CheckBoxJList<>(); @@ -52,7 +52,7 @@ final class CheckBoxListPanel extends javax.swing.JPanel { * @param displayName display name for the checkbox * @param obj Object that the checkbox represents */ - void addElement(String displayName, Icon icon, T obj) { + public void addElement(String displayName, Icon icon, T obj) { ObjectCheckBox newCheckBox = new ObjectCheckBox<>(displayName, icon, true, obj); if(!model.contains(newCheckBox)) { @@ -63,11 +63,11 @@ final class CheckBoxListPanel extends javax.swing.JPanel { /** * Remove all objects from the checkbox list. */ - void clearList() { + public void clearList() { model.removeAllElements(); } - boolean isEmpty() { + public boolean isEmpty() { return model.isEmpty(); } @@ -84,7 +84,7 @@ final class CheckBoxListPanel extends javax.swing.JPanel { * * @return List of selected elements. */ - List getSelectedElements() { + public List getSelectedElements() { List selectedElements = new ArrayList<>(); Enumeration> elements = model.elements(); @@ -103,7 +103,7 @@ final class CheckBoxListPanel extends javax.swing.JPanel { * * @param selected True to check the boxes, false to unchecked */ - void setSetAllSelected(boolean selected) { + public void setSetAllSelected(boolean selected) { Enumeration> enumeration = model.elements(); while (enumeration.hasMoreElements()) { ObjectCheckBox element = enumeration.nextElement(); @@ -119,7 +119,7 @@ final class CheckBoxListPanel extends javax.swing.JPanel { * * @param title Panel title or null for no title. */ - void setPanelTitle(String title) { + public void setPanelTitle(String title) { titleLabel.setText(title); } @@ -128,7 +128,7 @@ final class CheckBoxListPanel extends javax.swing.JPanel { * * @param icon Icon to set or null for no icon */ - void setPanelTitleIcon(Icon icon) { + public void setPanelTitleIcon(Icon icon) { titleLabel.setIcon(icon); } diff --git a/Core/src/org/sleuthkit/autopsy/report/GeneralReportModule.java b/Core/src/org/sleuthkit/autopsy/report/GeneralReportModule.java index da0541b48a..f491bd5e5b 100644 --- a/Core/src/org/sleuthkit/autopsy/report/GeneralReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/report/GeneralReportModule.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2012-2018 Basis Technology Corp. + * Copyright 2012-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,10 +25,43 @@ public interface GeneralReportModule extends ReportModule { * at the path specified and updating progress via the progressPanel object. * * @param baseReportDir Base directory that reports are being stored in. - * Report should go into baseReportDir + - * getRelativeFilePath(). + * Report should go into baseReportDir + getRelativeFilePath(). + * @param progressPanel panel to update the report's progress with + * + * @deprecated Use generateReport(GeneralReportSettings settings, + * ReportProgressPanel progressPanel) instead. The baseReportDir + * is stored in the settings instance. + */ + @Deprecated + default void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { + + } + + /** + * Called to generate the report. Method is responsible for saving the file + * and updating progress via the progressPanel object. Configuration + * parameters are passed in the settings class, most notably the directory + * to save the report. Modules should try to respond to all configuration + * parameters. + * + * @param settings Configuration parameters to customize the report + * generation process * @param progressPanel panel to update the report's progress with */ - public void generateReport(String baseReportDir, ReportProgressPanel progressPanel); + @SuppressWarnings("deprecation") + default void generateReport(GeneralReportSettings settings, ReportProgressPanel progressPanel) { + generateReport(settings.getReportDirectoryPath(), progressPanel); + } + /** + * Determines if the module supports report generation on a subset of data + * sources in a case. Defaults to false. The data source selections are + * stored in the GeneralReportSettings instance. + * + * @return True if the module can be configured to run on a subset of data + * sources. + */ + default boolean supportsDataSourceSelection() { + return false; + } } diff --git a/Core/src/org/sleuthkit/autopsy/report/GeneralReportModuleAdapter.java b/Core/src/org/sleuthkit/autopsy/report/GeneralReportModuleAdapter.java index f66b1c69a2..24ef35b885 100644 --- a/Core/src/org/sleuthkit/autopsy/report/GeneralReportModuleAdapter.java +++ b/Core/src/org/sleuthkit/autopsy/report/GeneralReportModuleAdapter.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014 Basis Technology Corp. + * Copyright 2014-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,7 +38,10 @@ public abstract class GeneralReportModuleAdapter implements GeneralReportModule } @Override - public abstract void generateReport(String baseReportDir, ReportProgressPanel progressPanel); + @Deprecated + public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { + + } @Override public JPanel getConfigurationPanel() { diff --git a/Core/src/org/sleuthkit/autopsy/report/GeneralReportSettings.java b/Core/src/org/sleuthkit/autopsy/report/GeneralReportSettings.java new file mode 100755 index 0000000000..0ba6d9ec62 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/GeneralReportSettings.java @@ -0,0 +1,65 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2020 Basis Technology Corp. + * Contact: carrier sleuthkit 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; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * Configuration parameters for general report modules + */ +public class GeneralReportSettings implements Serializable { + private static final long serialVersionUID = 1L; + + private List selectedDataSources; + private String reportDirectoryPath; + + /** + * Returns the selected data sources + * @return List of data source ids + */ + public List getSelectedDataSources() { + return selectedDataSources; + } + + /** + * Sets the selected data sources + * @param selectedDataSources List of data source ids + */ + public void setSelectedDataSources(List selectedDataSources) { + this.selectedDataSources = new ArrayList<>(selectedDataSources); + } + + /** + * Returns the directory that the report file should be saved in. + * @return Path to report directory + */ + public String getReportDirectoryPath() { + return this.reportDirectoryPath; + } + + /** + * Sets the directory that the report file should be saved in. + * @param reportDirectoryPath Path to report directory + */ + public void setReportDirectoryPath(String reportDirectoryPath) { + this.reportDirectoryPath = reportDirectoryPath; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/report/infrastructure/Bundle.properties-MERGED index 7a9c14627a..d36c0f5ca6 100755 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/Bundle.properties-MERGED @@ -15,6 +15,10 @@ ReportProgressIndicator.completedWithErrorsMessage=Report generation completed w ReportProgressIndicator.startMessage=Report generation started ReportProgressIndicator.switchToDeterminateMessage=Report generation progress switched to determinate ReportProgressIndicator.switchToIndeterminateMessage=Report generation progress switched to indeterminate +ReportWizardDataSourceSelectionPanel.confirmEmptySelection=Are you sure you want to proceed with no selections? +ReportWizardDataSourceSelectionPanel.finishButton.text=Finish +ReportWizardDataSourceSelectionPanel.nextButton.text=Next +ReportWizardDataSourceSelectionPanel.title=Select which datasource(s) to include ReportWizardFileOptionsVisualPanel.jLabel1.text=Select items to include in File Report: ReportWizardFileOptionsVisualPanel.deselectAllButton.text=Deselect All ReportWizardFileOptionsVisualPanel.selectAllButton.text=Select All diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/FileReportSettings.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/FileReportSettings.java index 8cde112672..427cfb77cd 100755 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/FileReportSettings.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/FileReportSettings.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,9 @@ package org.sleuthkit.autopsy.report.infrastructure; import java.io.Serializable; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -30,6 +32,7 @@ final class FileReportSettings implements Serializable { private static final long serialVersionUID = 1L; private Map filePropertiesInfo = new HashMap<>(); + private List selectedDataSources; /** * Creates FileReportSettings object. @@ -49,4 +52,18 @@ final class FileReportSettings implements Serializable { Map getFileProperties() { return filePropertiesInfo; } + + /** + * Returns the selected data sources + */ + List getSelectedDataSources() { + return selectedDataSources; + } + + /** + * Sets the selected data sources + */ + void setSelectedDataSources(List selectedDataSources) { + this.selectedDataSources = new ArrayList<>(selectedDataSources); + } } diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportGenerator.java index 04c5413641..a889d4f2a8 100644 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportGenerator.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-2019 Basis Technology Corp. + * Copyright 2013-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -48,6 +48,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.python.FactoryClassNameNormalizer; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.ReportProgressPanel; import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; import org.sleuthkit.datamodel.AbstractFile; @@ -208,7 +209,7 @@ public class ReportGenerator { if (module instanceof GeneralReportModule) { // generate report - generateGeneralReport((GeneralReportModule) module); + generateGeneralReport((GeneralReportModule) module, config.getGeneralReportSettings()); } else if (module instanceof TableReportModule) { @@ -297,11 +298,12 @@ public class ReportGenerator { /** * Run the GeneralReportModules using a SwingWorker. */ - private void generateGeneralReport(GeneralReportModule generalReportModule) throws IOException { + private void generateGeneralReport(GeneralReportModule generalReportModule, GeneralReportSettings reportSettings) throws IOException { if (generalReportModule != null) { String reportDir = createReportDirectory(generalReportModule); setupProgressPanel(generalReportModule, reportDir); - generalReportModule.generateReport(reportDir, progressIndicator); + reportSettings.setReportDirectoryPath(reportDir); + generalReportModule.generateReport(reportSettings, progressIndicator); } } @@ -359,6 +361,10 @@ public class ReportGenerator { int i = 0; // Add files to report. for (AbstractFile file : files) { + if(shouldFilterFromReport(file, fileReportSettings)) { + continue; + } + // Check to see if any reports have been cancelled. if (progressIndicator.getStatus() == ReportStatus.CANCELED) { return; @@ -380,6 +386,14 @@ public class ReportGenerator { progressIndicator.complete(ReportStatus.COMPLETE); } } + + private boolean shouldFilterFromReport(AbstractFile file, FileReportSettings fileReportSettings) { + if(fileReportSettings.getSelectedDataSources() == null) { + return false; + } + // Filter if the data source id is not in the list to process + return !fileReportSettings.getSelectedDataSources().contains(file.getDataSourceObjectId()); + } /** * Run the Portable Case Report Module diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportVisualPanel1.java index 7eca143b80..b9d9fc8b34 100644 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportVisualPanel1.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2012-2019 Basis Technology Corp. + * Copyright 2012-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -368,8 +368,10 @@ final class ReportVisualPanel1 extends JPanel implements ListSelectionListener { configurationPanel.revalidate(); configurationPanel.repaint(); - boolean generalModuleSelected = (module instanceof GeneralReportModule); - + // General modules that support data source selection will be presented + // a data source selection panel, so they should not be finished immediately. + boolean generalModuleSelected = (module instanceof GeneralReportModule) && !((GeneralReportModule)module).supportsDataSourceSelection(); + wizPanel.setNext(!generalModuleSelected); wizPanel.setFinish(generalModuleSelected); } diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardAction.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardAction.java index 236263200a..fd03660e51 100644 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardAction.java @@ -2,7 +2,7 @@ * * Autopsy Forensic Browser * - * Copyright 2012-2019 Basis Technology Corp. + * Copyright 2012-2020 Basis Technology Corp. * * Copyright 2012 42six Solutions. * Contact: aebadirad 42six com @@ -31,6 +31,7 @@ import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.text.MessageFormat; import java.util.EnumSet; +import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.logging.Level; @@ -52,6 +53,7 @@ import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.core.RuntimeProperties; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.ReportModule; @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.report.infrastructure.ReportWizardAction") @@ -117,8 +119,25 @@ public final class ReportWizardAction extends CallableSystemAction implements Pr private static void saveReportingConfiguration(String configName, WizardDescriptor wiz) throws ReportConfigException { ReportingConfig reportingConfig = new ReportingConfig(configName); - reportingConfig.setFileReportSettings((FileReportSettings) wiz.getProperty("fileReportSettings")); - reportingConfig.setTableReportSettings((TableReportSettings) wiz.getProperty("tableReportSettings")); + List selectedDataSourceIds = (List) wiz.getProperty("dataSourceSelections"); + + // Set the selected data source ids. + FileReportSettings fileSettings = (FileReportSettings) wiz.getProperty("fileReportSettings"); + TableReportSettings tableSettings = (TableReportSettings) wiz.getProperty("tableReportSettings"); + GeneralReportSettings generalSettings = new GeneralReportSettings(); + if(selectedDataSourceIds != null) { + generalSettings.setSelectedDataSources(selectedDataSourceIds); + if(fileSettings != null) { + fileSettings.setSelectedDataSources(selectedDataSourceIds); + } + if(tableSettings != null) { + tableSettings.setSelectedDataSources(selectedDataSourceIds); + } + } + + reportingConfig.setFileReportSettings(fileSettings); + reportingConfig.setTableReportSettings(tableSettings); + reportingConfig.setGeneralReportSettings(generalSettings); Map moduleConfigs = (Map) wiz.getProperty("moduleConfigs"); diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardDataSourceSelectionPanel.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardDataSourceSelectionPanel.java new file mode 100755 index 0000000000..bfdd1dc5c1 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardDataSourceSelectionPanel.java @@ -0,0 +1,151 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2020 Basis Technology Corp. + * Contact: carrier sleuthkit 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; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.List; +import java.util.logging.Level; +import javax.swing.JButton; +import javax.swing.event.ChangeListener; +import org.openide.WizardDescriptor; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.NbPreferences; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.guiutils.CheckBoxListPanel; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; +import org.sleuthkit.datamodel.Content; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * Selection panel for modules that can report on a subset of data sources in a + * case. + */ +public class ReportWizardDataSourceSelectionPanel implements WizardDescriptor.FinishablePanel { + + private static final Logger logger = Logger.getLogger(ReportWizardDataSourceSelectionPanel.class.getName()); + + private CheckBoxListPanel dataSourcesSelectionPanel; + private WizardDescriptor wiz; + + private final JButton finishButton; + private final JButton nextButton; + + @NbBundle.Messages({ + "ReportWizardDataSourceSelectionPanel.nextButton.text=Next", + "ReportWizardDataSourceSelectionPanel.finishButton.text=Finish" + }) + public ReportWizardDataSourceSelectionPanel() { + nextButton = new JButton(Bundle.ReportWizardDataSourceSelectionPanel_nextButton_text()); + finishButton = new JButton(Bundle.ReportWizardDataSourceSelectionPanel_finishButton_text()); + finishButton.setEnabled(false); + nextButton.setEnabled(false); + + finishButton.addActionListener(createFinishButtonActionListener()); + nextButton.addActionListener(createNextButtonActionListener()); + } + + @NbBundle.Messages({ + "ReportWizardDataSourceSelectionPanel.confirmEmptySelection=Are you sure you want to proceed with no selections?" + }) + private ActionListener createNextButtonActionListener() { + return (ActionEvent e) -> { + if(!dataSourcesSelectionPanel.getSelectedElements().isEmpty()) { + wiz.doNextClick(); + } else if(MessageNotifyUtil.Message.confirm(Bundle.ReportWizardDataSourceSelectionPanel_confirmEmptySelection())) { + wiz.doNextClick(); + } + }; + } + + private ActionListener createFinishButtonActionListener() { + return (ActionEvent e) -> { + if(!dataSourcesSelectionPanel.getSelectedElements().isEmpty()) { + wiz.doFinishClick(); + } else if(MessageNotifyUtil.Message.confirm(Bundle.ReportWizardDataSourceSelectionPanel_confirmEmptySelection())) { + wiz.doFinishClick(); + } + }; + } + + @NbBundle.Messages({ + "ReportWizardDataSourceSelectionPanel.title=Select which datasource(s) to include" + }) + @Override + public CheckBoxListPanel getComponent() { + if (dataSourcesSelectionPanel == null) { + dataSourcesSelectionPanel = new CheckBoxListPanel<>(); + dataSourcesSelectionPanel.setName(Bundle.ReportWizardDataSourceSelectionPanel_title()); + try { + List dataSources = Case.getCurrentCase().getDataSources(); + for (Content dataSource : dataSources) { + String dataSourceName = dataSource.getName(); + long dataSourceId = dataSource.getId(); + dataSourcesSelectionPanel.addElement(dataSourceName, null, dataSourceId); + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Unable to get list of data sources from the case", ex); + } + } + return dataSourcesSelectionPanel; + } + + @Override + public HelpCtx getHelp() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public void readSettings(WizardDescriptor data) { + this.wiz = data; + wiz.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, nextButton, finishButton, WizardDescriptor.CANCEL_OPTION}); + + boolean generalModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("generalModule", true); //NON-NLS + nextButton.setEnabled(!generalModule); + finishButton.setEnabled(generalModule); + } + + @Override + public void storeSettings(WizardDescriptor data) { + List selectedDataSources = getComponent().getSelectedElements(); + data.putProperty("dataSourceSelections", selectedDataSources); + } + + @Override + public boolean isValid() { + return true; + } + + @Override + public void addChangeListener(ChangeListener cl) { + // Nothing to do + } + + @Override + public void removeChangeListener(ChangeListener cl) { + // Nothing to do + } + + @Override + public boolean isFinishPanel() { + return true; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardIterator.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardIterator.java index d39db13392..7a716e246f 100644 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardIterator.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportWizardIterator.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2012 Basis Technology Corp. + * Copyright 2012-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.report.infrastructure; import java.awt.Component; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.NoSuchElementException; @@ -38,6 +39,7 @@ final class ReportWizardIterator implements WizardDescriptor.Iterator> panels; @@ -78,8 +80,10 @@ final class ReportWizardIterator implements WizardDescriptor.Iterator(panels); + panels.add(1, dataSourceSelectionPanel); + } } else if (portableCaseModule) { // Portable Case Module selected, need Portable Case Configuration Panel // (ReportWizardPortableCaseOptionsPanel) @@ -128,6 +138,10 @@ final class ReportWizardIterator implements WizardDescriptor.Iterator(panels); + panels.add(1, dataSourceSelectionPanel); + } } } @@ -164,7 +178,8 @@ final class ReportWizardIterator implements WizardDescriptor.Iterator sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,7 @@ import org.openide.WizardDescriptor; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.NbPreferences; -import org.sleuthkit.autopsy.report.ReportModule; +import org.sleuthkit.autopsy.report.GeneralReportModule; class ReportWizardPanel1 implements WizardDescriptor.FinishablePanel { @@ -116,8 +116,25 @@ class ReportWizardPanel1 implements WizardDescriptor.FinishablePanel sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.report.infrastructure; import java.io.Serializable; import java.util.HashMap; import java.util.Map; +import org.sleuthkit.autopsy.report.GeneralReportSettings; /** * A bundling of all the settings objects that define a report configuration. @@ -32,6 +33,7 @@ final class ReportingConfig implements Serializable { private Map moduleConfigs = new HashMap<>(); private TableReportSettings tableReportSettings; private FileReportSettings fileReportSettings; + private GeneralReportSettings generalReportSettings; /** * Creates ReportingConfig object. @@ -74,4 +76,11 @@ final class ReportingConfig implements Serializable { return this.fileReportSettings; } + GeneralReportSettings getGeneralReportSettings() { + return this.generalReportSettings; + } + + void setGeneralReportSettings(GeneralReportSettings generalReportSettings) { + this.generalReportSettings = generalReportSettings; + } } diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportingConfigLoader.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportingConfigLoader.java index 6472105888..7f1ee8fc87 100755 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportingConfigLoader.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/ReportingConfigLoader.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,6 +34,7 @@ import org.openide.util.io.NbObjectInputStream; import org.openide.util.io.NbObjectOutputStream; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; +import org.sleuthkit.autopsy.report.GeneralReportSettings; /** * Utility class responsible for managing serialization and deserialization of @@ -48,6 +49,7 @@ final class ReportingConfigLoader { private static final String REPORT_SETTINGS_FILE_EXTENSION = ".settings"; private static final String TABLE_REPORT_CONFIG_FILE = "TableReportSettings.settings"; private static final String FILE_REPORT_CONFIG_FILE = "FileReportSettings.settings"; + private static final String GENERAL_REPORT_CONFIG_FILE = "GeneralReportSettings.settings"; private static final String MODULE_CONFIG_FILE = "ModuleConfigs.settings"; /** @@ -96,6 +98,13 @@ final class ReportingConfigLoader { } catch (IOException | ClassNotFoundException ex) { throw new ReportConfigException("Unable to read file report settings " + filePath, ex); } + + filePath = reportDirPath.resolve(GENERAL_REPORT_CONFIG_FILE).toString(); + try (NbObjectInputStream in = new NbObjectInputStream(new FileInputStream(filePath))) { + config.setGeneralReportSettings((GeneralReportSettings) in.readObject()); + } catch (IOException | ClassNotFoundException ex) { + throw new ReportConfigException("Unable to read general report settings " + filePath, ex); + } // read map of module configuration objects Map moduleConfigs = null; @@ -173,6 +182,13 @@ final class ReportingConfigLoader { } catch (IOException ex) { throw new ReportConfigException("Unable to save file report configuration " + filePath, ex); } + + filePath = pathToConfigDir.resolve(GENERAL_REPORT_CONFIG_FILE).toString(); + try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(filePath))) { + out.writeObject(reportConfig.getGeneralReportSettings()); + } catch (IOException ex) { + throw new ReportConfigException("Unable to save general report configuration " + filePath, ex); + } // save map of module configuration objects filePath = pathToConfigDir.toString() + File.separator + MODULE_CONFIG_FILE; diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java index aa4ceab7dc..527301f491 100644 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-2019 Basis Technology Corp. + * Copyright 2013-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -366,6 +366,16 @@ class TableReportGenerator { // Give the modules the rows for the content tags. for (ContentTag tag : tags) { + try { + if(shouldFilterFromReport(tag.getContent())) { + continue; + } + } catch (TskCoreException ex) { + errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags")); + logger.log(Level.SEVERE, "Failed to access content data from the case database.", ex); //NON-NLS + return; + } + // skip tags that we are not reporting on String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : ""; if (passesTagNamesFilter(tag.getName().getDisplayName() + notableString) == false) { @@ -446,6 +456,16 @@ class TableReportGenerator { // Give the modules the rows for the content tags. for (BlackboardArtifactTag tag : tags) { + try { + if(shouldFilterFromReport(tag.getContent())) { + continue; + } + } catch (TskCoreException ex) { + errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifactTags")); + logger.log(Level.SEVERE, "Failed to access content data from the case database.", ex); //NON-NLS + return; + } + String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : ""; if (passesTagNamesFilter(tag.getName().getDisplayName() + notableString) == false) { continue; @@ -799,6 +819,9 @@ class TableReportGenerator { AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId); if (f != null) { uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath(); + if(shouldFilterFromReport(f)) { + continue; + } } } catch (TskCoreException ex) { errorList.add( @@ -956,6 +979,9 @@ class TableReportGenerator { AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId); if (f != null) { uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath(); + if(shouldFilterFromReport(f)) { + continue; + } } } catch (TskCoreException ex) { errorList.add( @@ -1198,6 +1224,10 @@ class TableReportGenerator { List artifacts = new ArrayList<>(); try { for (BlackboardArtifact artifact : Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) { + if(shouldFilterFromReport(artifact)) { + continue; + } + List tags = Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact); HashSet uniqueTagNames = new HashSet<>(); for (BlackboardArtifactTag tag : tags) { @@ -1792,6 +1822,18 @@ class TableReportGenerator { return ""; } + + /** + * Indicates if the content should be filtered from the report. + */ + private boolean shouldFilterFromReport(Content content) throws TskCoreException { + if(this.settings.getSelectedDataSources() == null) { + return false; + } + + long dataSourceId = content.getDataSource().getId(); + return !this.settings.getSelectedDataSources().contains(dataSourceId); + } /** * Get any tags associated with an artifact diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportSettings.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportSettings.java index 1b482046ee..e3a812e448 100755 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportSettings.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportSettings.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,6 +45,7 @@ final class TableReportSettings implements Serializable { private final List tagNames = new ArrayList<>(); private final boolean useStoredTagsAndArtifactsLists; private final TableReportOption reportOption; + private List selectedDataSources; /** * Creates TableReportSettings object. This constructor is used when user @@ -99,4 +100,18 @@ final class TableReportSettings implements Serializable { TableReportOption getSelectedReportOption() { return reportOption; } + + /** + * Returns the selected data sources + */ + List getSelectedDataSources() { + return selectedDataSources; + } + + /** + * Sets the selected data sources + */ + void setSelectedDataSources(List selectedDataSources) { + this.selectedDataSources = new ArrayList<>(selectedDataSources); + } } diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/bodyfile/BodyFileReport.java b/Core/src/org/sleuthkit/autopsy/report/modules/bodyfile/BodyFileReport.java index a0d43bf4e5..3f34982489 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/bodyfile/BodyFileReport.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/bodyfile/BodyFileReport.java @@ -2,7 +2,7 @@ * * Autopsy Forensic Browser * - * Copyright 2012-2018 Basis Technology Corp. + * Copyright 2012-2020 Basis Technology Corp. * * Copyright 2012 42six Solutions. * Contact: aebadirad 42six com @@ -28,6 +28,7 @@ import java.io.FileWriter; import java.io.IOException; import java.util.List; import java.util.logging.Level; +import java.util.stream.Collectors; import javax.swing.JPanel; import org.openide.util.NbBundle; @@ -35,6 +36,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestManager; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.ReportProgressPanel; import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; import org.sleuthkit.datamodel.*; @@ -65,6 +67,11 @@ class BodyFileReport implements GeneralReportModule { } return instance; } + + @Override + public boolean supportsDataSourceSelection() { + return true; + } /** * Generates a body file format report for use with the MAC time tool. @@ -73,8 +80,7 @@ class BodyFileReport implements GeneralReportModule { * @param progressPanel panel to update the report's progress */ @Override - @SuppressWarnings("deprecation") - public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { + public void generateReport(GeneralReportSettings settings, ReportProgressPanel progressPanel) { // Start the progress bar and setup the report try { currentCase = Case.getCurrentCaseThrows(); @@ -85,7 +91,7 @@ class BodyFileReport implements GeneralReportModule { progressPanel.setIndeterminate(false); progressPanel.start(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.querying")); - reportPath = baseReportDir + getRelativeFilePath(); //NON-NLS + reportPath = settings.getReportDirectoryPath() + getRelativeFilePath(); //NON-NLS skCase = currentCase.getSleuthkitCase(); @@ -96,7 +102,17 @@ class BodyFileReport implements GeneralReportModule { + " AND name != '.' AND name != '..'"; //NON-NLS progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.loading")); - List fs = skCase.findAllFilesWhere(query); + // Filter the list to only include files that are contained within + // the set of data sources to process. + List fs = skCase.findAllFilesWhere(query).stream() + .filter((file) -> { + if(settings.getSelectedDataSources() == null) { + // Assume all data sources if list is null. + return true; + } + return settings.getSelectedDataSources().contains(file.getDataSourceObjectId()); + }) + .collect(Collectors.toList()); // Check if ingest has finished String ingestwarning = ""; diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/caseuco/CaseUcoReportModule.java b/Core/src/org/sleuthkit/autopsy/report/modules/caseuco/CaseUcoReportModule.java index 0fd5d93579..3b9c7232d3 100755 --- a/Core/src/org/sleuthkit/autopsy/report/modules/caseuco/CaseUcoReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/caseuco/CaseUcoReportModule.java @@ -29,6 +29,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.logging.Level; +import java.util.stream.Collectors; import javax.swing.JPanel; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -36,6 +37,7 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.report.GeneralReportModule; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.ReportProgressPanel; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content; @@ -98,6 +100,11 @@ public final class CaseUcoReportModule implements GeneralReportModule { public static String getReportFileName() { return REPORT_FILE_NAME; } + + @Override + public boolean supportsDataSourceSelection() { + return true; + } /** * Generates a CASE-UCO format report for all files in the Case. @@ -117,14 +124,13 @@ public final class CaseUcoReportModule implements GeneralReportModule { "CaseUcoReportModule.srcModuleName=CASE-UCO Report" }) @Override - @SuppressWarnings("deprecation") - public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { + public void generateReport(GeneralReportSettings settings, ReportProgressPanel progressPanel) { try { // Check if ingest has finished warnIngest(progressPanel); //Create report paths if they don't already exist. - Path reportDirectory = Paths.get(baseReportDir); + Path reportDirectory = Paths.get(settings.getReportDirectoryPath()); try { Files.createDirectories(reportDirectory); } catch (IOException ex) { @@ -141,7 +147,16 @@ public final class CaseUcoReportModule implements GeneralReportModule { Case caseObj = Case.getCurrentCaseThrows(); generator.addCase(caseObj); - List dataSources = caseObj.getDataSources(); + List dataSources = caseObj.getDataSources().stream() + .filter((dataSource) -> { + if(settings.getSelectedDataSources() == null) { + // Assume all data sources if list is null. + return true; + } + return settings.getSelectedDataSources().contains(dataSource.getId()); + }) + .collect(Collectors.toList()); + progressPanel.setIndeterminate(false); progressPanel.setMaximumProgress(dataSources.size()); progressPanel.start(); diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/excel/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/report/modules/excel/Bundle.properties-MERGED index abdc200271..6a40a2b22b 100755 --- a/Core/src/org/sleuthkit/autopsy/report/modules/excel/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/report/modules/excel/Bundle.properties-MERGED @@ -14,6 +14,6 @@ ReportExcel.writeSummary.caseName=Case Name: ReportExcel.writeSummary.caseNotes=Case Notes: ReportExcel.writeSummary.caseNum=Case Number: ReportExcel.writeSummary.examiner=Examiner: -ReportExcel.writeSummary.numImages=Number of Images: +ReportExcel.writeSummary.numImages=Number of data sources in case: ReportExcel.writeSummary.sheetName=Summary ReportExcel.writeSummary.summary=Summary diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/excel/ExcelReport.java b/Core/src/org/sleuthkit/autopsy/report/modules/excel/ExcelReport.java index 768bbcf5ec..15471386f5 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/excel/ExcelReport.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/excel/ExcelReport.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-2018 Basis Technology Corp. + * Copyright 2013-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -307,7 +307,7 @@ class ExcelReport implements TableReportModule { "ReportExcel.writeSummary.sheetName=Summary", "ReportExcel.writeSummary.summary=Summary", "ReportExcel.writeSummary.caseName=Case Name:", - "ReportExcel.writeSummary.numImages=Number of Images:", + "ReportExcel.writeSummary.numImages=Number of data sources in case:", "ReportExcel.writeSummary.caseNum=Case Number:", "ReportExcel.writeSummary.caseNotes=Case Notes:", "ReportExcel.writeSummary.examiner=Examiner:" diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/html/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/report/modules/html/Bundle.properties-MERGED index 0be7595111..fce93671b3 100755 --- a/Core/src/org/sleuthkit/autopsy/report/modules/html/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/report/modules/html/Bundle.properties-MERGED @@ -13,7 +13,7 @@ ReportHTML.writeNav.summary=Case Summary ReportHTML.writeSum.case=Case: ReportHTML.writeSum.caseNotes=Notes: ReportHTML.writeSum.caseNumber=Case Number: -ReportHTML.writeSum.caseNumImages=Number of Images: +ReportHTML.writeSum.caseNumImages=Number of data sources in case: ReportHTML.writeSum.examiner=Examiner: ReportHTML.writeSum.title=Case Summary ReportHTML.writeSum.warningMsg=Warning, this report was run before ingest services completed! diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/html/HTMLReport.java b/Core/src/org/sleuthkit/autopsy/report/modules/html/HTMLReport.java index 46c1268f2c..6c49926907 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/html/HTMLReport.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/html/HTMLReport.java @@ -1343,7 +1343,7 @@ public class HTMLReport implements TableReportModule { @Messages({ "ReportHTML.writeSum.case=Case:", "ReportHTML.writeSum.caseNumber=Case Number:", - "ReportHTML.writeSum.caseNumImages=Number of Images:", + "ReportHTML.writeSum.caseNumImages=Number of data sources in case:", "ReportHTML.writeSum.caseNotes=Notes:", "ReportHTML.writeSum.examiner=Examiner:" }) diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/kml/KMLReport.java b/Core/src/org/sleuthkit/autopsy/report/modules/kml/KMLReport.java index c13f385ba3..3a038adea5 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/kml/KMLReport.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/kml/KMLReport.java @@ -35,6 +35,7 @@ import java.nio.file.Paths; import java.text.SimpleDateFormat; import java.util.List; import java.util.logging.Level; +import java.util.stream.Collectors; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.Namespace; @@ -49,9 +50,11 @@ import org.sleuthkit.autopsy.geolocation.datamodel.Waypoint; import org.sleuthkit.autopsy.geolocation.datamodel.Route; import org.sleuthkit.autopsy.geolocation.datamodel.Track; import org.sleuthkit.autopsy.geolocation.datamodel.WaypointBuilder; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.ReportBranding; import org.sleuthkit.autopsy.report.ReportProgressPanel; import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ReadContentInputStream; import org.sleuthkit.datamodel.ReadContentInputStream.ReadContentInputStreamException; import org.sleuthkit.datamodel.SleuthkitCase; @@ -80,6 +83,8 @@ public final class KMLReport implements GeneralReportModule { private Element gpsSearchesFolder; private Element gpsTrackpointsFolder; private Element gpsTracksFolder; + + private GeneralReportSettings settings; private List waypointList = null; @@ -151,17 +156,41 @@ public final class KMLReport implements GeneralReportModule { public void generateReport(String baseReportDir, ReportProgressPanel progressPanel, List waypointList) { this.waypointList = waypointList; - generateReport(baseReportDir, progressPanel); + GeneralReportSettings reportSettings = new GeneralReportSettings(); + reportSettings.setReportDirectoryPath(baseReportDir); + generateReport(reportSettings, progressPanel); } - + @Override - public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { + public boolean supportsDataSourceSelection() { + return true; + } + + @Override + public void generateReport(GeneralReportSettings settings, ReportProgressPanel progressPanel) { try { currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; } + + if(settings.getSelectedDataSources() == null) { + // Process all data sources if the list is null. + try { + List selectedDataSources = currentCase.getDataSources() + .stream() + .map(Content::getId) + .collect(Collectors.toList()); + settings.setSelectedDataSources(selectedDataSources); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Could not get the datasources from the case", ex); + return; + } + } + + String baseReportDir = settings.getReportDirectoryPath(); + this.settings = settings; // Start the progress bar and setup the report progressPanel.setIndeterminate(true); progressPanel.start(); @@ -181,7 +210,7 @@ public final class KMLReport implements GeneralReportModule { makeRoutes(skCase); makeTracks(skCase); addLocationsToReport(skCase, baseReportDir); - } catch (GeoLocationDataException | IOException ex) { + } catch (GeoLocationDataException | IOException | TskCoreException ex) { errorMessage = "Failed to complete report."; logger.log(Level.SEVERE, errorMessage, ex); //NON-NLS result = ReportProgressPanel.ReportStatus.ERROR; @@ -318,8 +347,12 @@ public final class KMLReport implements GeneralReportModule { * * @throws IOException */ - void addExifMetadataContent(List points, String baseReportDirectory) throws IOException { + void addExifMetadataContent(List points, String baseReportDirectory) throws IOException, TskCoreException { for (Waypoint point : points) { + if(shouldFilterFromReport(point.getArtifact())) { + continue; + } + Element mapPoint = makePoint(point); if (mapPoint == null) { return; @@ -352,7 +385,7 @@ public final class KMLReport implements GeneralReportModule { * @throws TskCoreException * @throws IOException */ - void addLocationsToReport(SleuthkitCase skCase, String baseReportDir) throws GeoLocationDataException, IOException { + void addLocationsToReport(SleuthkitCase skCase, String baseReportDir) throws GeoLocationDataException, IOException, TskCoreException { if (waypointList == null) { addExifMetadataContent(WaypointBuilder.getEXIFWaypoints(skCase), baseReportDir); addWaypoints(WaypointBuilder.getBookmarkWaypoints(skCase), gpsBookmarksFolder, FeatureColor.BLUE, Bundle.Waypoint_Bookmark_Display_String()); @@ -376,8 +409,11 @@ public final class KMLReport implements GeneralReportModule { * @param folder The Element folder to add the points to * @param waypointColor The color the waypoint should appear in the report */ - void addWaypoints(List points, Element folder, FeatureColor waypointColor, String headerLabel) { + void addWaypoints(List points, Element folder, FeatureColor waypointColor, String headerLabel) throws TskCoreException { for (Waypoint point : points) { + if(shouldFilterFromReport(point.getArtifact())) { + continue; + } addContent(folder, point.getLabel(), waypointColor, getFormattedDetails(point, headerLabel), point.getTimestamp(), makePoint(point), point.getLatitude(), point.getLongitude()); } } @@ -408,7 +444,7 @@ public final class KMLReport implements GeneralReportModule { * * @throws TskCoreException */ - void makeRoutes(SleuthkitCase skCase) throws GeoLocationDataException { + void makeRoutes(SleuthkitCase skCase) throws GeoLocationDataException, TskCoreException { List routes = null; if (waypointList == null) { @@ -418,7 +454,10 @@ public final class KMLReport implements GeneralReportModule { } for (Route route : routes) { - addRouteToReport(route); + if(shouldFilterFromReport(route.getArtifact())) { + continue; + } + addRouteToReport(route); } } @@ -479,7 +518,7 @@ public final class KMLReport implements GeneralReportModule { * * @throws TskCoreException */ - void makeTracks(SleuthkitCase skCase) throws GeoLocationDataException { + void makeTracks(SleuthkitCase skCase) throws GeoLocationDataException, TskCoreException { List tracks = null; if (waypointList == null) { @@ -489,6 +528,9 @@ public final class KMLReport implements GeneralReportModule { } for (Track track : tracks) { + if(shouldFilterFromReport(track.getArtifact())) { + continue; + } addTrackToReport(track); } } @@ -877,4 +919,15 @@ public final class KMLReport implements GeneralReportModule { return String.format("%.2f, %.2f", latitude, longitude); } + + /** + * Indicates if the content should be filtered from the report. + */ + private boolean shouldFilterFromReport(Content content) throws TskCoreException { + if(this.settings.getSelectedDataSources() == null) { + return false; + } + long dataSourceId = content.getDataSource().getId(); + return !this.settings.getSelectedDataSources().contains(dataSourceId); + } } diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/report/modules/stix/STIXReportModule.java index 6421cc4a32..365f37a02d 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/stix/STIXReportModule.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013 - 2018 Basis Technology Corp. + * Copyright 2013 - 2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,6 +55,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.report.GeneralReportModule; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.NoReportModuleSettings; import org.sleuthkit.autopsy.report.ReportModuleSettings; import org.sleuthkit.autopsy.report.ReportProgressPanel; @@ -97,10 +98,11 @@ public class STIXReportModule implements GeneralReportModule { */ @Override @Messages({"STIXReportModule.srcModuleName.text=STIX Report"}) - public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { + public void generateReport(GeneralReportSettings settings, ReportProgressPanel progressPanel) { // Start the progress bar and setup the report progressPanel.setIndeterminate(false); progressPanel.start(); + String baseReportDir = settings.getReportDirectoryPath(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.readSTIX")); reportPath = baseReportDir + getRelativeFilePath(); File reportFile = new File(reportPath); diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/taggedhashes/SaveTaggedHashesToHashDb.java b/Core/src/org/sleuthkit/autopsy/report/modules/taggedhashes/SaveTaggedHashesToHashDb.java index 8fc57c0ae8..269350b288 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/taggedhashes/SaveTaggedHashesToHashDb.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/taggedhashes/SaveTaggedHashesToHashDb.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2011-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,7 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.services.TagsManager; import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb; import org.sleuthkit.autopsy.report.GeneralReportModule; +import org.sleuthkit.autopsy.report.GeneralReportSettings; import org.sleuthkit.autopsy.report.NoReportModuleSettings; import org.sleuthkit.autopsy.report.ReportModuleSettings; import org.sleuthkit.autopsy.report.ReportProgressPanel; @@ -115,7 +116,7 @@ public class SaveTaggedHashesToHashDb implements GeneralReportModule { "AddTaggedHashesToHashDb.error.noTagsSelected=No tags selected for export." }) @Override - public void generateReport(String reportPath, ReportProgressPanel progressPanel) { + public void generateReport(GeneralReportSettings settings, ReportProgressPanel progressPanel) { Case openCase; try { openCase = Case.getCurrentCaseThrows(); diff --git a/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java b/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java index 8ad09e4921..20e82d96e7 100644 --- a/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java +++ b/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java @@ -385,6 +385,12 @@ public class AutopsyTestCases { listOperator.clickOnItem(0, 1); jbo0.pushNoBlock(); new Timeout("pausing", 2000).sleep(); + + // Next button on the data source selection panel + JButtonOperator dataSourceSelectionPanelNext = new JButtonOperator(reportDialogOperator, "Next"); + dataSourceSelectionPanelNext.pushNoBlock(); + new Timeout("pausing", 2000).sleep(); + JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator, "Finish"); jbo1.pushNoBlock(); JDialog previewDialog = JDialogOperator.waitJDialog("Progress", false, false); diff --git a/docs/doxygen-user/auto_ingest.dox b/docs/doxygen-user/auto_ingest.dox index 3957e7c922..f1191bebc2 100644 --- a/docs/doxygen-user/auto_ingest.dox +++ b/docs/doxygen-user/auto_ingest.dox @@ -4,6 +4,8 @@ Auto ingest allows one or many computers to process \ref ds_page "data sources" automatically with minimal support from a user. The resulting \ref multiuser_page "multi-user cases" can be opened and reviewed by analysts, using any of the normal functions in Autopsy. +The \ref experimental_page must be enabled to run use automated ingest. + There are three types of computers in an Automated Processing Deployment:
  • Automated Ingest Node: diff --git a/docs/doxygen-user/object_detection.dox b/docs/doxygen-user/object_detection.dox index 2685b69c41..3ed98fa820 100644 --- a/docs/doxygen-user/object_detection.dox +++ b/docs/doxygen-user/object_detection.dox @@ -4,6 +4,8 @@ The Object Detection module uses OpenCV to try to detect objects in images. +The \ref experimental_page must be enabled to run this module. + \section object_setup Setup To start, you will need some classifiers, which are xml files. Autopsy can not create classifiers - do a web search for "train OpenCV classifiers" to find information on how to make classifiers, or visit the OpenCV page. diff --git a/docs/doxygen-user/volatility_dsp.dox b/docs/doxygen-user/volatility_dsp.dox index be99b7d527..51b137e5fe 100644 --- a/docs/doxygen-user/volatility_dsp.dox +++ b/docs/doxygen-user/volatility_dsp.dox @@ -4,6 +4,8 @@ The Volatility data source processor runs Volatility on a memory image and saves the individual Volatility module results. If the disk image associated with the memory image is also available, it will create Interesting Item artifacts linking the Volatility results to files in the disk image. +The \ref experimental_page must be enabled to run this module. + \section Usage If you have a disk image associated with your memory image, ingest the disk image into the case first. Then go to "Add Data Source" and select "Memory Image File".