19 package org.sleuthkit.autopsy.modules.stix;
21 import java.util.ArrayList;
22 import java.util.Collection;
33 class StixArtifactData {
35 private AbstractFile file;
36 private final String observableId;
37 private final String objType;
39 public StixArtifactData(AbstractFile a_file, String a_observableId, String a_objType) {
41 observableId = a_observableId;
45 public StixArtifactData(
long a_objId, String a_observableId, String a_objType) {
46 Case case1 = Case.getCurrentCase();
47 SleuthkitCase sleuthkitCase = case1.getSleuthkitCase();
49 file = sleuthkitCase.getAbstractFileById(a_objId);
50 }
catch (TskCoreException ex) {
53 observableId = a_observableId;
57 public void createArtifact(String a_title)
throws TskCoreException {
58 Collection<BlackboardAttribute> attrs =
new ArrayList<BlackboardAttribute>();
61 if (a_title != null) {
62 setName =
"STIX Indicator - " + a_title;
64 setName =
"STIX Indicator - (no title)";
67 BlackboardArtifact bba = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT);
68 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID(),
"Stix", setName));
69 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE.getTypeID(),
"Stix", observableId));
70 bba.addAttribute(
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY.getTypeID(),
"Stix", objType));
74 System.out.println(
" " + observableId +
" " + file.getName());