diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java index 99fbb652c5..28065dacbc 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2015-2019 Basis Technology Corp. + * Copyright 2015-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +56,7 @@ public final class Blackboard implements Closeable { @Deprecated public synchronized void indexArtifact(BlackboardArtifact artifact) throws BlackboardException { try { - Case.getCurrentCase().getSleuthkitCase().getBlackboard().postArtifact(artifact, ""); + Case.getCurrentCase().getSleuthkitCase().getBlackboard().postArtifact(artifact, "", null); } catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) { throw new BlackboardException(ex.getMessage(), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java index e2dd585582..ede9a6ea83 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -33,7 +33,7 @@ import org.sleuthkit.datamodel.SleuthkitCase; */ public final class IngestServices { - private static Logger logger = Logger.getLogger(IngestServices.class.getName()); + private final static Logger logger = Logger.getLogger(IngestServices.class.getName()); private static IngestServices instance = null; /** @@ -115,7 +115,7 @@ public final class IngestServices { public void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) { try { Blackboard blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard(); - blackboard.postArtifacts(moduleDataEvent.getArtifacts(), moduleDataEvent.getModuleName()); + blackboard.postArtifacts(moduleDataEvent.getArtifacts(), moduleDataEvent.getModuleName(), null); } catch (NoCurrentCaseException | Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Failed to post artifacts", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/ILeappAnalyzerIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/ILeappAnalyzerIngestModule.java index cf89294aff..c3afd036d8 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/ILeappAnalyzerIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/ILeappAnalyzerIngestModule.java @@ -333,7 +333,7 @@ public class ILeappAnalyzerIngestModule implements DataSourceIngestModule { * added to reports */ private void addILeappReportToReports(Path iLeappOutputDir, Case currentCase) { - List allIndexFiles = new ArrayList<>(); + List allIndexFiles; try (Stream walk = Files.walk(iLeappOutputDir)) { @@ -402,7 +402,7 @@ public class ILeappAnalyzerIngestModule implements DataSourceIngestModule { String fileName = FilenameUtils.getName(ffp); String filePath = FilenameUtils.getPath(ffp); - List iLeappFiles = new ArrayList<>(); + List iLeappFiles; try { if (filePath.isEmpty()) { iLeappFiles = fileManager.findFiles(dataSource, fileName); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java b/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java index 4015f79dbf..daf554ac5b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java @@ -194,7 +194,7 @@ public final class LeappFileProcessor { .put("call history.tsv", "calllog") .build(); - Blackboard blkBoard; + private final Blackboard blkBoard; public LeappFileProcessor(String xmlFile, String moduleName, IngestJobContext context) throws IOException, IngestModuleException, NoCurrentCaseException { this.tsvFiles = new HashMap<>(); @@ -351,10 +351,10 @@ public final class LeappFileProcessor { AbstractFile geoAbstractFile = null; if (LeappFile == null || !LeappFile.exists() || fileName == null) { - logger.log(Level.WARNING, String.format("Leap file: %s is null or does not exist", LeappFile == null ? LeappFile.toString() : "")); + logger.log(Level.WARNING, String.format("Leap file: %s is null or does not exist", LeappFile != null ? LeappFile.toString() : "")); return; } else if (attrList == null || artifactType == null || dataSource == null) { - logger.log(Level.WARNING, String.format("attribute list, artifact type or dataSource not provided for %s", LeappFile == null ? LeappFile.toString() : "")); + logger.log(Level.WARNING, String.format("attribute list, artifact type or dataSource not provided for %s", LeappFile.toString())); return; } @@ -435,7 +435,7 @@ public final class LeappFileProcessor { Long dateTime = Long.valueOf(0); Collection otherAttributes = new ArrayList<>(); String sourceFile = null; - AbstractFile absFile = null; + AbstractFile absFile; String comment = ""; try { @@ -538,13 +538,10 @@ public final class LeappFileProcessor { if (absFile == null) { absFile = (AbstractFile) dataSource; } - if ((trackpointSegmentName == null) || (trackpointSegmentName == segmentName)) { - trackpointSegmentName = segmentName; + if ((trackpointSegmentName == null) || (trackpointSegmentName.equals(segmentName))) { pointList.addPoint(new TrackPoint(latitude, longitude, altitude, segmentName, zeroValue, zeroValue, zeroValue, dateTime)); } else { (new GeoArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, comment, absFile, context.getJobId())).addTrack(segmentName, pointList, new ArrayList<>()); - trackpointSegmentName = segmentName; - pointList = new GeoTrackPoints(); pointList.addPoint(new TrackPoint(latitude, longitude, altitude, segmentName, zeroValue, zeroValue, zeroValue, dateTime)); } @@ -575,7 +572,7 @@ public final class LeappFileProcessor { List otherAttributes = new ArrayList<>(); List fileAttachments = new ArrayList<>(); String sourceFile = null; - MessageAttachments messageAttachments = null; + MessageAttachments messageAttachments; try { for (BlackboardAttribute bba : bbattributes) { @@ -637,22 +634,23 @@ public final class LeappFileProcessor { if (absFile == null) { absFile = (AbstractFile) dataSource; } - CommunicationArtifactsHelper accountArtifact; + CommunicationArtifactsHelper accountHelper; Account.Type accountType = getAccountType(fileName); if (alternateId == null) { - accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), + accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, absFile, accountType, context.getJobId()); } else { - accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), + accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, absFile, accountType, accountType, alternateId, context.getJobId()); } - BlackboardArtifact messageArtifact = accountArtifact.addMessage(messageType, communicationDirection, senderId, + BlackboardArtifact messageArtifact = accountHelper.addMessage(messageType, communicationDirection, senderId, receipentId, dateTime, messageStatus, subject, messageText, threadId, otherAttributes); if (!fileAttachments.isEmpty()) { messageAttachments = new MessageAttachments(fileAttachments, new ArrayList<>()); - accountArtifact.addAttachments(messageArtifact, messageAttachments); + accountHelper.addAttachments(messageArtifact, messageAttachments); } + blkBoard.postArtifact(messageArtifact, moduleName, context.getJobId()); } catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) { throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_message_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS } @@ -714,15 +712,15 @@ public final class LeappFileProcessor { Account.Type accountType = getAccountType(fileName); if (accountType != null) { - CommunicationArtifactsHelper accountArtifact; + CommunicationArtifactsHelper accountHelper; if (alternateId == null) { - accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), + accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, absFile, accountType, context.getJobId()); } else { - accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), + accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, absFile, accountType, accountType, alternateId, context.getJobId()); } - BlackboardArtifact messageArtifact = accountArtifact.addContact(contactName, phoneNumber, homePhoneNumber, mobilePhoneNumber, emailAddr, otherAttributes); + BlackboardArtifact messageArtifact = accountHelper.addContact(contactName, phoneNumber, homePhoneNumber, mobilePhoneNumber, emailAddr, otherAttributes); } } catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) { throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_contact_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS @@ -784,7 +782,7 @@ public final class LeappFileProcessor { } } - if (calleeId.isEmpty() && communicationDirection == CommunicationDirection.OUTGOING) { + if (calleeId.isEmpty() && communicationDirection == CommunicationDirection.OUTGOING && callerId != null) { String[] calleeTempList = callerId.split(",", 0); calleeId = Arrays.asList(calleeTempList); callerId = null; @@ -794,15 +792,15 @@ public final class LeappFileProcessor { absFile = (AbstractFile) dataSource; } Account.Type accountType = getAccountType(fileName); - CommunicationArtifactsHelper accountArtifact; + CommunicationArtifactsHelper accountHelper; if (accountType != null) { - accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), + accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, absFile, accountType, context.getJobId()); } else { - accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), + accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, absFile, accountType, accountType, alternateId, context.getJobId()); } - BlackboardArtifact callLogArtifact = accountArtifact.addCalllog(communicationDirection, callerId, calleeId, startDateTime, endDateTime, mediaType, otherAttributes); + accountHelper.addCalllog(communicationDirection, callerId, calleeId, startDateTime, endDateTime, mediaType, otherAttributes); } catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) { throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_calllog_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS } @@ -929,7 +927,7 @@ public final class LeappFileProcessor { String formattedValue = formatValueBasedOnAttrType(colAttr, value); - BlackboardAttribute attr = (value == null) ? null : getAttribute(colAttr.getAttributeType(), formattedValue, fileName); + BlackboardAttribute attr = getAttribute(colAttr.getAttributeType(), formattedValue, fileName); if (attr == null) { logger.log(Level.WARNING, String.format("Blackboard attribute could not be parsed column %s at line %d in file %s. Omitting row.", colAttr.getColumnName(), lineNum, fileName)); return Collections.emptyList(); @@ -999,7 +997,7 @@ public final class LeappFileProcessor { (v) -> new BlackboardAttribute(attrType, moduleName, Double.valueOf(v).longValue())); case DOUBLE: return parseAttrValue(value.trim(), attrType, fileName, true, false, - (v) -> new BlackboardAttribute(attrType, moduleName, (double) Double.valueOf(v))); + (v) -> new BlackboardAttribute(attrType, moduleName, Double.valueOf(v))); case BYTE: return parseAttrValue(value.trim(), attrType, fileName, true, false, (v) -> new BlackboardAttribute(attrType, moduleName, new byte[]{Byte.valueOf(v)})); @@ -1050,20 +1048,20 @@ public final class LeappFileProcessor { private BlackboardAttribute parseAttrValue(String value, BlackboardAttribute.Type attrType, String fileName, boolean blankIsNull, boolean zeroIsNull, ParseExceptionFunction valueConverter) { // remove non-printable characters from tsv input // https://stackoverflow.com/a/6199346 - value = value.replaceAll("\\p{C}", ""); + String sanitizedValue = value.replaceAll("\\p{C}", ""); - if (blankIsNull && StringUtils.isBlank(value)) { + if (blankIsNull && StringUtils.isBlank(sanitizedValue)) { return null; } - if (zeroIsNull && value.matches("^\\s*[0\\.]*\\s*$")) { + if (zeroIsNull && sanitizedValue.matches("^\\s*[0\\.]*\\s*$")) { return null; } try { - return valueConverter.apply(value); + return valueConverter.apply(sanitizedValue); } catch (NumberFormatException | ParseException ex) { - logger.log(Level.WARNING, String.format("Unable to format '%s' as value type %s while converting to attributes from %s.", value, attrType.getValueType().getLabel(), fileName), ex); + logger.log(Level.WARNING, String.format("Unable to format '%s' as value type %s while converting to attributes from %s.", sanitizedValue, attrType.getValueType().getLabel(), fileName), ex); return null; } } @@ -1185,10 +1183,13 @@ public final class LeappFileProcessor { if (columnName == null) { logger.log(Level.SEVERE, String.format("No column name provided for [%s]", getXmlAttrIdentifier(parentName, attributeName))); + continue; } else if (columnName.trim().length() != columnName.length()) { logger.log(Level.SEVERE, String.format("Column name '%s' starts or ends with whitespace for [%s]", columnName, getXmlAttrIdentifier(parentName, attributeName))); + continue; } else if (columnName.matches("[^ \\S]")) { logger.log(Level.SEVERE, String.format("Column name '%s' contains invalid characters [%s]", columnName, getXmlAttrIdentifier(parentName, attributeName))); + continue; } TsvColumn thisCol = new TsvColumn( @@ -1230,7 +1231,7 @@ public final class LeappFileProcessor { case ANALYSIS_RESULT: return dataSource.newAnalysisResult(artType, Score.SCORE_UNKNOWN, null, null, null, bbattributes).getAnalysisResult(); default: - logger.log(Level.SEVERE, "Unknown category type: " + artType.getCategory().getDisplayName()); + logger.log(Level.SEVERE, String.format("Unknown category type: %s", artType.getCategory().getDisplayName())); return null; } } catch (TskException ex) { diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/objectdetection/ObjectDetectectionFileIngestModule.java b/Experimental/src/org/sleuthkit/autopsy/experimental/objectdetection/ObjectDetectectionFileIngestModule.java index 08a5be91d3..eee83e16ef 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/objectdetection/ObjectDetectectionFileIngestModule.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/objectdetection/ObjectDetectectionFileIngestModule.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2018 Basis Technology Corp. + * Copyright 2018-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -177,7 +177,7 @@ public class ObjectDetectectionFileIngestModule extends FileIngestModuleAdapter /* * Index the artifact for keyword search. */ - blackboard.postArtifact(artifact, MODULE_NAME); + blackboard.postArtifact(artifact, MODULE_NAME, jobId); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java index 5cd15156a1..0efa6cbfc4 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java @@ -1,7 +1,7 @@ /* * Autopsy * - * Copyright 2018 Basis Technology Corp. + * Copyright 2018-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -390,7 +390,7 @@ class VolatilityProcessor { try { // index the artifact for keyword search - blackboard.postArtifact(volArtifact, VOLATILITY); + blackboard.postArtifact(volArtifact, VOLATILITY, null); } catch (Blackboard.BlackboardException ex) { errorMsgs.add(Bundle.VolatilityProcessor_errorMessage_failedToIndexArtifact(pluginName)); /* diff --git a/InternalPythonModules/android/contact.py b/InternalPythonModules/android/contact.py index 2ebd744eb1..5d5e181fdd 100644 --- a/InternalPythonModules/android/contact.py +++ b/InternalPythonModules/android/contact.py @@ -158,7 +158,7 @@ class ContactAnalyzer(general.AndroidComponentAnalyzer): phoneNumber, # phoneNumber, None, # homePhoneNumber, None, # mobilePhoneNumber, - emailAddr) # emailAddr + emailAddr, context.getJobId()) # emailAddr except SQLException as ex: self._logger.log(Level.WARNING, "Error processing query result for Android messages.", ex) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchChildFactory.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchChildFactory.java index d01e8837c3..4dfc014598 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchChildFactory.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchChildFactory.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2012-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -426,7 +426,7 @@ class AdHocSearchChildFactory extends ChildFactory { final String queryDisp = queryStr.length() > QUERY_DISPLAY_LEN ? queryStr.substring(0, QUERY_DISPLAY_LEN - 1) + " ..." : queryStr; try { progress = ProgressHandle.createHandle(NbBundle.getMessage(this.getClass(), "KeywordSearchResultFactory.progress.saving", queryDisp), () -> BlackboardResultWriter.this.cancel(true)); - hits.process(progress, null, this, false, saveResults); + hits.process(progress, null, this, false, saveResults, null); } finally { finalizeWorker(); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IngestSearchRunner.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IngestSearchRunner.java index 937c9567fd..383abbd3af 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IngestSearchRunner.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IngestSearchRunner.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014 - 2017 Basis Technology Corp. + * Copyright 2014 - 2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -564,7 +564,7 @@ final class IngestSearchRunner { subProgresses[keywordsSearched].progress(keywordList.getName() + ": " + queryDisplayStr, unitProgress); // Create blackboard artifacts - newResults.process(null, subProgresses[keywordsSearched], this, keywordList.getIngestMessages(), true); + newResults.process(null, subProgresses[keywordsSearched], this, keywordList.getIngestMessages(), true, job.getJobId()); } //if has results diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index d350bfea6d..3140916f5e 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -648,7 +648,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { } if (!bbartifacts.isEmpty()) { try { - Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifacts(bbartifacts, moduleName); + Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifacts(bbartifacts, moduleName, jobId); } catch (NoCurrentCaseException | Blackboard.BlackboardException ex) { // Log error and return to continue processing logger.log(Level.WARNING, String.format("Unable to post blackboard artifacts for file $s.", aFile.getParentPath() + aFile.getName()), ex); //NON-NLS diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java index ce72c2cf69..40ed7db43d 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2012-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,7 +35,8 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestMessage; -import org.sleuthkit.autopsy.ingest.IngestServices;; +import org.sleuthkit.autopsy.ingest.IngestServices; +; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Blackboard; import org.sleuthkit.datamodel.BlackboardArtifact; @@ -64,7 +65,7 @@ class QueryResults { * and publishing an event to notify subscribers of the blackboard posts. * * The KeywordSearchQuery is used to do the blackboard posts. - * + * * @param query The query. */ QueryResults(KeywordSearchQuery query) { @@ -141,9 +142,10 @@ class QueryResults { * messages inbox if there is a keyword hit in the text * exrtacted from the text source object. * @param saveResults Flag whether to save search results as KWS artifacts. - * + * @param ingestJobId The numeric identifier of the ingest job within which + * the artifacts are being created, may be null. */ - void process(ProgressHandle progress, ProgressContributor subProgress, SwingWorker worker, boolean notifyInbox, boolean saveResults) { + void process(ProgressHandle progress, ProgressContributor subProgress, SwingWorker worker, boolean notifyInbox, boolean saveResults, Long ingestJobId) { /* * Initialize the progress indicator to the number of keywords that will * be processed. @@ -218,15 +220,15 @@ class QueryResults { } catch (TskCoreException | NoCurrentCaseException tskCoreException) { logger.log(Level.SEVERE, "Failed to get text source object for keyword hit", tskCoreException); //NON-NLS } - + if ((content != null) && saveResults) { /* - * Post an artifact for the hit to the blackboard. + * Post an artifact for the hit to the blackboard. */ BlackboardArtifact artifact = query.createKeywordHitArtifact(content, keyword, hit, snippet, query.getKeywordList().getName()); /* - * Send an ingest inbox message for the hit. + * Send an ingest inbox message for the hit. */ if (null != artifact) { hitArtifacts.add(artifact); @@ -253,7 +255,7 @@ class QueryResults { SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase(); Blackboard blackboard = tskCase.getBlackboard(); - blackboard.postArtifacts(hitArtifacts, MODULE_NAME); + blackboard.postArtifacts(hitArtifacts, MODULE_NAME, ingestJobId); } catch (NoCurrentCaseException | Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Failed to post KWH artifact to blackboard.", ex); //NON-NLS } diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chromium.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chromium.java index bbbf128c72..357f10b8a7 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chromium.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chromium.java @@ -54,8 +54,6 @@ import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Blackboard; import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; -import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE; import org.sleuthkit.datamodel.Content; @@ -939,7 +937,7 @@ class Chromium extends Extract { WebBrowserArtifactsHelper helper = new WebBrowserArtifactsHelper( Case.getCurrentCaseThrows().getSleuthkitCase(), NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), - webDataFile + webDataFile, context.getJobId() ); // Get Web form addresses diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java index ddeb88e7da..516b786c7d 100644 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2020 Basis Technology Corp. + * Copyright 2012-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -255,7 +255,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName()); + blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName(), context.getJobId()); } catch (Blackboard.BlackboardException ex) { MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_processPst_indexError_message(), artifact.getDisplayName()); logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS @@ -786,7 +786,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.postArtifact(bbart, EmailParserModuleFactory.getModuleName()); + blackboard.postArtifact(bbart, EmailParserModuleFactory.getModuleName(), context.getJobId()); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bbart.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_addArtifact_indexError_message(), bbart.getDisplayName()); diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java index 845e1f2a1c..f83025cbb8 100755 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java @@ -243,7 +243,7 @@ final class VcardParser { // Index the artifact for keyword search. try { - blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName()); + blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName(), context.getJobId()); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.VcardParser_addContactArtifact_indexError(), artifact.getDisplayName());