This commit is contained in:
U-BASIS\dgrove 2018-07-31 10:38:16 -04:00
parent 490d8df3e7
commit dd1bfc106d
2 changed files with 10 additions and 18 deletions

View File

@ -41,7 +41,6 @@ import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
@ -66,7 +65,7 @@ class QueryResults {
* and publishing an event to notify subscribers of the blackboard posts. * and publishing an event to notify subscribers of the blackboard posts.
* *
* The KeywordSearchQuery is used to do the blackboard posts. * The KeywordSearchQuery is used to do the blackboard posts.
* *
* @param query The query. * @param query The query.
*/ */
QueryResults(KeywordSearchQuery query) { QueryResults(KeywordSearchQuery query) {
@ -221,14 +220,8 @@ class QueryResults {
} }
/* /*
* Create an artifact if it is determined that one hasn't been * Post an artifact for the hit to the blackboard.
* created yet.
*/ */
if (content == null) {
logger.log(Level.WARNING, "Cannot add artifact for keyword hit to blackboard without a Content object."); //NON-NLS
continue; // Cycle to the next KeywordHit.
}
BlackboardArtifact artifact = query.postKeywordHitToBlackboard(content, keyword, hit, snippet, query.getKeywordList().getName()); BlackboardArtifact artifact = query.postKeywordHitToBlackboard(content, keyword, hit, snippet, query.getKeywordList().getName());
/* /*

View File

@ -36,7 +36,6 @@ import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList; import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.params.CursorMarkParams; import org.apache.solr.common.params.CursorMarkParams;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
@ -450,6 +449,14 @@ final class RegexQuery implements KeywordSearchQuery {
logger.log(Level.WARNING, "Error adding artifact for keyword hit to blackboard"); //NON-NLS logger.log(Level.WARNING, "Error adding artifact for keyword hit to blackboard"); //NON-NLS
return null; return null;
} }
/*
* Credit Card number hits are handled differently
*/
if (originalKeyword.getArtifactAttributeType() == ATTRIBUTE_TYPE.TSK_CARD_NUMBER) {
createCCNAccount(content, foundKeyword, hit, snippet, listName);
return null;
}
List<BlackboardAttribute> attributesList = new ArrayList<>(); List<BlackboardAttribute> attributesList = new ArrayList<>();
attributesList.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD, MODULE_NAME, foundKeyword.getSearchTerm())); attributesList.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD, MODULE_NAME, foundKeyword.getSearchTerm()));
@ -470,14 +477,6 @@ final class RegexQuery implements KeywordSearchQuery {
"A problem occurred while checking for existing artifacts for file '%s' (id=%d).", "A problem occurred while checking for existing artifacts for file '%s' (id=%d).",
content.getName(), content.getId()), ex); //NON-NLS content.getName(), content.getId()), ex); //NON-NLS
} }
/*
* Credit Card number hits are handled differently
*/
if (originalKeyword.getArtifactAttributeType() == ATTRIBUTE_TYPE.TSK_CARD_NUMBER) {
createCCNAccount(content, foundKeyword, hit, snippet, listName);
return null;
}
/* /*
* Create a "plain vanilla" keyword hit artifact with keyword and * Create a "plain vanilla" keyword hit artifact with keyword and