19 package org.sleuthkit.autopsy.modules.stix;
21 import java.util.logging.Level;
22 import org.openide.util.NbBundle;
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 public void createArtifact(String a_title)
throws TskCoreException {
62 Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
65 if (a_title != null) {
66 setName =
"STIX Indicator - " + a_title;
68 setName =
"STIX Indicator - (no title)";
71 BlackboardArtifact bba = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT);
72 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME,
"Stix", setName));
73 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE,
"Stix", observableId));
74 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY,
"Stix", objType));
78 blackboard.indexArtifact(bba);
79 }
catch (Blackboard.BlackboardException ex) {
80 logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class,
"Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex);
81 MessageNotifyUtil.Notify.error(
82 NbBundle.getMessage(Blackboard.class,
"Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
87 System.out.println(
" " + observableId +
" " + file.getName());