19 package org.sleuthkit.autopsy.modules.stix;
21 import java.util.logging.Level;
22 import org.openide.util.NbBundle.Messages;
36 class StixArtifactData {
38 private AbstractFile file;
39 private final String observableId;
40 private final String objType;
41 private static final Logger logger = Logger.getLogger(StixArtifactData.class.getName());
43 public StixArtifactData(AbstractFile a_file, String a_observableId, String a_objType) {
45 observableId = a_observableId;
49 public StixArtifactData(
long a_objId, String a_observableId, String a_objType) {
50 Case case1 = Case.getCurrentCase();
51 SleuthkitCase sleuthkitCase = case1.getSleuthkitCase();
53 file = sleuthkitCase.getAbstractFileById(a_objId);
54 }
catch (TskCoreException ex) {
57 observableId = a_observableId;
61 @Messages({
"StixArtifactData.indexError.message=Failed to index STIX interesting file hit artifact for keyword search."})
62 public void createArtifact(String a_title)
throws TskCoreException {
63 Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
66 if (a_title != null) {
67 setName =
"STIX Indicator - " + a_title;
69 setName =
"STIX Indicator - (no title)";
72 BlackboardArtifact bba = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT);
73 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME,
"Stix", setName));
74 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE,
"Stix", observableId));
75 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY,
"Stix", objType));
79 blackboard.indexArtifact(bba);
80 }
catch (Blackboard.BlackboardException ex) {
81 logger.log(Level.SEVERE,
"Unable to index blackboard artifact " + bba.getArtifactID(), ex);
82 MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_indexError_message(), bba.getDisplayName());
87 System.out.println(
" " + observableId +
" " + file.getName());