Merge branch 'develop' of https://github.com/markmckinnon/autopsy into develop

This commit is contained in:
Mark McKinnon 2025-01-22 11:44:01 -05:00
commit 1a6d61aab8
4 changed files with 31 additions and 14 deletions

View File

@ -58,6 +58,8 @@
<override org="org.xerial.snappy" module="snappy-java" rev="1.1.10.7"/> <override org="org.xerial.snappy" module="snappy-java" rev="1.1.10.7"/>
<override org="org.eclipse.jetty.http2" module="http2-common" rev="9.4.57.v20241219"/>
<override org="io.netty" module="netty-transport" rev="${netty.version}"/> <override org="io.netty" module="netty-transport" rev="${netty.version}"/>
<override org="io.netty" module="netty-common" rev="${netty.version}"/> <override org="io.netty" module="netty-common" rev="${netty.version}"/>
<override org="io.netty" module="netty-transport-native-epoll" rev="${netty.version}"/> <override org="io.netty" module="netty-transport-native-epoll" rev="${netty.version}"/>

View File

@ -8,7 +8,7 @@ file.reference.failureaccess-1.0.2.jar=release/modules/ext/failureaccess-1.0.2.j
file.reference.guava-33.4.0-jre.jar=release/modules/ext/guava-33.4.0-jre.jar file.reference.guava-33.4.0-jre.jar=release/modules/ext/guava-33.4.0-jre.jar
file.reference.hamcrest-core-1.3.jar=release/modules/ext/hamcrest-core-1.3.jar file.reference.hamcrest-core-1.3.jar=release/modules/ext/hamcrest-core-1.3.jar
file.reference.http2-client-11.0.24.jar=release/modules/ext/http2-client-11.0.24.jar file.reference.http2-client-11.0.24.jar=release/modules/ext/http2-client-11.0.24.jar
file.reference.http2-common-9.4.53.v20231009.jar=release/modules/ext/http2-common-9.4.53.v20231009.jar file.reference.http2-common-9.4.57.v20241219.jar=release/modules/ext/http2-common-9.4.57.v20241219.jar
file.reference.http2-hpack-9.4.53.v20231009.jar=release/modules/ext/http2-hpack-9.4.53.v20231009.jar file.reference.http2-hpack-9.4.53.v20231009.jar=release/modules/ext/http2-hpack-9.4.53.v20231009.jar
file.reference.http2-http-client-transport-9.4.53.v20231009.jar=release/modules/ext/http2-http-client-transport-9.4.53.v20231009.jar file.reference.http2-http-client-transport-9.4.53.v20231009.jar=release/modules/ext/http2-http-client-transport-9.4.53.v20231009.jar
file.reference.httpclient-4.5.13.jar=release/modules/ext/httpclient-4.5.13.jar file.reference.httpclient-4.5.13.jar=release/modules/ext/httpclient-4.5.13.jar

View File

@ -275,8 +275,8 @@
<binary-origin>release/modules/ext/http2-client-11.0.24.jar</binary-origin> <binary-origin>release/modules/ext/http2-client-11.0.24.jar</binary-origin>
</class-path-extension> </class-path-extension>
<class-path-extension> <class-path-extension>
<runtime-relative-path>ext/http2-common-9.4.53.v20231009.jar</runtime-relative-path> <runtime-relative-path>ext/http2-common-9.4.57.v20241219.jar</runtime-relative-path>
<binary-origin>release/modules/ext/http2-common-9.4.53.v20231009.jar</binary-origin> <binary-origin>release/modules/ext/http2-common-9.4.57.v20241219.jar</binary-origin>
</class-path-extension> </class-path-extension>
<class-path-extension> <class-path-extension>
<runtime-relative-path>ext/http2-hpack-9.4.53.v20231009.jar</runtime-relative-path> <runtime-relative-path>ext/http2-hpack-9.4.53.v20231009.jar</runtime-relative-path>

View File

@ -145,6 +145,11 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
"application/x-z", //NON-NLS "application/x-z", //NON-NLS
"application/x-compress"); //NON-NLS "application/x-compress"); //NON-NLS
/**
* A mapping of the Tika metadata key to the corresponding attribute type
* and the priority of that key versus other related keys (lower integer
* value is higher priority).
*/
private static final Map<String, Pair<BlackboardAttribute.ATTRIBUTE_TYPE, Integer>> METADATA_TYPES_MAP = Stream.of( private static final Map<String, Pair<BlackboardAttribute.ATTRIBUTE_TYPE, Integer>> METADATA_TYPES_MAP = Stream.of(
Pair.of(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_MODIFIED, List.of( Pair.of(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_MODIFIED, List.of(
"Last-Save-Date", "Last-Save-Date",
@ -686,12 +691,18 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
Collection<BlackboardArtifact> bbartifacts = new ArrayList<>(); Collection<BlackboardArtifact> bbartifacts = new ArrayList<>();
/** /**
* Get best matched metadata for each attribute type found in metadata map. * This map will map the attribute type to a pair of the priority (lower
* number value is higher priority), and the string value for the
* attribute.
*
* Get best matched metadata for each attribute type found in metadata
* map by bumping out lower priority.
*/ */
Map<BlackboardAttribute.ATTRIBUTE_TYPE, Pair<Integer, String>> intermediateMapping = new HashMap<>(); Map<BlackboardAttribute.ATTRIBUTE_TYPE, Pair<Integer, String>> intermediateMapping = new HashMap<>();
for (Map.Entry<String, String> entry : metadata.entrySet()) { for (Map.Entry<String, String> entry : metadata.entrySet()) {
if (entry.getValue() != null) {
Pair<BlackboardAttribute.ATTRIBUTE_TYPE, Integer> attrPair = METADATA_TYPES_MAP.get(entry.getKey()); Pair<BlackboardAttribute.ATTRIBUTE_TYPE, Integer> attrPair = METADATA_TYPES_MAP.get(entry.getKey());
if (attrPair != null) { if (attrPair != null && attrPair.getKey() != null && attrPair.getValue() != null) {
intermediateMapping.compute(attrPair.getKey(), (k, v) -> { intermediateMapping.compute(attrPair.getKey(), (k, v) -> {
if (v == null || v.getKey() > attrPair.getValue()) { if (v == null || v.getKey() > attrPair.getValue()) {
return Pair.of(attrPair.getValue(), entry.getValue()); return Pair.of(attrPair.getValue(), entry.getValue());
@ -701,9 +712,13 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
}); });
} }
} }
}
for (Entry<BlackboardAttribute.ATTRIBUTE_TYPE, Pair<Integer, String>> interEntry: intermediateMapping.entrySet()) { for (Entry<BlackboardAttribute.ATTRIBUTE_TYPE, Pair<Integer, String>> interEntry: intermediateMapping.entrySet()) {
attributes.add(checkAttribute(interEntry.getKey(), interEntry.getValue().getValue())); BlackboardAttribute attribute = checkAttribute(interEntry.getKey(), interEntry.getValue().getValue());
if (attribute != null) {
attributes.add(attribute);
}
} }
if (!attributes.isEmpty()) { if (!attributes.isEmpty()) {