diff --git a/Core/build.xml b/Core/build.xml index a18745b086..1834bb976d 100644 --- a/Core/build.xml +++ b/Core/build.xml @@ -108,8 +108,6 @@ - - diff --git a/Core/ivy.xml b/Core/ivy.xml index 3d2352648d..1746c2f06d 100644 --- a/Core/ivy.xml +++ b/Core/ivy.xml @@ -1,6 +1,3 @@ - -]> @@ -10,43 +7,44 @@ - - - - + + + + + - + - + - - + + - + - + - + - + - - + + - + - + - + - - + + @@ -62,40 +60,52 @@ - - - - - - + + + + + + + + - + - + - - - + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - diff --git a/Core/ivysettings.xml b/Core/ivysettings.xml index 06c2d9308f..d1102eaa63 100644 --- a/Core/ivysettings.xml +++ b/Core/ivysettings.xml @@ -1,4 +1,10 @@ + + + + + + diff --git a/Core/nbproject/project.properties b/Core/nbproject/project.properties index 927bf11766..78007a1805 100644 --- a/Core/nbproject/project.properties +++ b/Core/nbproject/project.properties @@ -1,110 +1,116 @@ -file.reference.activemq-all-5.16.4.jar=release/modules/ext/activemq-all-5.16.4.jar -file.reference.audience-annotations-0.12.0.jar=release/modules/ext/audience-annotations-0.12.0.jar -file.reference.batik-awt-util-1.14.jar=release/modules/ext/batik-awt-util-1.14.jar -file.reference.batik-constants-1.14.jar=release/modules/ext/batik-constants-1.14.jar -file.reference.batik-css-1.14.jar=release/modules/ext/batik-css-1.14.jar -file.reference.batik-dom-1.14.jar=release/modules/ext/batik-dom-1.14.jar -file.reference.batik-ext-1.14.jar=release/modules/ext/batik-ext-1.14.jar -file.reference.batik-i18n-1.14.jar=release/modules/ext/batik-i18n-1.14.jar -file.reference.batik-parser-1.14.jar=release/modules/ext/batik-parser-1.14.jar -file.reference.batik-shared-resources-1.14.jar=release/modules/ext/batik-shared-resources-1.14.jar -file.reference.batik-svg-dom-1.14.jar=release/modules/ext/batik-svg-dom-1.14.jar -file.reference.batik-svggen-1.14.jar=release/modules/ext/batik-svggen-1.14.jar -file.reference.batik-util-1.14.jar=release/modules/ext/batik-util-1.14.jar -file.reference.batik-xml-1.14.jar=release/modules/ext/batik-xml-1.14.jar -file.reference.bcpkix-jdk15on-1.70.jar=release/modules/ext/bcpkix-jdk15on-1.70.jar -file.reference.bcprov-ext-jdk15on-1.70.jar=release/modules/ext/bcprov-ext-jdk15on-1.70.jar -file.reference.bcprov-jdk15on-1.70.jar=release/modules/ext/bcprov-jdk15on-1.70.jar -file.reference.bcutil-jdk15on-1.70.jar=release/modules/ext/bcutil-jdk15on-1.70.jar -file.reference.c3p0-0.9.5.5.jar=release/modules/ext/c3p0-0.9.5.5.jar -file.reference.checker-qual-3.33.0.jar=release/modules/ext/checker-qual-3.33.0.jar -file.reference.commons-codec-1.11.jar=release/modules/ext/commons-codec-1.11.jar -file.reference.commons-dbcp2-2.9.0.jar=release/modules/ext/commons-dbcp2-2.9.0.jar -file.reference.commons-io-2.11.0.jar=release/modules/ext/commons-io-2.11.0.jar -file.reference.commons-lang3-3.10.jar=release/modules/ext/commons-lang3-3.10.jar -file.reference.commons-logging-1.2.jar=release/modules/ext/commons-logging-1.2.jar -file.reference.commons-pool2-2.10.0.jar=release/modules/ext/commons-pool2-2.10.0.jar -file.reference.curator-client-5.2.1.jar=release/modules/ext/curator-client-5.2.1.jar -file.reference.curator-framework-5.2.1.jar=release/modules/ext/curator-framework-5.2.1.jar -file.reference.curator-recipes-5.2.1.jar=release/modules/ext/curator-recipes-5.2.1.jar file.reference.DatCon.jar=release/modules/ext/DatCon.jar +file.reference.Rejistry-1.1-SNAPSHOT.jar=release/modules/ext/Rejistry-1.1-SNAPSHOT.jar +file.reference.SparseBitSet-1.1.jar=release/modules/ext/SparseBitSet-1.1.jar +file.reference.YaraJNIWrapper.jar=release/modules/ext/YaraJNIWrapper.jar +file.reference.activemq-all-6.1.4.jar=release/modules/ext/activemq-all-6.1.4.jar +file.reference.angus-activation-2.0.2.jar=release/modules/ext/angus-activation-2.0.2.jar +file.reference.annotations-13.0.jar=release/modules/ext/annotations-13.0.jar +file.reference.audience-annotations-0.12.0.jar=release/modules/ext/audience-annotations-0.12.0.jar +file.reference.batik-awt-util-1.18.jar=release/modules/ext/batik-awt-util-1.18.jar +file.reference.batik-constants-1.18.jar=release/modules/ext/batik-constants-1.18.jar +file.reference.batik-css-1.18.jar=release/modules/ext/batik-css-1.18.jar +file.reference.batik-dom-1.18.jar=release/modules/ext/batik-dom-1.18.jar +file.reference.batik-ext-1.18.jar=release/modules/ext/batik-ext-1.18.jar +file.reference.batik-i18n-1.18.jar=release/modules/ext/batik-i18n-1.18.jar +file.reference.batik-parser-1.18.jar=release/modules/ext/batik-parser-1.18.jar +file.reference.batik-shared-resources-1.18.jar=release/modules/ext/batik-shared-resources-1.18.jar +file.reference.batik-svg-dom-1.18.jar=release/modules/ext/batik-svg-dom-1.18.jar +file.reference.batik-svggen-1.18.jar=release/modules/ext/batik-svggen-1.18.jar +file.reference.batik-util-1.18.jar=release/modules/ext/batik-util-1.18.jar +file.reference.batik-xml-1.18.jar=release/modules/ext/batik-xml-1.18.jar +file.reference.bcpkix-jdk18on-1.79.jar=release/modules/ext/bcpkix-jdk18on-1.79.jar +file.reference.bcprov-jdk18on-1.79.jar=release/modules/ext/bcprov-jdk18on-1.79.jar +file.reference.bcutil-jdk18on-1.79.jar=release/modules/ext/bcutil-jdk18on-1.79.jar +file.reference.c3p0-0.9.5.5.jar=release/modules/ext/c3p0-0.9.5.5.jar +file.reference.checker-qual-3.43.0.jar=release/modules/ext/checker-qual-3.43.0.jar +file.reference.commons-codec-1.11.jar=release/modules/ext/commons-codec-1.11.jar +file.reference.commons-dbcp2-2.13.0.jar=release/modules/ext/commons-dbcp2-2.13.0.jar +file.reference.commons-io-2.18.0.jar=release/modules/ext/commons-io-2.18.0.jar +file.reference.commons-lang3-3.10.jar=release/modules/ext/commons-lang3-3.10.jar +file.reference.commons-logging-1.3.4.jar=release/modules/ext/commons-logging-1.3.4.jar +file.reference.commons-pool2-2.12.0.jar=release/modules/ext/commons-pool2-2.12.0.jar +file.reference.curator-client-5.7.1.jar=release/modules/ext/curator-client-5.7.1.jar +file.reference.curator-framework-5.7.1.jar=release/modules/ext/curator-framework-5.7.1.jar +file.reference.curator-recipes-5.7.1.jar=release/modules/ext/curator-recipes-5.7.1.jar file.reference.decodetect-core-0.3.jar=release/modules/ext/decodetect-core-0.3.jar -file.reference.error_prone_annotations-2.18.0.jar=release/modules/ext/error_prone_annotations-2.18.0.jar +file.reference.error_prone_annotations-2.36.0.jar=release/modules/ext/error_prone_annotations-2.36.0.jar file.reference.failureaccess-1.0.1.jar=release/modules/ext/failureaccess-1.0.1.jar -file.reference.guava-32.0.1-jre.jar=release/modules/ext/guava-32.0.1-jre.jar +file.reference.guava-33.4.0-jre.jar=release/modules/ext/guava-33.4.0-jre.jar file.reference.httpclient-4.5.14.jar=release/modules/ext/httpclient-4.5.14.jar file.reference.httpclient-win-4.5.14.jar=release/modules/ext/httpclient-win-4.5.14.jar file.reference.httpcore-4.4.16.jar=release/modules/ext/httpcore-4.4.16.jar file.reference.httpmime-4.5.14.jar=release/modules/ext/httpmime-4.5.14.jar file.reference.icepdf-core-6.2.2.jar=release/modules/ext/icepdf-core-6.2.2.jar file.reference.icepdf-viewer-6.2.2.jar=release/modules/ext/icepdf-viewer-6.2.2.jar -file.reference.istack-commons-runtime-3.0.11.jar=release/modules/ext/istack-commons-runtime-3.0.11.jar -file.reference.j2objc-annotations-2.8.jar=release/modules/ext/j2objc-annotations-2.8.jar -file.reference.jackcess-4.0.1.jar=release/modules/ext/jackcess-4.0.1.jar -file.reference.jackcess-encrypt-4.0.1.jar=release/modules/ext/jackcess-encrypt-4.0.1.jar +file.reference.j2objc-annotations-3.0.0.jar=release/modules/ext/j2objc-annotations-3.0.0.jar +file.reference.jackcess-4.0.7.jar=release/modules/ext/jackcess-4.0.7.jar +file.reference.jackcess-encrypt-4.0.2.jar=release/modules/ext/jackcess-encrypt-4.0.2.jar file.reference.jai_core-1.1.3.jar=release/modules/ext/jai_core-1.1.3.jar file.reference.jai_imageio-1.1.jar=release/modules/ext/jai_imageio-1.1.jar -file.reference.jakarta.activation-1.2.2.jar=release/modules/ext/jakarta.activation-1.2.2.jar -file.reference.jakarta.xml.bind-api-2.3.3.jar=release/modules/ext/jakarta.xml.bind-api-2.3.3.jar -file.reference.java-diff-utils-4.11.jar=release/modules/ext/java-diff-utils-4.11.jar -file.reference.javax.activation-api-1.2.0.jar=release/modules/ext/javax.activation-api-1.2.0.jar +file.reference.jakarta.activation-api-2.1.3.jar=release/modules/ext/jakarta.activation-api-2.1.3.jar +file.reference.jakarta.annotation-api-2.1.1.jar=release/modules/ext/jakarta.annotation-api-2.1.1.jar +file.reference.jakarta.jms-api-3.1.0-sources.jar=release/modules/ext/jakarta.jms-api-3.1.0-sources.jar +file.reference.jakarta.jms-api-3.1.0.jar=release/modules/ext/jakarta.jms-api-3.1.0.jar +file.reference.jakarta.transaction-api-1.3.3.jar=release/modules/ext/jakarta.transaction-api-1.3.3.jar +file.reference.jakarta.xml.bind-api-4.0.2.jar=release/modules/ext/jakarta.xml.bind-api-4.0.2.jar +file.reference.java-diff-utils-4.15.jar=release/modules/ext/java-diff-utils-4.15.jar file.reference.javax.ws.rs-api-2.1.1.jar=release/modules/ext/javax.ws.rs-api-2.1.1.jar -file.reference.jaxb-api-2.3.1.jar=release/modules/ext/jaxb-api-2.3.1.jar -file.reference.jaxb-runtime-2.3.3.jar=release/modules/ext/jaxb-runtime-2.3.3.jar -file.reference.jdom-2.0.5-contrib.jar=release/modules/ext/jdom-2.0.5-contrib.jar -file.reference.jdom-2.0.5.jar=release/modules/ext/jdom-2.0.5.jar -file.reference.jfreechart-1.5.3.jar=release/modules/ext/jfreechart-1.5.3.jar +file.reference.jaxb-core-4.0.5.jar=release/modules/ext/jaxb-core-4.0.5.jar +file.reference.jaxb-impl-4.0.5.jar=release/modules/ext/jaxb-impl-4.0.5.jar +file.reference.jaxen-1.2.0.jar=release/modules/ext/jaxen-1.2.0.jar +file.reference.jdom2-2.0.6.1-sources.jar=release/modules/ext/jdom2-2.0.6.1-sources.jar +file.reference.jdom2-2.0.6.1.jar=release/modules/ext/jdom2-2.0.6.1.jar +file.reference.jfreechart-1.5.5.jar=release/modules/ext/jfreechart-1.5.5.jar file.reference.jgraphx-4.2.2.jar=release/modules/ext/jgraphx-4.2.2.jar -file.reference.jsoup-1.16.1.jar=release/modules/ext/jsoup-1.16.1.jar +file.reference.jsoup-1.18.3.jar=release/modules/ext/jsoup-1.18.3.jar file.reference.jsr305-3.0.2.jar=release/modules/ext/jsr305-3.0.2.jar file.reference.jutf7-1.0.0.jar=release/modules/ext/jutf7-1.0.0.jar -file.reference.jxmapviewer2-2.6.jar=release/modules/ext/jxmapviewer2-2.6.jar -file.reference.jython-standalone-2.7.2.jar=release/modules/ext/jython-standalone-2.7.2.jar -file.reference.libphonenumber-8.12.45.jar=release/modules/ext/libphonenumber-8.12.45.jar -file.reference.license4j-runtime-library-4.7.1.jar=release/modules/ext/license4j-runtime-library-4.7.1.jar +file.reference.jxmapviewer2-2.8.jar=release/modules/ext/jxmapviewer2-2.8.jar +file.reference.jython-standalone-2.7.4.jar=release/modules/ext/jython-standalone-2.7.4.jar +file.reference.kotlin-stdlib-1.8.21.jar=release/modules/ext/kotlin-stdlib-1.8.21.jar +file.reference.kotlin-stdlib-common-1.9.10.jar=release/modules/ext/kotlin-stdlib-common-1.9.10.jar +file.reference.kotlin-stdlib-jdk7-1.8.21.jar=release/modules/ext/kotlin-stdlib-jdk7-1.8.21.jar +file.reference.kotlin-stdlib-jdk8-1.8.21.jar=release/modules/ext/kotlin-stdlib-jdk8-1.8.21.jar +file.reference.libphonenumber-8.13.52.jar=release/modules/ext/libphonenumber-8.13.52.jar +file.reference.license4j-runtime-library-4.7.3.jar=release/modules/ext/license4j-runtime-library-4.7.3.jar file.reference.listenablefuture-1.0.jar=release/modules/ext/listenablefuture-1.0.jar -file.reference.logback-classic-1.2.10.jar=release/modules/ext/logback-classic-1.2.10.jar -file.reference.logback-core-1.2.10.jar=release/modules/ext/logback-core-1.2.10.jar file.reference.mchange-commons-java-0.3.0.jar=release/modules/ext/mchange-commons-java-0.3.0.jar -file.reference.metadata-extractor-2.18.0.jar=release/modules/ext/metadata-extractor-2.18.0.jar -file.reference.netty-buffer-4.1.73.Final.jar=release/modules/ext/netty-buffer-4.1.73.Final.jar -file.reference.netty-codec-4.1.73.Final.jar=release/modules/ext/netty-codec-4.1.73.Final.jar -file.reference.netty-common-4.1.73.Final.jar=release/modules/ext/netty-common-4.1.73.Final.jar -file.reference.netty-handler-4.1.73.Final.jar=release/modules/ext/netty-handler-4.1.73.Final.jar -file.reference.netty-resolver-4.1.73.Final.jar=release/modules/ext/netty-resolver-4.1.73.Final.jar -file.reference.netty-tcnative-2.0.48.Final.jar=release/modules/ext/netty-tcnative-2.0.48.Final.jar -file.reference.netty-tcnative-classes-2.0.48.Final.jar=release/modules/ext/netty-tcnative-classes-2.0.48.Final.jar -file.reference.netty-transport-4.1.73.Final.jar=release/modules/ext/netty-transport-4.1.73.Final.jar -file.reference.netty-transport-classes-epoll-4.1.73.Final.jar=release/modules/ext/netty-transport-classes-epoll-4.1.73.Final.jar -file.reference.netty-transport-native-epoll-4.1.73.Final.jar=release/modules/ext/netty-transport-native-epoll-4.1.73.Final.jar -file.reference.netty-transport-native-unix-common-4.1.73.Final.jar=release/modules/ext/netty-transport-native-unix-common-4.1.73.Final.jar -file.reference.okhttp-2.7.5.jar=release/modules/ext/okhttp-2.7.5.jar -file.reference.okio-1.6.0.jar=release/modules/ext/okio-1.6.0.jar +file.reference.metadata-extractor-2.19.0.jar=release/modules/ext/metadata-extractor-2.19.0.jar +file.reference.netty-buffer-4.1.113.Final.jar=release/modules/ext/netty-buffer-4.1.113.Final.jar +file.reference.netty-codec-4.1.113.Final.jar=release/modules/ext/netty-codec-4.1.113.Final.jar +file.reference.netty-common-4.1.116.Final.jar=release/modules/ext/netty-common-4.1.116.Final.jar +file.reference.netty-handler-4.1.113.Final.jar=release/modules/ext/netty-handler-4.1.113.Final.jar +file.reference.netty-resolver-4.1.113.Final.jar=release/modules/ext/netty-resolver-4.1.113.Final.jar +file.reference.netty-tcnative-boringssl-static-2.0.69.Final.jar=release/modules/ext/netty-tcnative-boringssl-static-2.0.69.Final.jar +file.reference.netty-tcnative-classes-2.0.66.Final.jar=release/modules/ext/netty-tcnative-classes-2.0.66.Final.jar +file.reference.netty-transport-4.1.116.Final.jar=release/modules/ext/netty-transport-4.1.116.Final.jar +file.reference.netty-transport-classes-epoll-4.1.116.Final.jar=release/modules/ext/netty-transport-classes-epoll-4.1.116.Final.jar +file.reference.netty-transport-native-epoll-4.1.116.Final-linux-x86_64.jar=release/modules/ext/netty-transport-native-epoll-4.1.116.Final-linux-x86_64.jar +file.reference.netty-transport-native-unix-common-4.1.113.Final.jar=release/modules/ext/netty-transport-native-unix-common-4.1.113.Final.jar +file.reference.okhttp-4.12.0.jar=release/modules/ext/okhttp-4.12.0.jar +file.reference.okio-3.6.0.jar=release/modules/ext/okio-3.6.0.jar +file.reference.okio-jvm-3.6.0.jar=release/modules/ext/okio-jvm-3.6.0.jar file.reference.postgresql-42.7.3.jar=release/modules/ext/postgresql-42.7.3.jar -file.reference.Rejistry-1.1-SNAPSHOT.jar=release/modules/ext/Rejistry-1.1-SNAPSHOT.jar -file.reference.serializer-2.7.2.jar=release/modules/ext/serializer-2.7.2.jar file.reference.sevenzipjbinding-AllPlatforms.jar=release/modules/ext/sevenzipjbinding-AllPlatforms.jar file.reference.sevenzipjbinding.jar=release/modules/ext/sevenzipjbinding.jar file.reference.sleuthkit-4.12.1.jar=release/modules/ext/sleuthkit-4.12.1.jar file.reference.sleuthkit-caseuco-4.12.1.jar=release/modules/ext/sleuthkit-caseuco-4.12.1.jar -file.reference.slf4j-api-1.7.36.jar=release/modules/ext/slf4j-api-1.7.36.jar -file.reference.snakeyaml-2.0.jar=release/modules/ext/snakeyaml-2.0.jar -file.reference.SparseBitSet-1.1.jar=release/modules/ext/SparseBitSet-1.1.jar -file.reference.spotbugs-annotations-4.6.0.jar=release/modules/ext/spotbugs-annotations-4.6.0.jar +file.reference.slf4j-api-1.7.30.jar=release/modules/ext/slf4j-api-1.7.30.jar +file.reference.snakeyaml-2.3.jar=release/modules/ext/snakeyaml-2.3.jar +file.reference.spotbugs-annotations-4.8.6.jar=release/modules/ext/spotbugs-annotations-4.8.6.jar file.reference.sqlite-jdbc-3.47.1.0.jar=release/modules/ext/sqlite-jdbc-3.47.1.0.jar -file.reference.txw2-2.3.3.jar=release/modules/ext/txw2-2.3.3.jar -file.reference.xalan-2.7.2.jar=release/modules/ext/xalan-2.7.2.jar +file.reference.xalan-2.7.3.jar=release/modules/ext/xalan-2.7.3.jar +file.reference.xercesImpl-2.12.2.jar=release/modules/ext/xercesImpl-2.12.2.jar file.reference.xml-apis-1.4.01.jar=release/modules/ext/xml-apis-1.4.01.jar file.reference.xml-apis-ext-1.3.04.jar=release/modules/ext/xml-apis-ext-1.3.04.jar -file.reference.xmlgraphics-commons-2.6.jar=release/modules/ext/xmlgraphics-commons-2.6.jar +file.reference.xmlgraphics-commons-2.10.jar=release/modules/ext/xmlgraphics-commons-2.10.jar file.reference.xmpcore-6.1.11.jar=release/modules/ext/xmpcore-6.1.11.jar -file.reference.YaraJNIWrapper.jar=release/modules/ext/YaraJNIWrapper.jar -file.reference.zookeeper-3.8.0.jar=release/modules/ext/zookeeper-3.8.0.jar -file.reference.zookeeper-jute-3.8.0.jar=release/modules/ext/zookeeper-jute-3.8.0.jar +file.reference.zookeeper-3.9.3.jar=release/modules/ext/zookeeper-3.9.3.jar +file.reference.zookeeper-jute-3.9.3.jar=release/modules/ext/zookeeper-jute-3.9.3.jar +javac.compilerargs=-Xlint -Xlint\:-serial javac.source=17 -javac.compilerargs=-Xlint -Xlint:-serial license.file=../LICENSE-2.0.txt -nbm.homepage=http://www.sleuthkit.org/ +nbm.homepage=http\://www.sleuthkit.org/ nbm.module.author=Brian Carrier nbm.needs.restart=true spec.version.base=10.25 diff --git a/Core/nbproject/project.xml b/Core/nbproject/project.xml index 7db7273bc1..5f67399107 100644 --- a/Core/nbproject/project.xml +++ b/Core/nbproject/project.xml @@ -370,120 +370,124 @@ org.sleuthkit.datamodel.blackboardutils.attributes - ext/activemq-all-5.16.4.jar - release/modules/ext/activemq-all-5.16.4.jar + ext/activemq-all-6.1.4.jar + release/modules/ext/activemq-all-6.1.4.jar + + + ext/angus-activation-2.0.2.jar + release/modules/ext/angus-activation-2.0.2.jar + + + ext/annotations-13.0.jar + release/modules/ext/annotations-13.0.jar ext/audience-annotations-0.12.0.jar release/modules/ext/audience-annotations-0.12.0.jar - ext/batik-awt-util-1.14.jar - release/modules/ext/batik-awt-util-1.14.jar + ext/batik-awt-util-1.18.jar + release/modules/ext/batik-awt-util-1.18.jar - ext/batik-constants-1.14.jar - release/modules/ext/batik-constants-1.14.jar + ext/batik-constants-1.18.jar + release/modules/ext/batik-constants-1.18.jar - ext/batik-css-1.14.jar - release/modules/ext/batik-css-1.14.jar + ext/batik-css-1.18.jar + release/modules/ext/batik-css-1.18.jar - ext/batik-dom-1.14.jar - release/modules/ext/batik-dom-1.14.jar + ext/batik-dom-1.18.jar + release/modules/ext/batik-dom-1.18.jar - ext/batik-ext-1.14.jar - release/modules/ext/batik-ext-1.14.jar + ext/batik-ext-1.18.jar + release/modules/ext/batik-ext-1.18.jar - ext/batik-i18n-1.14.jar - release/modules/ext/batik-i18n-1.14.jar + ext/batik-i18n-1.18.jar + release/modules/ext/batik-i18n-1.18.jar - ext/batik-parser-1.14.jar - release/modules/ext/batik-parser-1.14.jar + ext/batik-parser-1.18.jar + release/modules/ext/batik-parser-1.18.jar - ext/batik-shared-resources-1.14.jar - release/modules/ext/batik-shared-resources-1.14.jar + ext/batik-shared-resources-1.18.jar + release/modules/ext/batik-shared-resources-1.18.jar - ext/batik-svg-dom-1.14.jar - release/modules/ext/batik-svg-dom-1.14.jar + ext/batik-svg-dom-1.18.jar + release/modules/ext/batik-svg-dom-1.18.jar - ext/batik-svggen-1.14.jar - release/modules/ext/batik-svggen-1.14.jar + ext/batik-svggen-1.18.jar + release/modules/ext/batik-svggen-1.18.jar - ext/batik-util-1.14.jar - release/modules/ext/batik-util-1.14.jar + ext/batik-util-1.18.jar + release/modules/ext/batik-util-1.18.jar - ext/batik-xml-1.14.jar - release/modules/ext/batik-xml-1.14.jar + ext/batik-xml-1.18.jar + release/modules/ext/batik-xml-1.18.jar - ext/bcpkix-jdk15on-1.70.jar - release/modules/ext/bcpkix-jdk15on-1.70.jar + ext/bcpkix-jdk18on-1.79.jar + release/modules/ext/bcpkix-jdk18on-1.79.jar - ext/bcprov-ext-jdk15on-1.70.jar - release/modules/ext/bcprov-ext-jdk15on-1.70.jar + ext/bcprov-jdk18on-1.79.jar + release/modules/ext/bcprov-jdk18on-1.79.jar - ext/bcprov-jdk15on-1.70.jar - release/modules/ext/bcprov-jdk15on-1.70.jar - - - ext/bcutil-jdk15on-1.70.jar - release/modules/ext/bcutil-jdk15on-1.70.jar + ext/bcutil-jdk18on-1.79.jar + release/modules/ext/bcutil-jdk18on-1.79.jar ext/c3p0-0.9.5.5.jar release/modules/ext/c3p0-0.9.5.5.jar - ext/checker-qual-3.33.0.jar - release/modules/ext/checker-qual-3.33.0.jar + ext/checker-qual-3.43.0.jar + release/modules/ext/checker-qual-3.43.0.jar ext/commons-codec-1.11.jar release/modules/ext/commons-codec-1.11.jar - ext/commons-dbcp2-2.9.0.jar - release/modules/ext/commons-dbcp2-2.9.0.jar + ext/commons-dbcp2-2.13.0.jar + release/modules/ext/commons-dbcp2-2.13.0.jar - ext/commons-io-2.11.0.jar - release/modules/ext/commons-io-2.11.0.jar + ext/commons-io-2.18.0.jar + release/modules/ext/commons-io-2.18.0.jar ext/commons-lang3-3.10.jar release/modules/ext/commons-lang3-3.10.jar - ext/commons-logging-1.2.jar - release/modules/ext/commons-logging-1.2.jar + ext/commons-logging-1.3.4.jar + release/modules/ext/commons-logging-1.3.4.jar - ext/commons-pool2-2.10.0.jar - release/modules/ext/commons-pool2-2.10.0.jar + ext/commons-pool2-2.12.0.jar + release/modules/ext/commons-pool2-2.12.0.jar - ext/curator-client-5.2.1.jar - release/modules/ext/curator-client-5.2.1.jar + ext/curator-client-5.7.1.jar + release/modules/ext/curator-client-5.7.1.jar - ext/curator-framework-5.2.1.jar - release/modules/ext/curator-framework-5.2.1.jar + ext/curator-framework-5.7.1.jar + release/modules/ext/curator-framework-5.7.1.jar - ext/curator-recipes-5.2.1.jar - release/modules/ext/curator-recipes-5.2.1.jar + ext/curator-recipes-5.7.1.jar + release/modules/ext/curator-recipes-5.7.1.jar ext/DatCon.jar @@ -494,16 +498,16 @@ release/modules/ext/decodetect-core-0.3.jar - ext/error_prone_annotations-2.18.0.jar - release/modules/ext/error_prone_annotations-2.18.0.jar + ext/error_prone_annotations-2.36.0.jar + release/modules/ext/error_prone_annotations-2.36.0.jar ext/failureaccess-1.0.1.jar release/modules/ext/failureaccess-1.0.1.jar - ext/guava-32.0.1-jre.jar - release/modules/ext/guava-32.0.1-jre.jar + ext/guava-33.4.0-jre.jar + release/modules/ext/guava-33.4.0-jre.jar ext/httpclient-4.5.14.jar @@ -530,20 +534,16 @@ release/modules/ext/icepdf-viewer-6.2.2.jar - ext/istack-commons-runtime-3.0.11.jar - release/modules/ext/istack-commons-runtime-3.0.11.jar + ext/j2objc-annotations-3.0.0.jar + release/modules/ext/j2objc-annotations-3.0.0.jar - ext/j2objc-annotations-2.8.jar - release/modules/ext/j2objc-annotations-2.8.jar + ext/jackcess-4.0.7.jar + release/modules/ext/jackcess-4.0.7.jar - ext/jackcess-4.0.1.jar - release/modules/ext/jackcess-4.0.1.jar - - - ext/jackcess-encrypt-4.0.1.jar - release/modules/ext/jackcess-encrypt-4.0.1.jar + ext/jackcess-encrypt-4.0.2.jar + release/modules/ext/jackcess-encrypt-4.0.2.jar ext/jai_core-1.1.3.jar @@ -554,52 +554,68 @@ release/modules/ext/jai_imageio-1.1.jar - ext/jakarta.activation-1.2.2.jar - release/modules/ext/jakarta.activation-1.2.2.jar + ext/jakarta.activation-api-2.1.3.jar + release/modules/ext/jakarta.activation-api-2.1.3.jar - ext/jakarta.xml.bind-api-2.3.3.jar - release/modules/ext/jakarta.xml.bind-api-2.3.3.jar + ext/jakarta.annotation-api-2.1.1.jar + release/modules/ext/jakarta.annotation-api-2.1.1.jar - ext/java-diff-utils-4.11.jar - release/modules/ext/java-diff-utils-4.11.jar + ext/jakarta.jms-api-3.1.0-sources.jar + release/modules/ext/jakarta.jms-api-3.1.0-sources.jar - ext/javax.activation-api-1.2.0.jar - release/modules/ext/javax.activation-api-1.2.0.jar + ext/jakarta.jms-api-3.1.0.jar + release/modules/ext/jakarta.jms-api-3.1.0.jar + + + ext/jakarta.transaction-api-1.3.3.jar + release/modules/ext/jakarta.transaction-api-1.3.3.jar + + + ext/jakarta.xml.bind-api-4.0.2.jar + release/modules/ext/jakarta.xml.bind-api-4.0.2.jar + + + ext/java-diff-utils-4.15.jar + release/modules/ext/java-diff-utils-4.15.jar ext/javax.ws.rs-api-2.1.1.jar release/modules/ext/javax.ws.rs-api-2.1.1.jar - ext/jaxb-api-2.3.1.jar - release/modules/ext/jaxb-api-2.3.1.jar + ext/jaxb-core-4.0.5.jar + release/modules/ext/jaxb-core-4.0.5.jar - ext/jaxb-runtime-2.3.3.jar - release/modules/ext/jaxb-runtime-2.3.3.jar + ext/jaxb-impl-4.0.5.jar + release/modules/ext/jaxb-impl-4.0.5.jar - ext/jdom-2.0.5-contrib.jar - release/modules/ext/jdom-2.0.5-contrib.jar + ext/jaxen-1.2.0.jar + release/modules/ext/jaxen-1.2.0.jar - ext/jdom-2.0.5.jar - release/modules/ext/jdom-2.0.5.jar + ext/jdom2-2.0.6.1-sources.jar + release/modules/ext/jdom2-2.0.6.1-sources.jar - ext/jfreechart-1.5.3.jar - release/modules/ext/jfreechart-1.5.3.jar + ext/jdom2-2.0.6.1.jar + release/modules/ext/jdom2-2.0.6.1.jar + + + ext/jfreechart-1.5.5.jar + release/modules/ext/jfreechart-1.5.5.jar ext/jgraphx-4.2.2.jar release/modules/ext/jgraphx-4.2.2.jar - ext/jsoup-1.16.1.jar - release/modules/ext/jsoup-1.16.1.jar + ext/jsoup-1.18.3.jar + release/modules/ext/jsoup-1.18.3.jar ext/jsr305-3.0.2.jar @@ -610,92 +626,104 @@ release/modules/ext/jutf7-1.0.0.jar - ext/jxmapviewer2-2.6.jar - release/modules/ext/jxmapviewer2-2.6.jar + ext/jxmapviewer2-2.8.jar + release/modules/ext/jxmapviewer2-2.8.jar - ext/jython-standalone-2.7.2.jar - release/modules/ext/jython-standalone-2.7.2.jar + ext/jython-standalone-2.7.4.jar + release/modules/ext/jython-standalone-2.7.4.jar - ext/libphonenumber-8.12.45.jar - release/modules/ext/libphonenumber-8.12.45.jar + ext/kotlin-stdlib-1.8.21.jar + release/modules/ext/kotlin-stdlib-1.8.21.jar - ext/license4j-runtime-library-4.7.1.jar - release/modules/ext/license4j-runtime-library-4.7.1.jar + ext/kotlin-stdlib-common-1.9.10.jar + release/modules/ext/kotlin-stdlib-common-1.9.10.jar + + + ext/kotlin-stdlib-jdk7-1.8.21.jar + release/modules/ext/kotlin-stdlib-jdk7-1.8.21.jar + + + ext/kotlin-stdlib-jdk8-1.8.21.jar + release/modules/ext/kotlin-stdlib-jdk8-1.8.21.jar + + + ext/libphonenumber-8.13.52.jar + release/modules/ext/libphonenumber-8.13.52.jar + + + ext/license4j-runtime-library-4.7.3.jar + release/modules/ext/license4j-runtime-library-4.7.3.jar ext/listenablefuture-1.0.jar release/modules/ext/listenablefuture-1.0.jar - - ext/logback-classic-1.2.10.jar - release/modules/ext/logback-classic-1.2.10.jar - - - ext/logback-core-1.2.10.jar - release/modules/ext/logback-core-1.2.10.jar - ext/mchange-commons-java-0.3.0.jar - release/modules/ext/mchange-commons-java-00.3.0.jar + release/modules/ext/mchange-commons-java-0.3.0.jar - ext/metadata-extractor-2.18.0.jar - release/modules/ext/metadata-extractor-2.18.0.jar + ext/metadata-extractor-2.19.0.jar + release/modules/ext/metadata-extractor-2.19.0.jar - ext/netty-buffer-4.1.73.Final.jar - release/modules/ext/netty-buffer-4.1.73.Final.jar + ext/netty-buffer-4.1.113.Final.jar + release/modules/ext/netty-buffer-4.1.113.Final.jar - ext/netty-codec-4.1.73.Final.jar - release/modules/ext/netty-codec-4.1.73.Final.jar + ext/netty-codec-4.1.113.Final.jar + release/modules/ext/netty-codec-4.1.113.Final.jar - ext/netty-common-4.1.73.Final.jar - release/modules/ext/netty-common-4.1.73.Final.jar + ext/netty-common-4.1.116.Final.jar + release/modules/ext/netty-common-4.1.116.Final.jar - ext/netty-handler-4.1.73.Final.jar - release/modules/ext/netty-handler-4.1.73.Final.jar + ext/netty-handler-4.1.113.Final.jar + release/modules/ext/netty-handler-4.1.113.Final.jar - ext/netty-resolver-4.1.73.Final.jar - release/modules/ext/netty-resolver-4.1.73.Final.jar + ext/netty-resolver-4.1.113.Final.jar + release/modules/ext/netty-resolver-4.1.113.Final.jar - ext/netty-tcnative-2.0.48.Final.jar - release/modules/ext/netty-tcnative-2.0.48.Final.jar + ext/netty-tcnative-boringssl-static-2.0.69.Final.jar + release/modules/ext/netty-tcnative-boringssl-static-2.0.69.Final.jar - ext/netty-tcnative-classes-2.0.48.Final.jar - release/modules/ext/netty-tcnative-classes-2.0.48.Final.jar + ext/netty-tcnative-classes-2.0.66.Final.jar + release/modules/ext/netty-tcnative-classes-2.0.66.Final.jar - ext/netty-transport-4.1.73.Final.jar - release/modules/ext/netty-transport-4.1.73.Final.jar + ext/netty-transport-4.1.116.Final.jar + release/modules/ext/netty-transport-4.1.116.Final.jar - ext/netty-transport-classes-epoll-4.1.73.Final.jar - release/modules/ext/netty-transport-classes-epoll-4.1.73.Final.jar + ext/netty-transport-classes-epoll-4.1.116.Final.jar + release/modules/ext/netty-transport-classes-epoll-4.1.116.Final.jar - ext/netty-transport-native-epoll-4.1.73.Final.jar - release/modules/ext/netty-transport-native-epoll-4.1.73.Final.jar + ext/netty-transport-native-epoll-4.1.116.Final-linux-x86_64.jar + release/modules/ext/netty-transport-native-epoll-4.1.116.Final-linux-x86_64.jar - ext/netty-transport-native-unix-common-4.1.73.Final.jar - release/modules/ext/netty-transport-native-unix-common-4.1.73.Final.jar + ext/netty-transport-native-unix-common-4.1.113.Final.jar + release/modules/ext/netty-transport-native-unix-common-4.1.113.Final.jar - ext/okhttp-2.7.5.jar - release/modules/ext/okhttp-2.7.5.jar + ext/okhttp-4.12.0.jar + release/modules/ext/okhttp-4.12.0.jar - ext/okio-1.6.0.jar - release/modules/ext/okio-1.6.0.jar + ext/okio-3.6.0.jar + release/modules/ext/okio-3.6.0.jar + + + ext/okio-jvm-3.6.0.jar + release/modules/ext/okio-jvm-3.6.0.jar ext/postgresql-42.7.3.jar @@ -705,10 +733,6 @@ ext/Rejistry-1.1-SNAPSHOT.jar release/modules/ext/Rejistry-1.1-SNAPSHOT.jar - - ext/serializer-2.7.2.jar - release/modules/ext/serializer-2.7.2.jar - ext/sevenzipjbinding-AllPlatforms.jar release/modules/ext/sevenzipjbinding-AllPlatforms.jar @@ -726,32 +750,32 @@ release/modules/ext/sleuthkit-caseuco-4.12.1.jar - ext/slf4j-api-1.7.36.jar - release/modules/ext/slf4j-api-1.7.36.jar + ext/slf4j-api-1.7.30.jar + release/modules/ext/slf4j-api-1.7.30.jar - ext/snakeyaml-2.0.jar - release/modules/ext/snakeyaml-2.0.jar + ext/snakeyaml-2.3.jar + release/modules/ext/snakeyaml-2.3.jar ext/SparseBitSet-1.1.jar release/modules/ext/SparseBitSet-1.1.jar - ext/spotbugs-annotations-4.6.0.jar - release/modules/ext/spotbugs-annotations-4.6.0.jar + ext/spotbugs-annotations-4.8.6.jar + release/modules/ext/spotbugs-annotations-4.8.6.jar ext/sqlite-jdbc-3.47.1.0.jar release/modules/ext/sqlite-jdbc-3.47.1.0.jar - ext/txw2-2.3.3.jar - release/modules/ext/txw2-2.3.3.jar + ext/xalan-2.7.3.jar + release/modules/ext/xalan-2.7.3.jar - ext/xalan-2.7.2.jar - release/modules/ext/xalan-2.7.2.jar + ext/xercesImpl-2.12.2.jar + release/modules/ext/xercesImpl-2.12.2.jar ext/xml-apis-1.4.01.jar @@ -762,8 +786,8 @@ release/modules/ext/xml-apis-ext-1.3.04.jar - ext/xmlgraphics-commons-2.6.jar - release/modules/ext/xmlgraphics-commons-2.6.jar + ext/xmlgraphics-commons-2.10.jar + release/modules/ext/xmlgraphics-commons-2.10.jar ext/xmpcore-6.1.11.jar @@ -774,12 +798,12 @@ release/modules/ext/YaraJNIWrapper.jar - ext/zookeeper-3.8.0.jar - release/modules/ext/zookeeper-3.8.0.jar + ext/zookeeper-3.9.3.jar + release/modules/ext/zookeeper-3.9.3.jar - ext/zookeeper-jute-3.8.0.jar - release/modules/ext/zookeeper-jute-3.8.0.jar + ext/zookeeper-jute-3.9.3.jar + release/modules/ext/zookeeper-jute-3.9.3.jar diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudException.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudException.java index 95605c4bce..e1c9376078 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudException.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudException.java @@ -32,7 +32,7 @@ public class CTCloudException extends Exception{ public enum ErrorCode { BAD_REQUEST("CT-400", "Unknown or Bad request. Please contact Basis support at " + Constants.SUPPORT_AT_CYBERTRIAGE_DOT_COM + " for help diagnosing the problem."), - INVALID_KEY("CT-401", "An invalid license ID was used to access CyberTriage Cloud Service. Please contact Basis support " + Constants.SUPPORT_AT_CYBERTRIAGE_DOT_COM + " for help diagnosing the problem."), + INVALID_KEY("CT-401", "An invalid license ID was used to access CyberTriage Cloud Service. Please remove the license from the Cyber Triage options panel."), GATEWAY_TIMEOUT("CT-504", "Request to CyberTriage Cloud Service timed out. Please retry after some time. If issue persists, please contact Basis support at " + Constants.SUPPORT_AT_CYBERTRIAGE_DOT_COM + " for assistance."), UN_AUTHORIZED("CT-403", "An authorization error occurred. Please contact Basis support " + Constants.SUPPORT_AT_CYBERTRIAGE_DOT_COM + " for help diagnosing the problem."), PROXY_UNAUTHORIZED("CT-407", "Proxy authentication failed. Please validate the connection settings from the Options panel Proxy Settings."), diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java index 2b6cffe789..99e017311a 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java @@ -39,7 +39,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; */ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { - private static final int MAX_SUBPANEL_WIDTH = 650; + private static final int MAX_SUBPANEL_WIDTH = 700; private static final Logger logger = Logger.getLogger(CTOptionsPanel.class.getName()); @@ -70,14 +70,14 @@ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { } private void addSubOptionsPanels(List subPanels) { - GridBagConstraints disclaimerConstraints = new GridBagConstraints(); - disclaimerConstraints.gridx = 0; - disclaimerConstraints.gridy = 0; - disclaimerConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - disclaimerConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - disclaimerConstraints.insets = new java.awt.Insets(5, 5, 5, 5); - disclaimerConstraints.weighty = 0; - disclaimerConstraints.weightx = 0; + GridBagConstraints disclaimerConstraints = new GridBagConstraints(); + disclaimerConstraints.gridx = 0; + disclaimerConstraints.gridy = 0; + disclaimerConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + disclaimerConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + disclaimerConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + disclaimerConstraints.weighty = 0; + disclaimerConstraints.weightx = 0; for (int i = 0; i < subPanels.size(); i++) { CTOptionsSubPanel subPanel = subPanels.get(i); diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties index 8ad7ccebe9..2d47f1ed1f 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties @@ -23,6 +23,8 @@ EULADialog.cancelButton.text=Cancel EULADialog.acceptButton.text=Accept EULADialog.title=Cyber Triage End User License Agreement CTMalwareScannerOptionsPanel.licenseInfoMessageLabel.text= -CTMalwareScannerOptionsPanel.disclaimer.text=The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a paid subscription to use. CTMalwareScannerOptionsPanel.purchaseFromLabel.text=For licensing information, visit CTLicenseDialog.licenseNumberTextField.toolTipText=AUT-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX +CTMalwareScannerOptionsPanel.licenseErrorLabel.text= +CTMalwareScannerOptionsPanel.licenseInfoRemoveButton.text=Remove License +CTMalwareScannerOptionsPanel.text=The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a paid subscription to use. diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED index 8b72302f47..6f5cf48e41 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED @@ -28,7 +28,7 @@ CTMalwareScannerOptionsPanel_licenseAddDialog_desc=License Number: CTMalwareScannerOptionsPanel_licenseAddDialog_title=Add a License... CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_desc=The license number has already been entered CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_title=License Number Already Entered -CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_desc=Please verify that license number is of format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' +CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_desc=Please verify that license number is of format 'AUT-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_title=Invalid License Number CTMalwareScannerOptionsPanel_LicenseFetcher_apiErr_title=Server Error # {0} - licenseCode @@ -63,6 +63,9 @@ EULADialog.cancelButton.text=Cancel EULADialog.acceptButton.text=Accept EULADialog.title=Cyber Triage End User License Agreement CTMalwareScannerOptionsPanel.licenseInfoMessageLabel.text= -CTMalwareScannerOptionsPanel.disclaimer.text=The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a paid subscription to use. CTMalwareScannerOptionsPanel.purchaseFromLabel.text=For licensing information, visit CTLicenseDialog.licenseNumberTextField.toolTipText=AUT-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX +CTMalwareScannerOptionsPanel.licenseErrorLabel.text= +CTMalwareScannerOptionsPanel.licenseInfoRemoveButton.text=Remove License +CTMalwareScannerOptionsPanel.text=The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a paid subscription to use. +Installer_LicenseCheck_cloudExceptionTitle=Cyber Triage Error diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicensePersistence.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicensePersistence.java index 43e34a8d2a..48e327f400 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicensePersistence.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicensePersistence.java @@ -50,6 +50,15 @@ public class CTLicensePersistence { public static CTLicensePersistence getInstance() { return instance; } + + public synchronized boolean deleteLicenseResponse() { + File licenseFile = getCTLicenseFile(); + if (licenseFile.exists()) { + return licenseFile.delete(); + } else { + return false; + } + } public synchronized boolean saveLicenseResponse(LicenseResponse licenseResponse) { if (licenseResponse != null) { diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.form b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.form index dcdfb0a767..0d292c57ef 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.form +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.form @@ -1,6 +1,11 @@
+ + + + + @@ -11,7 +16,7 @@ - + @@ -25,10 +30,13 @@ + + + - + @@ -37,9 +45,16 @@ - + + + + + + + + @@ -72,10 +87,79 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84,7 +168,7 @@ - + @@ -96,7 +180,7 @@ - + @@ -108,58 +192,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -171,19 +204,43 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -195,7 +252,34 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -208,7 +292,7 @@ - + diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.java index f1a9037d33..20b333dba4 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.java @@ -40,7 +40,6 @@ import java.util.Optional; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.logging.Level; -import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import org.apache.commons.lang3.StringUtils; @@ -81,6 +80,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { private volatile AuthTokenResponse authTokenResponse = null; private volatile String authTokenMessage = null; private volatile AuthTokenFetcher authTokenFetcher = null; + private volatile String authTokenError = null; /** * Main constructor. @@ -118,7 +118,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { @Override public synchronized void saveSettings() { - ctPersistence.saveLicenseResponse(getLicenseInfo()); + LicenseResponse licenseResponse = getLicenseInfo(); + if (licenseResponse == null) { + this.ctPersistence.deleteLicenseResponse(); + } else { + ctPersistence.saveLicenseResponse(licenseResponse); + } } @Override @@ -131,14 +136,14 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { Optional licenseInfoOpt = ctPersistence.loadLicenseInfo(); LicenseInfo licenseInfo = licenseInfoOpt.orElse(null); setLicenseDisplay(licenseInfo, null); - setMalwareScansDisplay(null, null); + setMalwareScansDisplay(null, null, null); if (licenseInfo != null) { loadMalwareScansInfo(licenseInfo); this.purchaseFromLabel.setVisible(false); this.purchaseLink.setVisible(false); } else { this.purchaseFromLabel.setVisible(true); - this.purchaseLink.setVisible(true); + this.purchaseLink.setVisible(true); } } @@ -160,7 +165,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { private synchronized LicenseResponse getLicenseInfo() { return this.licenseInfo == null ? null : this.licenseInfo.getLicenseResponse(); - } + } private synchronized void setLicenseDisplay(LicenseInfo licenseInfo, String licenseMessage) { this.licenseInfo = licenseInfo; @@ -168,9 +173,10 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { renderLicenseState(); } - private synchronized void setMalwareScansDisplay(AuthTokenResponse authTokenResponse, String authTokenMessage) { + private synchronized void setMalwareScansDisplay(AuthTokenResponse authTokenResponse, String authTokenMessage, String authTokenError) { this.authTokenResponse = authTokenResponse; this.authTokenMessage = authTokenMessage; + this.authTokenError = authTokenError; renderLicenseState(); } @@ -196,7 +202,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { this.licenseFetcher.cancel(true); } setLicenseDisplay(null, Bundle.CTOPtionsPanel_loadLicenseInfo_loading()); - setMalwareScansDisplay(null, null); + setMalwareScansDisplay(null, null, null); this.licenseFetcher = new LicenseFetcher(licenseNumber); this.licenseFetcher.execute(); } @@ -210,16 +216,22 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { } if (licenseInfo == null || licenseInfo.getDecryptedLicense() == null) { - setMalwareScansDisplay(null, null); + setMalwareScansDisplay(null, null, null); return; } - setMalwareScansDisplay(null, Bundle.CTOPtionsPanel_loadMalwareScansInfo_loading()); + setMalwareScansDisplay(null, Bundle.CTOPtionsPanel_loadMalwareScansInfo_loading(), null); this.authTokenFetcher = new AuthTokenFetcher(licenseInfo.getDecryptedLicense()); this.authTokenFetcher.execute(); } + private static String htmlWrap(String msg) { + return msg == null + ? null + : "" + msg + ""; + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -234,27 +246,36 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { javax.swing.JLabel disclaimer = new javax.swing.JLabel(); javax.swing.JPanel licenseInfoPanel = new javax.swing.JPanel(); licenseInfoMessageLabel = new javax.swing.JLabel(); + javax.swing.JPanel buttonSpacer = new javax.swing.JPanel(); + javax.swing.JPanel buttonPanel = new javax.swing.JPanel(); + licenseInfoAddButton = new javax.swing.JButton(); + licenseInfoRemoveButton = new javax.swing.JButton(); licenseInfoExpiresLabel = new javax.swing.JLabel(); licenseInfoIdLabel = new javax.swing.JLabel(); licenseInfoUserLabel = new javax.swing.JLabel(); - licenseInfoAddButton = new javax.swing.JButton(); - maxFileUploadsLabel = new javax.swing.JLabel(); + malwareScansMessageLabel = new javax.swing.JLabel(); maxHashLookupsLabel = new javax.swing.JLabel(); hashLookupsRemainingLabel = new javax.swing.JLabel(); - malwareScansMessageLabel = new javax.swing.JLabel(); - countersResetLabel = new javax.swing.JLabel(); + maxFileUploadsLabel = new javax.swing.JLabel(); fileUploadsRemainingLabel = new javax.swing.JLabel(); + countersResetLabel = new javax.swing.JLabel(); + licenseErrorLabel = new javax.swing.JLabel(); javax.swing.JPanel purchasePanel = new javax.swing.JPanel(); purchaseFromLabel = new javax.swing.JLabel(); purchaseLink = new javax.swing.JLabel(); + setMaximumSize(new java.awt.Dimension(650, 32767)); setLayout(new java.awt.GridBagLayout()); malwareScansPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.malwareScansPanel.border.title"))); // NOI18N + malwareScansPanel.setMaximumSize(new java.awt.Dimension(650, 2147483647)); malwareScansPanel.setLayout(new java.awt.GridBagLayout()); - org.openide.awt.Mnemonics.setLocalizedText(disclaimer, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.disclaimer.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(disclaimer, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.text")); // NOI18N disclaimer.setVerticalAlignment(javax.swing.SwingConstants.TOP); + disclaimer.setMaximumSize(new java.awt.Dimension(650, 32)); + disclaimer.setName(""); // NOI18N + disclaimer.setPreferredSize(new java.awt.Dimension(650, 32)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; @@ -270,38 +291,25 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); licenseInfoPanel.add(licenseInfoMessageLabel, gridBagConstraints); - org.openide.awt.Mnemonics.setLocalizedText(licenseInfoExpiresLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoExpiresLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); - licenseInfoPanel.add(licenseInfoExpiresLabel, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(licenseInfoIdLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoIdLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); - licenseInfoPanel.add(licenseInfoIdLabel, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(licenseInfoUserLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoUserLabel.text")); // NOI18N + buttonSpacer.setMaximumSize(new java.awt.Dimension(32767, 0)); + buttonSpacer.setMinimumSize(new java.awt.Dimension(5, 0)); + buttonSpacer.setPreferredSize(new java.awt.Dimension(5, 0)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); - licenseInfoPanel.add(licenseInfoUserLabel, gridBagConstraints); + licenseInfoPanel.add(buttonSpacer, gridBagConstraints); + + buttonPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(licenseInfoAddButton, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoAddButton.text")); // NOI18N licenseInfoAddButton.addActionListener(new java.awt.event.ActionListener() { @@ -309,27 +317,77 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { licenseInfoAddButtonActionPerformed(evt); } }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + buttonPanel.add(licenseInfoAddButton, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(licenseInfoRemoveButton, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoRemoveButton.text")); // NOI18N + licenseInfoRemoveButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + licenseInfoRemoveButtonActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + buttonPanel.add(licenseInfoRemoveButton, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - licenseInfoPanel.add(licenseInfoAddButton, gridBagConstraints); + gridBagConstraints.gridheight = 7; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; + licenseInfoPanel.add(buttonPanel, gridBagConstraints); - org.openide.awt.Mnemonics.setLocalizedText(maxFileUploadsLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.maxFileUploadsLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(licenseInfoExpiresLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoExpiresLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + licenseInfoPanel.add(licenseInfoExpiresLabel, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(licenseInfoIdLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoIdLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + licenseInfoPanel.add(licenseInfoIdLabel, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(licenseInfoUserLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoUserLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; + gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - licenseInfoPanel.add(maxFileUploadsLabel, gridBagConstraints); + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + licenseInfoPanel.add(licenseInfoUserLabel, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(malwareScansMessageLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.malwareScansMessageLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 5; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + licenseInfoPanel.add(malwareScansMessageLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(maxHashLookupsLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.maxHashLookupsLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -338,39 +396,51 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { org.openide.awt.Mnemonics.setLocalizedText(hashLookupsRemainingLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.hashLookupsRemainingLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); licenseInfoPanel.add(hashLookupsRemainingLabel, gridBagConstraints); - org.openide.awt.Mnemonics.setLocalizedText(malwareScansMessageLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.malwareScansMessageLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(maxFileUploadsLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.maxFileUploadsLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.gridy = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); - licenseInfoPanel.add(malwareScansMessageLabel, gridBagConstraints); + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + licenseInfoPanel.add(maxFileUploadsLabel, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(fileUploadsRemainingLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.fileUploadsRemainingLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 7; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + licenseInfoPanel.add(fileUploadsRemainingLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(countersResetLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.countersResetLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 5; + gridBagConstraints.gridy = 8; + gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); licenseInfoPanel.add(countersResetLabel, gridBagConstraints); - org.openide.awt.Mnemonics.setLocalizedText(fileUploadsRemainingLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.fileUploadsRemainingLabel.text")); // NOI18N + licenseErrorLabel.setForeground(java.awt.Color.RED); + org.openide.awt.Mnemonics.setLocalizedText(licenseErrorLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseErrorLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 4; + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - licenseInfoPanel.add(fileUploadsRemainingLabel, gridBagConstraints); + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + licenseInfoPanel.add(licenseErrorLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -406,7 +476,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; @@ -414,10 +484,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { malwareScansPanel.add(purchasePanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; add(malwareScansPanel, gridBagConstraints); }// //GEN-END:initComponents @@ -428,7 +495,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { "CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_title=License Number Already Entered", "CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_desc=The license number has already been entered", "CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_title=Invalid License Number", - "CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_desc=Please verify that license number is of format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'"}) + "CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_desc=Please verify that license number is of format 'AUT-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'"}) private void licenseInfoAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_licenseInfoAddButtonActionPerformed CTLicenseDialog licenseDialog = new CTLicenseDialog(WindowManager.getDefault().getMainWindow(), true); licenseDialog.setLocationRelativeTo(this); @@ -442,11 +509,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { } } - JOptionPane.showMessageDialog( - this, - Bundle.CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_desc(), - Bundle.CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_title(), - JOptionPane.INFORMATION_MESSAGE); + setMalwareScansDisplay(null, null, htmlWrap(Bundle.CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_desc())); } }//GEN-LAST:event_licenseInfoAddButtonActionPerformed @@ -455,6 +518,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gotoLink(PURCHASE_URL); }//GEN-LAST:event_purchaseLinkMouseClicked + private void licenseInfoRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_licenseInfoRemoveButtonActionPerformed + setLicenseDisplay(null, null); + setMalwareScansDisplay(null, null, null); + this.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); + }//GEN-LAST:event_licenseInfoRemoveButtonActionPerformed + @NbBundle.Messages({ "# {0} - userName", "# {1} - email", @@ -477,19 +546,23 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { "CTMalwareScannerOptionsPanel_malwareScans_fileUploadsRemaining=File uploads remaining: {0}"}) private synchronized void renderLicenseState() { this.licenseInfoAddButton.setEnabled(!isLicenseAddRunning()); + this.licenseInfoRemoveButton.setEnabled(this.licenseInfo != null && !isLicenseAddRunning()); this.licenseInfoMessageLabel.setVisible(StringUtils.isNotBlank(this.licenseInfoMessage)); this.licenseInfoMessageLabel.setText(this.licenseInfoMessage); + this.licenseErrorLabel.setVisible(StringUtils.isNotBlank(this.authTokenError)); + this.licenseErrorLabel.setText(this.authTokenError); + if (licenseInfo == null) { this.licenseInfoExpiresLabel.setVisible(false); this.licenseInfoIdLabel.setVisible(false); this.licenseInfoUserLabel.setVisible(false); this.purchaseFromLabel.setVisible(true); - this.purchaseLink.setVisible(true); + this.purchaseLink.setVisible(true); } else { this.purchaseFromLabel.setVisible(false); - this.purchaseLink.setVisible(false); + this.purchaseLink.setVisible(false); this.licenseInfoExpiresLabel.setVisible(true); this.licenseInfoExpiresLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_expires( @@ -592,16 +665,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { this.licenseInfo = LicenseDecryptorUtil.getInstance().createLicenseInfo(licenseResponse); this.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); } - } catch (IOException | InvalidLicenseException ex) { - logger.log(Level.WARNING, "An error occurred while fetching data", ex); - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc(), - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_title(), - JOptionPane.ERROR_MESSAGE); - } finally { setLicenseDisplay(this.licenseInfo, null); loadMalwareScansInfo(this.licenseInfo); + } catch (IOException | InvalidLicenseException ex) { + logger.log(Level.WARNING, "An error occurred while fetching data", ex); + setLicenseDisplay(this.licenseInfo, null); + setMalwareScansDisplay(null, null, htmlWrap(Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc())); } } @@ -634,16 +703,11 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { // if no result, show unauthorized if (licenseResponse == null) { logger.log(Level.WARNING, "An API error occurred while fetching license information. License fetch returned no result."); - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - CTCloudException.ErrorCode.UN_AUTHORIZED.getDescription(), - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_apiErr_title(), - JOptionPane.ERROR_MESSAGE); - setLicenseDisplay(licenseInfo, null); - loadMalwareScansInfo(licenseInfo); + setLicenseDisplay(null, null); + setMalwareScansDisplay(null, null, htmlWrap(CTCloudException.ErrorCode.UN_AUTHORIZED.getDescription())); return; } - + // if not successful response if (!Boolean.TRUE.equals(licenseResponse.isSuccess())) { logger.log(Level.WARNING, "An API error occurred while fetching license information. License fetch was not successful"); @@ -652,41 +716,29 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { if (!StringUtils.isBlank(licenseResponse.getErrorMsg())) { message = licenseResponse.getErrorMsg(); } - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - message, - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_apiErr_title(), - JOptionPane.ERROR_MESSAGE); - setLicenseDisplay(licenseInfo, null); - loadMalwareScansInfo(licenseInfo); + setLicenseDisplay(null, null); + setMalwareScansDisplay(null, null, htmlWrap(message)); return; } - + // otherwise, load SwingUtilities.invokeLater(() -> acceptEula(licenseResponse)); - + } catch (InterruptedException | CancellationException ex) { // ignore cancellation; just load current license setLicenseDisplay(licenseInfo, null); loadMalwareScansInfo(licenseInfo); } catch (ExecutionException ex) { + String errMessage; if (ex.getCause() != null && ex.getCause() instanceof CTCloudException cloudEx) { logger.log(Level.WARNING, "An API error occurred while fetching license information", cloudEx); - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - cloudEx.getErrorCode().getDescription(), - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_apiErr_title(), - JOptionPane.ERROR_MESSAGE); + errMessage = cloudEx.getErrorDetails(); } else { logger.log(Level.WARNING, "An error occurred while fetching data", ex); - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc(), - Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_title(), - JOptionPane.ERROR_MESSAGE); + errMessage = Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc(); } - setLicenseDisplay(licenseInfo, null); - loadMalwareScansInfo(licenseInfo); + setLicenseDisplay(null, null); + setMalwareScansDisplay(null, null, htmlWrap(errMessage)); } finally { synchronized (CTMalwareScannerOptionsPanel.this) { CTMalwareScannerOptionsPanel.this.licenseFetcher = null; @@ -712,13 +764,14 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { if (this.isCancelled()) { return null; } - - return ctApiDAO.getAuthToken(decryptedLicense); + + return ctApiDAO.getAuthToken(decryptedLicense); } @Override protected void done() { AuthTokenResponse authTokenResponse = null; + String authTokenError = null; try { authTokenResponse = get(); } catch (InterruptedException | CancellationException ex) { @@ -726,24 +779,16 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { } catch (ExecutionException ex) { if (ex.getCause() != null && ex.getCause() instanceof CTCloudException cloudEx) { logger.log(Level.WARNING, "An API error occurred while fetching malware scans information for license", cloudEx); - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - cloudEx.getErrorDetails(), - Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_apiErr_title(), - JOptionPane.ERROR_MESSAGE); + authTokenError = cloudEx.getErrorDetails(); } else { logger.log(Level.WARNING, "An error occurred while fetching data", ex); - JOptionPane.showMessageDialog( - CTMalwareScannerOptionsPanel.this, - Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_desc(), - Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_title(), - JOptionPane.ERROR_MESSAGE); + authTokenError = Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_desc(); } } finally { synchronized (CTMalwareScannerOptionsPanel.this) { CTMalwareScannerOptionsPanel.this.authTokenFetcher = null; if (!this.isCancelled()) { - setMalwareScansDisplay(authTokenResponse, null); + setMalwareScansDisplay(authTokenResponse, null, htmlWrap(authTokenError)); } } } @@ -755,10 +800,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { private javax.swing.JLabel countersResetLabel; private javax.swing.JLabel fileUploadsRemainingLabel; private javax.swing.JLabel hashLookupsRemainingLabel; + private javax.swing.JLabel licenseErrorLabel; private javax.swing.JButton licenseInfoAddButton; private javax.swing.JLabel licenseInfoExpiresLabel; private javax.swing.JLabel licenseInfoIdLabel; private javax.swing.JLabel licenseInfoMessageLabel; + private javax.swing.JButton licenseInfoRemoveButton; private javax.swing.JLabel licenseInfoUserLabel; private javax.swing.JLabel malwareScansMessageLabel; private javax.swing.JPanel malwareScansPanel; diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Installer.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Installer.java new file mode 100644 index 0000000000..0cbbaca09c --- /dev/null +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Installer.java @@ -0,0 +1,75 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2023 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud; + +import com.basistech.df.cybertriage.autopsy.ctapi.CTApiDAO; +import com.basistech.df.cybertriage.autopsy.ctapi.CTCloudException; +import com.basistech.df.cybertriage.autopsy.ctapi.json.AuthTokenResponse; +import com.basistech.df.cybertriage.autopsy.ctapi.json.LicenseInfo; +import java.util.Optional; +import java.util.logging.Level; +import org.openide.modules.ModuleInstall; +import org.openide.util.NbBundle.Messages; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; + +/** + * Installer to check for a functional license at startup. + */ +public class Installer extends ModuleInstall { + private final static Logger LOGGER = Logger.getLogger(Installer.class.getName()); + + private final static Installer INSTANCE = new Installer(); + + public static Installer getDefault() { + return INSTANCE; + } + + private Installer() {} + + @Override + public void restored() { + new Thread(new LicenseCheck()).start(); + } + + @Messages({ + "Installer_LicenseCheck_cloudExceptionTitle=Cyber Triage Error" + }) + private static class LicenseCheck implements Runnable { + + @Override + public void run() { + try { + Optional licenseInfoOpt = CTLicensePersistence.getInstance().loadLicenseInfo(); + if (licenseInfoOpt.isEmpty()) { + return; + } + + LicenseInfo licenseInfo = licenseInfoOpt.get(); + AuthTokenResponse authTokenResp = CTApiDAO.getInstance().getAuthToken(licenseInfo.getDecryptedLicense()); + // if we got this far, then it was a successful request + } catch (CTCloudException cloudEx) { + LOGGER.log(Level.WARNING, "A cloud exception occurred while fetching an auth token", cloudEx); + MessageNotifyUtil.Notify.warn(Bundle.Installer_LicenseCheck_cloudExceptionTitle(), cloudEx.getErrorDetails()); + } catch (Throwable t) { + LOGGER.log(Level.WARNING, "An error occurred while fetching license info", t); + } + } + } +} diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties index 48a2628742..9f50364c79 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties @@ -3,13 +3,13 @@ # Click nbfs://nbhost/SystemFileSystem/Templates/Other/properties.properties to edit this template CTIncidentImportOptionsPanel.border.title=Local Settings -CTIncidentImportOptionsPanel.fileRepoPathLabel.text=Update the Cyber Triage Data Folder if you are not using the default location: +CTIncidentImportOptionsPanel.fileRepoPathLabel.text=Update the Cyber Triage Data Folder if you are not using the default location: CTIncidentImportOptionsPanel.fileRepoPathField.text= CTIncidentImportOptionsPanel.fileRepoBrowseButton.text=Browse CTIncidentImportOptionsPanel.caseOpenWarningLabel.text=Some settings cannot be modified while a case is open. CTIncidentImportOptionsPanel.fileRepoFileChooser.title=Cyber Triage Data Folder CTIncidentImportOptionsPanel.border.title_1=Incident Importer -CTIncidentImportOptionsPanel.incidentTextLabel.text=The Cyber Triage Incident Import module allows you to open data collected by Cyber Triage in Autopsy. To use this feature you must install the Cyber Triage Import Module. +CTIncidentImportOptionsPanel.incidentTextLabel.text=The Cyber Triage Incident Import module allows you to open data collected by Cyber Triage in Autopsy. To use this feature you must install the Cyber Triage Import Module. CTincidentImportOptionsPanel.instructionsTextLabel.text= CTIncidentImportOptionsPanel.instructionsTextLabel.text=For instructions on obtaining the module refer to: CTIncidentImportOptionsPanel.importModule.text=Cyber Triage Import Module: diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties-MERGED b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties-MERGED index dd406e6725..0e42f25b3a 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties-MERGED +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/Bundle.properties-MERGED @@ -3,13 +3,13 @@ # Click nbfs://nbhost/SystemFileSystem/Templates/Other/properties.properties to edit this template CTIncidentImportOptionsPanel.border.title=Local Settings -CTIncidentImportOptionsPanel.fileRepoPathLabel.text=Update the Cyber Triage Data Folder if you are not using the default location: +CTIncidentImportOptionsPanel.fileRepoPathLabel.text=Update the Cyber Triage Data Folder if you are not using the default location: CTIncidentImportOptionsPanel.fileRepoPathField.text= CTIncidentImportOptionsPanel.fileRepoBrowseButton.text=Browse CTIncidentImportOptionsPanel.caseOpenWarningLabel.text=Some settings cannot be modified while a case is open. CTIncidentImportOptionsPanel.fileRepoFileChooser.title=Cyber Triage Data Folder CTIncidentImportOptionsPanel.border.title_1=Incident Importer -CTIncidentImportOptionsPanel.incidentTextLabel.text=The Cyber Triage Incident Import module allows you to open data collected by Cyber Triage in Autopsy. To use this feature you must install the Cyber Triage Import Module. +CTIncidentImportOptionsPanel.incidentTextLabel.text=The Cyber Triage Incident Import module allows you to open data collected by Cyber Triage in Autopsy. To use this feature you must install the Cyber Triage Import Module. CTincidentImportOptionsPanel.instructionsTextLabel.text= CTIncidentImportOptionsPanel.instructionsTextLabel.text=For instructions on obtaining the module refer to: CTIncidentImportOptionsPanel.importModule.text=Cyber Triage Import Module: diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form index fd11f53ee8..eb0385de70 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form @@ -9,6 +9,15 @@ + + + + + + + + + @@ -20,7 +29,7 @@ - + @@ -28,7 +37,7 @@ - + @@ -39,10 +48,16 @@ + + + + + + - + @@ -51,6 +66,9 @@ + + + @@ -58,7 +76,7 @@ - + @@ -79,7 +97,7 @@ - + @@ -90,6 +108,9 @@ + + + @@ -108,22 +129,33 @@ + + + - + + + + + + + + + - + @@ -134,6 +166,12 @@ + + + + + + @@ -150,6 +188,9 @@ + + + @@ -189,7 +230,7 @@ - + diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java index 40a2c0fe3f..31151c41bc 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java @@ -161,24 +161,31 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { caseOpenWarningLabel = new javax.swing.JLabel(); setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.border.title_1"))); // NOI18N + setMaximumSize(new java.awt.Dimension(650, 2147483647)); + setMinimumSize(new java.awt.Dimension(650, 206)); + setPreferredSize(new java.awt.Dimension(650, 206)); setLayout(new java.awt.GridBagLayout()); incidentTextPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(incidentTextLabel, org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.incidentTextLabel.text")); // NOI18N + incidentTextLabel.setMaximumSize(new java.awt.Dimension(600, 32)); + incidentTextLabel.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); incidentTextPanel.add(incidentTextLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(importModule, org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.importModule.text")); // NOI18N + importModule.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 3); incidentTextPanel.add(importModule, gridBagConstraints); @@ -194,11 +201,14 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.weightx = 1.0; add(incidentTextPanel, gridBagConstraints); instructionsPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(instructionsTextLabel, org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.instructionsTextLabel.text")); // NOI18N + instructionsTextLabel.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; @@ -209,6 +219,7 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { org.openide.awt.Mnemonics.setLocalizedText(instructionsLinkLabel, getHtmlLink(CT_IMPORTER_DOC_LINK)); instructionsLinkLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + instructionsLinkLabel.setPreferredSize(null); instructionsLinkLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { instructionsLinkLabelMouseClicked(evt); @@ -218,18 +229,25 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 2, 5, 5); instructionsPanel.add(instructionsLinkLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; add(instructionsPanel, gridBagConstraints); + repoPanel.setMaximumSize(new java.awt.Dimension(650, 2147483647)); + repoPanel.setPreferredSize(new java.awt.Dimension(650, 75)); repoPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(fileRepoPathLabel, org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.fileRepoPathLabel.text")); // NOI18N + fileRepoPathLabel.setMaximumSize(new java.awt.Dimension(600, 16)); + fileRepoPathLabel.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; @@ -239,6 +257,7 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { repoPanel.add(fileRepoPathLabel, gridBagConstraints); fileRepoPathField.setText(org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.fileRepoPathField.text")); // NOI18N + fileRepoPathField.setPreferredSize(null); fileRepoPathField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fileRepoPathFieldActionPerformed(evt); @@ -274,13 +293,16 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); repoPanel.add(caseOpenWarningLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; add(repoPanel, gridBagConstraints); }// //GEN-END:initComponents private void fileRepoBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileRepoBrowseButtonActionPerformed diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/Bundle.properties-MERGED b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/Bundle.properties-MERGED index decbae37cf..0d44420b04 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/Bundle.properties-MERGED +++ b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/Bundle.properties-MERGED @@ -33,6 +33,9 @@ MalwareScanIngestModule_ShareProcessing_noLookupsRemaining_desc=There are no mor MalwareScanIngestModule_ShareProcessing_noLookupsRemaining_title=No remaining lookups MalwareScanIngestModule_ShareProcessing_noUploadsRemaining_desc=There are no more remaining file uploads for this license at this time. File uploading will be disabled. MalwareScanIngestModule_ShareProcessing_noUploadsRemaining_title=No remaining file uploads +MalwareScanIngestModule_ShareProcessing_startup_generalException_desc=An exception occurred on MalwareScanIngestModule startup. See the log for more information. +MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_desc=The current Cyber Triage license is no longer valid. Please remove the license from the Cyber Triage options panel. +MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_title=Invalid License MalwareScanIngestModule_uploadFile_noRemainingFileUploads_desc=There are no more file uploads on this license at this time. File uploads will be disabled for remaining uploads. MalwareScanIngestModule_uploadFile_noRemainingFileUploads_title=No Remaining File Uploads # {0} - objectId diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java index fee67fdff2..c0e62f0fc0 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java @@ -161,7 +161,10 @@ class MalwareScanIngestModule implements FileIngestModule { "MalwareScanIngestModule_ShareProcessing_noUploadsRemaining_desc=There are no more remaining file uploads for this license at this time. File uploading will be disabled.", "MalwareScanIngestModule_ShareProcessing_lowUploadsLimitWarning_title=File Uploads Limit Low", "# {0} - remainingUploads", - "MalwareScanIngestModule_ShareProcessing_lowUploadsLimitWarning_desc=This license only has {0} file uploads remaining.",}) + "MalwareScanIngestModule_ShareProcessing_lowUploadsLimitWarning_desc=This license only has {0} file uploads remaining.", + "MalwareScanIngestModule_ShareProcessing_startup_generalException_desc=An exception occurred on MalwareScanIngestModule startup. See the log for more information.", + "MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_title=Invalid License", + "MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_desc=The current Cyber Triage license is no longer valid. Please remove the license from the Cyber Triage options panel."}) synchronized void startUp(IngestJobContext context, boolean uploadFiles) throws IngestModuleException { // only run this code once per startup if (ingestJobState != null) { @@ -170,9 +173,18 @@ class MalwareScanIngestModule implements FileIngestModule { try { ingestJobState = getNewJobState(context, uploadFiles); + } catch (CTCloudException cloudEx) { + ingestJobState = IngestJobState.DISABLED; + logger.log(Level.WARNING, "An error occurred while starting the MalwareScanIngestModule.", cloudEx); + throw new IngestModuleException(cloudEx.getErrorDetails(), cloudEx); + } catch (IllegalStateException stateEx) { + ingestJobState = IngestJobState.DISABLED; + logger.log(Level.WARNING, "An error occurred while starting the MalwareScanIngestModule.", stateEx); + throw new IngestModuleException(stateEx.getMessage(), stateEx); } catch (Exception ex) { ingestJobState = IngestJobState.DISABLED; - throw new IngestModuleException("An exception occurred on MalwareScanIngestModule startup", ex); + logger.log(Level.WARNING, "An error occurred while starting the MalwareScanIngestModule.", ex); + throw new IngestModuleException(Bundle.MalwareScanIngestModule_ShareProcessing_startup_generalException_desc(), ex); } } @@ -188,12 +200,7 @@ class MalwareScanIngestModule implements FileIngestModule { // get saved license Optional licenseInfoOpt = ctSettingsPersistence.loadLicenseInfo(); if (licenseInfoOpt.isEmpty() || licenseInfoOpt.get().getDecryptedLicense() == null) { - notifyWarning( - Bundle.MalwareScanIngestModule_ShareProcessing_noLicense_title(), - Bundle.MalwareScanIngestModule_ShareProcessing_noLicense_desc(), - null); - - return IngestJobState.DISABLED; + throw new IllegalStateException(Bundle.MalwareScanIngestModule_ShareProcessing_noLicense_desc()); } AuthTokenResponse authTokenResponse = ctApiDAO.getAuthToken(licenseInfoOpt.get().getDecryptedLicense()); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 310051b7f5..793d90bae3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -107,7 +107,7 @@ class AddImageTask implements Runnable { try { synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { - tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(imageDetails.timeZone, true, imageDetails.ignoreFatOrphanFiles, imageWriterPath); + tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(imageDetails.timeZone, true, imageDetails.ignoreFatOrphanFiles, imageWriterPath, imageDetails.password); } else { return; } @@ -319,8 +319,9 @@ class AddImageTask implements Runnable { String sha1; String sha256; ImageWriterSettings imageWriterSettings; + String password; - ImageDetails(String deviceId, Image image, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, String md5, String sha1, String sha256, ImageWriterSettings imageWriterSettings) { + ImageDetails(String deviceId, Image image, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, String md5, String sha1, String sha256, ImageWriterSettings imageWriterSettings, String password) { this.deviceId = deviceId; this.image = image; this.sectorSize = sectorSize; @@ -330,6 +331,7 @@ class AddImageTask implements Runnable { this.sha1 = sha1; this.sha256 = sha256; this.imageWriterSettings = imageWriterSettings; + this.password = password; } String getImagePath() { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardDataSourceSettingsVisual.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardDataSourceSettingsVisual.java index 320a2200f7..52393fee8f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardDataSourceSettingsVisual.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardDataSourceSettingsVisual.java @@ -49,6 +49,8 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel { private JPanel currentPanel; private final Map datasourceProcessorsMap = new HashMap<>(); + + private final PanelUpdateListener panelUpdateListener; private String currentDsp; @@ -60,6 +62,7 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel { AddImageWizardDataSourceSettingsVisual(AddImageWizardDataSourceSettingsPanel wizPanel) { initComponents(); this.wizPanel = wizPanel; + this.panelUpdateListener = new PanelUpdateListener(); typePanel.setLayout(new BorderLayout()); discoverDataSourceProcessors(); currentDsp = ImageDSProcessor.getType(); //default value to the ImageDSProcessor @@ -107,24 +110,37 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel { */ @SuppressWarnings("deprecation") private void updateCurrentPanel(JPanel panel) { + cleanupUpdateListener(currentPanel); currentPanel = panel; typePanel.removeAll(); typePanel.add(currentPanel, BorderLayout.CENTER); typePanel.validate(); typePanel.repaint(); - currentPanel.addPropertyChangeListener(new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - if (evt.getPropertyName().equals(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString())) { - wizPanel.enableNextButton(getCurrentDSProcessor().isPanelValid()); - } - if (evt.getPropertyName().equals(DataSourceProcessor.DSP_PANEL_EVENT.FOCUS_NEXT.toString())) { - wizPanel.moveFocusToNext(); - } - } - }); + cleanupUpdateListener(currentPanel); + currentPanel.addPropertyChangeListener(panelUpdateListener); this.wizPanel.enableNextButton(getCurrentDSProcessor().isPanelValid()); } + + /** + * Removes PanelUpdateListener from panel if found. + * @param panel The panel from which to remove the listener. + */ + private void cleanupUpdateListener(JPanel panel) { + if (panel == null) { + return; + } + + PropertyChangeListener[] listeners = panel.getPropertyChangeListeners(); + if (listeners == null) { + return; + } + + for (PropertyChangeListener listener: listeners) { + if (listener instanceof PanelUpdateListener) { + panel.removePropertyChangeListener(listener); + } + } + } /** * Returns the currently selected DS Processor @@ -221,4 +237,20 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel { protected abstract boolean addSeparatorAfter(JList list, Object value, int index); } + + /** + * A property change listener that responds to update events. + */ + private class PanelUpdateListener implements PropertyChangeListener { + + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getPropertyName().equals(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString())) { + wizPanel.enableNextButton(getCurrentDSProcessor().isPanelValid()); + } + if (evt.getPropertyName().equals(DataSourceProcessor.DSP_PANEL_EVENT.FOCUS_NEXT.toString())) { + wizPanel.moveFocusToNext(); + } + } + } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 92b64b840b..9fc3d3315e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -270,3 +270,6 @@ LocalFilesPanel.timestampToIncludeLabel.text=Timestamps To Include: LocalFilesPanel.accessTimeCheckBox.text=Access Time - Can be changed when the file is opened LocalFilesPanel.timeStampToIncludeLabel.text=Timestamps To Include: LocalFilesPanel.timeStampNoteLabel.text=NOTE: Time stamps may have changed when the files were copied to the current location. +ImageFilePanel.passwordLabel.text=Bitlocker Password (optional): +ImageFilePanel.passwordTextField.text= +ImageFilePanel.loadingLabel.text=loading... diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED index 14465bba03..f711125611 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED @@ -151,7 +151,7 @@ GeneralFilter.encaseImageDesc.text=Encase Images (*.e01) GeneralFilter.executableDesc.text=Executables (*.exe) GeneralFilter.graphicImageDesc.text=Images (*.png, *.jpg, *.jpeg, *.gif, *.bmp) GeneralFilter.rawImageDesc.text=Raw Images (*.img, *.dd, *.001, *.aa, *.raw, *.bin) -GeneralFilter.virtualMachineImageDesc.text=Virtual Machines (*.vmdk, *.vhd) +GeneralFilter.virtualMachineImageDesc.text=Virtual Machines (*.vmdk, *.vhd, *.vhdx) ImageFilePanel.000.confirmationMessage=The selected file has extenson .001 but there is a .000 file in the sequence of raw images.\nShould the .000 file be used as the start, instead of the selected .001 file?\n ImageFilePanel.moduleErr=Module Error ImageFilePanel.moduleErr.msg=A module caused an error listening to ImageFilePanel updates. See log to determine which module. Some data could be incomplete.\n @@ -159,6 +159,10 @@ ImageFilePanel.validatePanel.dataSourceOnCDriveError=Warning: Path to multi-user ImageFilePanel.validatePanel.invalidMD5=Invalid MD5 hash ImageFilePanel.validatePanel.invalidSHA1=Invalid SHA1 hash ImageFilePanel.validatePanel.invalidSHA256=Invalid SHA256 hash +# {0} - imageOpenError +ImageFilePanel_validatePanel_imageOpenError=

An error occurred while opening the image:{0}

+ImageFilePanel_validatePanel_unknownError=

An unknown error occurred while attempting to validate the image

+ImageFilePanel_validatePanel_unknownErrorMsg= IngestJobInfoPanel.IngestJobTableModel.EndTime.header=End Time IngestJobInfoPanel.IngestJobTableModel.IngestStatus.header=Ingest Status IngestJobInfoPanel.IngestJobTableModel.StartTime.header=Start Time @@ -504,3 +508,6 @@ LocalFilesPanel.timestampToIncludeLabel.text=Timestamps To Include: LocalFilesPanel.accessTimeCheckBox.text=Access Time - Can be changed when the file is opened LocalFilesPanel.timeStampToIncludeLabel.text=Timestamps To Include: LocalFilesPanel.timeStampNoteLabel.text=NOTE: Time stamps may have changed when the files were copied to the current location. +ImageFilePanel.passwordLabel.text=Bitlocker Password (optional): +ImageFilePanel.passwordTextField.text= +ImageFilePanel.loadingLabel.text=loading... diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index 9b174f28f7..fb0c529a4e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.logging.Level; import java.util.UUID; import javax.swing.filechooser.FileFilter; +import org.apache.commons.lang3.StringUtils; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProviders; @@ -82,6 +83,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour private String sha1; private String sha256; private Host host = null; + private String password; static { filtersList.add(allFilter); @@ -162,7 +164,9 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour */ @Override public boolean isPanelValid() { - return configPanel.validatePanel(); + // before attempting to validate the panel (a potentially long running operation), + // check if the validation is loading or on delay. + return !configPanel.isValidationLoading() && configPanel.validatePanel(); } /** @@ -181,7 +185,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour */ @Override public void run(DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { - run(null, progressMonitor, callback); + run(null, null, progressMonitor, callback); } /** @@ -201,12 +205,19 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour */ @Override public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { + run(null, host, progressMonitor, callback); + } + + + @Override + public void run(String password, Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { ingestStream = new DefaultIngestStream(); readConfigSettings(); this.host = host; + this.password = StringUtils.defaultString(password, this.password); try { image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), - new String[]{imagePath}, sectorSize, timeZone, md5, sha1, sha256, deviceId, this.host); + new String[]{imagePath}, sectorSize, timeZone, md5, sha1, sha256, deviceId, this.password, this.host); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error adding data source with path " + imagePath + " to database", ex); final List errors = new ArrayList<>(); @@ -215,117 +226,9 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour return; } - doAddImageProcess(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, progressMonitor, callback); - } - - /** - * Adds a data source to the case database using a background task in a - * separate thread and the settings provided by the selection and - * configuration panel. Files found during ingest will be sent directly to - * the IngestStream provided. Returns as soon as the background task is - * started. The background task uses a callback object to signal task - * completion and return results. - * - * This method should not be called unless isPanelValid returns true, and - * should only be called for DSPs that support ingest streams. - * - * @param settings The ingest job settings. - * @param progress Progress monitor that will be used by the background task - * to report progress. - * @param callBack Callback that will be used by the background task to - * return results. - */ - @Override - public void runWithIngestStream(IngestJobSettings settings, DataSourceProcessorProgressMonitor progress, - DataSourceProcessorCallback callBack) { - runWithIngestStream(null, settings, progress, callBack); - } - - /** - * Adds a data source to the case database using a background task in a - * separate thread and the settings provided by the selection and - * configuration panel. Files found during ingest will be sent directly to - * the IngestStream provided. Returns as soon as the background task is - * started. The background task uses a callback object to signal task - * completion and return results. - * - * This method should not be called unless isPanelValid returns true, and - * should only be called for DSPs that support ingest streams. - * - * @param host The host for this data source. - * @param settings The ingest job settings. - * @param progress Progress monitor that will be used by the background task - * to report progress. - * @param callBack Callback that will be used by the background task to - * return results. - */ - @Override - public void runWithIngestStream(Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progress, - DataSourceProcessorCallback callBack) { - - // Read the settings from the wizard - readConfigSettings(); - this.host = host; - - // Set up the data source before creating the ingest stream - try { - image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), - new String[]{imagePath}, sectorSize, timeZone, md5, sha1, sha256, deviceId, this.host); - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error adding data source with path " + imagePath + " to database", ex); - final List errors = new ArrayList<>(); - errors.add(ex.getMessage()); - callBack.done(DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS, errors, new ArrayList<>()); - return; - } - - // Now initialize the ingest stream - try { - ingestStream = IngestManager.getInstance().openIngestStream(image, settings); - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error starting ingest modules", ex); - // There was an error with ingest, but the data source has already been added - // so proceed with the defaultIngestStream. Code in openIngestStream - // should have caused a dialog to popup with the errors. - ingestStream = new DefaultIngestStream(); - } - - doAddImageProcess(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, progress, callBack); - } - - /** - * Store the options from the config panel. - */ - private void readConfigSettings() { - configPanel.storeSettings(); - deviceId = UUID.randomUUID().toString(); - imagePath = configPanel.getContentPaths(); - sectorSize = configPanel.getSectorSize(); - timeZone = configPanel.getTimeZone(); - ignoreFatOrphanFiles = configPanel.getNoFatOrphans(); - md5 = configPanel.getMd5(); - if (md5.isEmpty()) { - md5 = null; - } - sha1 = configPanel.getSha1(); - if (sha1.isEmpty()) { - sha1 = null; - } - sha256 = configPanel.getSha256(); - if (sha256.isEmpty()) { - sha256 = null; - } - } - - /** - * Check if this DSP supports ingest streams. - * - * @return True if this DSP supports an ingest stream, false otherwise. - */ - @Override - public boolean supportsIngestStream() { - return true; + doAddImageProcess(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, this.password, progressMonitor, callback); } + /** * Adds a data source to the case database using a background task in a @@ -352,7 +255,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour ingestStream = new DefaultIngestStream(); try { image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), - new String[]{imagePath}, sectorSize, timeZone, "", "", "", deviceId); + new String[]{imagePath}, sectorSize, timeZone, "", "", "", deviceId, null, null); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error adding data source with path " + imagePath + " to database", ex); final List errors = new ArrayList<>(); @@ -361,9 +264,134 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour return; } - doAddImageProcess(deviceId, imagePath, 0, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callback); + doAddImageProcess(deviceId, imagePath, 0, timeZone, ignoreFatOrphanFiles, null, null, null, this.password, progressMonitor, callback); + } + + + + /** + * Adds a data source to the case database using a background task in a + * separate thread and the settings provided by the selection and + * configuration panel. Files found during ingest will be sent directly to + * the IngestStream provided. Returns as soon as the background task is + * started. The background task uses a callback object to signal task + * completion and return results. + * + * This method should not be called unless isPanelValid returns true, and + * should only be called for DSPs that support ingest streams. + * + * @param settings The ingest job settings. + * @param progress Progress monitor that will be used by the background task + * to report progress. + * @param callBack Callback that will be used by the background task to + * return results. + */ + @Override + public void runWithIngestStream(IngestJobSettings settings, DataSourceProcessorProgressMonitor progress, + DataSourceProcessorCallback callBack) { + runWithIngestStream(null, null, settings, progress, callBack); } + /** + * Adds a data source to the case database using a background task in a + * separate thread and the settings provided by the selection and + * configuration panel. Files found during ingest will be sent directly to + * the IngestStream provided. Returns as soon as the background task is + * started. The background task uses a callback object to signal task + * completion and return results. + * + * This method should not be called unless isPanelValid returns true, and + * should only be called for DSPs that support ingest streams. + * + * @param host The host for this data source. + * @param settings The ingest job settings. + * @param progress Progress monitor that will be used by the background task + * to report progress. + * @param callBack Callback that will be used by the background task to + * return results. + */ + @Override + public void runWithIngestStream(Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progress, + DataSourceProcessorCallback callBack) { + runWithIngestStream(null, host, settings, progress, callBack); + } + + + @Override + public void runWithIngestStream(String password, Host host, IngestJobSettings settings, + DataSourceProcessorProgressMonitor progress, DataSourceProcessorCallback callBack) { + + // Read the settings from the wizard + readConfigSettings(); + this.host = host; + this.password = StringUtils.defaultString(password, this.password); + + // Set up the data source before creating the ingest stream + try { + image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), + new String[]{imagePath}, sectorSize, timeZone, md5, sha1, sha256, deviceId, this.password, this.host); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error adding data source with path " + imagePath + " to database", ex); + final List errors = new ArrayList<>(); + errors.add(ex.getMessage()); + callBack.done(DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS, errors, new ArrayList<>()); + return; + } + + // Now initialize the ingest stream + try { + ingestStream = IngestManager.getInstance().openIngestStream(image, settings); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error starting ingest modules", ex); + // There was an error with ingest, but the data source has already been added + // so proceed with the defaultIngestStream. Code in openIngestStream + // should have caused a dialog to popup with the errors. + ingestStream = new DefaultIngestStream(); + } + + doAddImageProcess(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, this.password, progress, callBack); + } + + + /** + * Store the options from the config panel. + */ + private void readConfigSettings() { + configPanel.storeSettings(); + deviceId = UUID.randomUUID().toString(); + imagePath = configPanel.getContentPaths(); + sectorSize = configPanel.getSectorSize(); + timeZone = configPanel.getTimeZone(); + ignoreFatOrphanFiles = configPanel.getNoFatOrphans(); + md5 = configPanel.getMd5(); + if (md5.isEmpty()) { + md5 = null; + } + sha1 = configPanel.getSha1(); + if (sha1.isEmpty()) { + sha1 = null; + } + sha256 = configPanel.getSha256(); + if (sha256.isEmpty()) { + sha256 = null; + } + this.password = configPanel.getPassword(); + if (this.password.isEmpty()) { + password = null; + } + } + + /** + * Check if this DSP supports ingest streams. + * + * @return True if this DSP supports an ingest stream, false otherwise. + */ + @Override + public boolean supportsIngestStream() { + return true; + } + + /** * Adds a data source to the case database using a background task in a * separate thread and the given settings instead of those provided by the @@ -389,11 +417,12 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour * @param md5 The MD5 hash of the image, may be null. * @param sha1 The SHA-1 hash of the image, may be null. * @param sha256 The SHA-256 hash of the image, may be null. + * @param password Password for image decryption. May be null. * @param progressMonitor Progress monitor for reporting progress * during processing. * @param callback Callback to call when processing is done. */ - private void doAddImageProcess(String deviceId, String imagePath, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, String md5, String sha1, String sha256, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { + private void doAddImageProcess(String deviceId, String imagePath, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, String md5, String sha1, String sha256, String password, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { // If the data source or ingest stream haven't been initialized, stop processing if (ingestStream == null) { @@ -413,7 +442,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour return; } - AddImageTask.ImageDetails imageDetails = new AddImageTask.ImageDetails(deviceId, image, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, null); + AddImageTask.ImageDetails imageDetails = new AddImageTask.ImageDetails(deviceId, image, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, null, password); addImageTask = new AddImageTask(imageDetails, progressMonitor, new StreamingAddDataSourceCallbacks(ingestStream), @@ -449,6 +478,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour timeZone = null; ignoreFatOrphanFiles = false; host = null; + password = null; configPanel.reset(); } @@ -463,6 +493,13 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour @Override public int canProcess(Path dataSourcePath) throws AutoIngestDataSourceProcessorException { + return canProcess(dataSourcePath, null); + } + + + + @Override + public int canProcess(Path dataSourcePath, String password) throws AutoIngestDataSourceProcessorException { // check file extension for supported types if (!isAcceptedByFiler(dataSourcePath.toFile(), filtersList)) { @@ -470,10 +507,20 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour } try { - // verify that the image has a file system that TSK can process - if (!DataSourceUtils.imageHasFileSystem(dataSourcePath)) { - // image does not have a file system that TSK can process - return 0; + if (password == null) { + + // verify that the image has a file system that TSK can process + if (!DataSourceUtils.imageHasFileSystem(dataSourcePath)) { + // image does not have a file system that TSK can process + return 0; + } + } else { + // verify that the image has a file system that TSK can process + if (!DataSourceUtils.imageHasFileSystem(dataSourcePath, password)) { + // image does not have a file system that TSK can process + return 0; + } + } } catch (Exception ex) { throw new AutoIngestDataSourceProcessorException("Exception inside canProcess() method", ex); @@ -485,23 +532,29 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour @Override public void process(String deviceId, Path dataSourcePath, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { - process(deviceId, dataSourcePath, null, progressMonitor, callBack); + process(deviceId, dataSourcePath, null, null, progressMonitor, callBack); } @Override public void process(String deviceId, Path dataSourcePath, Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { + process(deviceId, dataSourcePath, null, host, progressMonitor, callBack); + } + + @Override + public void process(String deviceId, Path dataSourcePath, String password, Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { // this method does not use the config panel this.deviceId = deviceId; this.imagePath = dataSourcePath.toString(); this.sectorSize = 0; this.timeZone = Calendar.getInstance().getTimeZone().getID(); + this.password = StringUtils.defaultString(password, this.password); this.host = host; this.ignoreFatOrphanFiles = false; ingestStream = new DefaultIngestStream(); try { image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), - new String[]{imagePath}, sectorSize, timeZone, "", "", "", deviceId, host); + new String[]{imagePath}, sectorSize, timeZone, "", "", "", deviceId, this.password, host); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error adding data source with path " + imagePath + " to database", ex); final List errors = new ArrayList<>(); @@ -510,28 +563,36 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour return; } - doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack); + doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, this.password, progressMonitor, callBack); } + + @Override public IngestStream processWithIngestStream(String deviceId, Path dataSourcePath, IngestJobSettings settings, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { - return processWithIngestStream(deviceId, dataSourcePath, null, settings, progressMonitor, callBack); + return processWithIngestStream(deviceId, dataSourcePath, null, null, settings, progressMonitor, callBack); } @Override public IngestStream processWithIngestStream(String deviceId, Path dataSourcePath, Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { + return processWithIngestStream(deviceId, dataSourcePath, null, host, settings, progressMonitor, callBack); + } + + @Override + public IngestStream processWithIngestStream(String deviceId, Path dataSourcePath, String password, Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { // this method does not use the config panel this.deviceId = deviceId; this.imagePath = dataSourcePath.toString(); this.sectorSize = 0; this.timeZone = Calendar.getInstance().getTimeZone().getID(); this.host = host; + this.password = password; this.ignoreFatOrphanFiles = false; // Set up the data source before creating the ingest stream try { image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), - new String[]{imagePath}, sectorSize, timeZone, md5, sha1, sha256, deviceId, host); + new String[]{imagePath}, sectorSize, timeZone, md5, sha1, sha256, deviceId, password, host); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error adding data source with path " + imagePath + " to database", ex); final List errors = new ArrayList<>(); @@ -551,8 +612,10 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour return null; } - doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack); + doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, password, progressMonitor, callBack); return ingestStream; } + + } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.form index 0c634afc24..6e3633641d 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.form @@ -19,108 +19,10 @@ +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -128,6 +30,11 @@ + + + + + @@ -138,6 +45,11 @@ + + + + + @@ -145,6 +57,11 @@ + + + + + @@ -152,6 +69,11 @@ + + + + + @@ -163,6 +85,11 @@ + + + + + @@ -173,6 +100,11 @@ + + + + + @@ -182,7 +114,22 @@ + + + + + + + + + + + + + + + @@ -190,6 +137,11 @@ + + + + + @@ -200,6 +152,11 @@ + + + + + @@ -208,6 +165,11 @@ + + + + + @@ -216,6 +178,11 @@ + + + + + @@ -224,6 +191,11 @@ + + + + + @@ -232,6 +204,11 @@ + + + + + @@ -240,6 +217,11 @@ + + + + + @@ -248,6 +230,11 @@ + + + + + @@ -256,6 +243,11 @@ + + + + + @@ -264,6 +256,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java index eda7149f66..7213838357 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java @@ -18,9 +18,16 @@ */ package org.sleuthkit.autopsy.casemodule; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.io.File; import java.util.Calendar; import java.util.List; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Supplier; +import java.util.logging.Level; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -32,11 +39,14 @@ import org.apache.commons.lang3.StringUtils; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; import org.sleuthkit.autopsy.coreutils.DriveUtils; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.PathValidator; import org.sleuthkit.autopsy.coreutils.TimeZoneUtils; import org.sleuthkit.autopsy.guiutils.JFileChooserFactory; import org.sleuthkit.datamodel.HashUtility; +import org.sleuthkit.datamodel.SleuthkitJNI; +import org.sleuthkit.datamodel.SleuthkitJNI.TestOpenImageResult; /** * Panel for adding an image file such as .img, .E0x, .00x, etc. Allows the user @@ -44,8 +54,10 @@ import org.sleuthkit.datamodel.HashUtility; * files in FAT32. */ @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives -public class ImageFilePanel extends JPanel implements DocumentListener { +public class ImageFilePanel extends JPanel { + private static final Logger logger = Logger.getLogger(AddImageTask.class.getName()); + private static final long serialVersionUID = 1L; private static final String PROP_LASTIMAGE_PATH = "LBL_LastImage_PATH"; //NON-NLS private static final String[] SECTOR_SIZE_CHOICES = {"Auto Detect", "512", "1024", "2048", "4096"}; @@ -53,6 +65,15 @@ public class ImageFilePanel extends JPanel implements DocumentListener { private JFileChooser fileChooser; private final String contextName; private final List fileChooserFilters; + + private static int VALIDATE_TIMEOUT_MILLIS = 1000; + static ScheduledThreadPoolExecutor delayedValidationService = new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat("ImageFilePanel delayed validation").build()); + + private final ReentrantLock validationWaitingLock = new ReentrantLock(); + private final ReentrantLock validationLock = new ReentrantLock(); + + private Runnable validateAction = null; + private Future validateFuture = null; /** * Creates new form ImageFilePanel @@ -76,6 +97,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { sectorSizeComboBox.setSelectedIndex(0); errorLabel.setVisible(false); + loadingLabel.setVisible(false); this.fileChooserFilters = fileChooserFilters; } @@ -105,11 +127,17 @@ public class ImageFilePanel extends JPanel implements DocumentListener { */ public static synchronized ImageFilePanel createInstance(String context, List fileChooserFilters) { ImageFilePanel instance = new ImageFilePanel(context, fileChooserFilters); + DocumentListener delayedValidationListener = instance.new DelayedValidationDocListener(); + // post-constructor initialization of listener support without leaking references of uninitialized objects - instance.getPathTextField().getDocument().addDocumentListener(instance); - instance.getMd5TextFieldField().getDocument().addDocumentListener(instance); - instance.getSha1TextField().getDocument().addDocumentListener(instance); - instance.getSha256TextField().getDocument().addDocumentListener(instance); + for (JTextField textField: List.of( + instance.getPathTextField(), + instance.getMd5TextFieldField(), + instance.getSha1TextField(), + instance.getSha256TextField(), + instance.getPasswordTextField())) { + textField.getDocument().addDocumentListener(delayedValidationListener); + } return instance; } @@ -129,6 +157,10 @@ public class ImageFilePanel extends JPanel implements DocumentListener { return sha256HashTextField; } + private JTextField getPasswordTextField() { + return passwordTextField; + } + private JFileChooser getChooser() { if(fileChooser == null) { fileChooser = fileChooserHelper.getChooser(); @@ -151,6 +183,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { */ // //GEN-BEGIN:initComponents private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; pathLabel = new javax.swing.JLabel(); browseButton = new javax.swing.JButton(); @@ -169,11 +202,25 @@ public class ImageFilePanel extends JPanel implements DocumentListener { md5HashLabel = new javax.swing.JLabel(); hashValuesLabel = new javax.swing.JLabel(); hashValuesNoteLabel = new javax.swing.JLabel(); + passwordLabel = new javax.swing.JLabel(); + passwordTextField = new javax.swing.JTextField(); + javax.swing.JPanel spacer = new javax.swing.JPanel(); + loadingLabel = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(0, 65)); setPreferredSize(new java.awt.Dimension(403, 65)); + setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(pathLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.pathLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + add(pathLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.browseButton.text")); // NOI18N browseButton.addActionListener(new java.awt.event.ActionListener() { @@ -181,125 +228,227 @@ public class ImageFilePanel extends JPanel implements DocumentListener { browseButtonActionPerformed(evt); } }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(browseButton, gridBagConstraints); pathTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.pathTextField.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(pathTextField, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(timeZoneLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.timeZoneLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(timeZoneLabel, gridBagConstraints); timeZoneComboBox.setMaximumRowCount(30); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 3; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(timeZoneComboBox, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.noFatOrphansCheckbox.text")); // NOI18N noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.noFatOrphansCheckbox.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(noFatOrphansCheckbox, gridBagConstraints); errorLabel.setForeground(new java.awt.Color(255, 0, 0)); org.openide.awt.Mnemonics.setLocalizedText(errorLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.errorLabel.text")); // NOI18N + errorLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); + errorLabel.setMaximumSize(new java.awt.Dimension(500, 60)); + errorLabel.setMinimumSize(new java.awt.Dimension(200, 20)); + errorLabel.setPreferredSize(new java.awt.Dimension(200, 60)); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 11; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + add(errorLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(sectorSizeLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sectorSizeLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 4; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(sectorSizeLabel, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 4; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(sectorSizeComboBox, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(sha256HashLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha256HashLabel.text")); // NOI18N sha256HashLabel.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 9; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(sha256HashLabel, gridBagConstraints); sha256HashTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha256HashTextField.text")); // NOI18N sha256HashTextField.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 9; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(sha256HashTextField, gridBagConstraints); sha1HashTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha1HashTextField.text")); // NOI18N sha1HashTextField.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 8; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(sha1HashTextField, gridBagConstraints); md5HashTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.md5HashTextField.text")); // NOI18N md5HashTextField.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 7; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(md5HashTextField, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(sha1HashLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sha1HashLabel.text")); // NOI18N sha1HashLabel.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 8; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(sha1HashLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(md5HashLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.md5HashLabel.text")); // NOI18N md5HashLabel.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 7; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(md5HashLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(hashValuesLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.hashValuesLabel.text")); // NOI18N hashValuesLabel.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 6; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + add(hashValuesLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(hashValuesNoteLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.hashValuesNoteLabel.text")); // NOI18N hashValuesNoteLabel.setEnabled(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 10; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(hashValuesNoteLabel, gridBagConstraints); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(pathTextField) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(browseButton) - .addGap(2, 2, 2)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(pathLabel) - .addComponent(noFatOrphansCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 368, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(errorLabel) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(timeZoneLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(sectorSizeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(md5HashLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(md5HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(sha1HashLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(sha1HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(sha256HashLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(sha256HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addComponent(hashValuesNoteLabel) - .addComponent(hashValuesLabel)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + org.openide.awt.Mnemonics.setLocalizedText(passwordLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.passwordLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + add(passwordLabel, gridBagConstraints); + + passwordTextField.setText(org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.passwordTextField.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 5; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(passwordTextField, gridBagConstraints); + + javax.swing.GroupLayout spacerLayout = new javax.swing.GroupLayout(spacer); + spacer.setLayout(spacerLayout); + spacerLayout.setHorizontalGroup( + spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(pathLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(browseButton) - .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(noFatOrphansCheckbox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(timeZoneLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(sectorSizeLabel)) - .addGap(39, 39, 39) - .addComponent(hashValuesLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(md5HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(md5HashLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(sha1HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(sha1HashLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(sha256HashTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(sha256HashLabel)) - .addGap(18, 18, 18) - .addComponent(hashValuesNoteLabel) - .addGap(18, 18, 18) - .addComponent(errorLabel) - .addContainerGap(51, Short.MAX_VALUE)) + spacerLayout.setVerticalGroup( + spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) ); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 12; + gridBagConstraints.weighty = 1.0; + add(spacer, gridBagConstraints); + + loadingLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/working_spinner.gif"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(loadingLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.loadingLabel.text")); // NOI18N + loadingLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); + loadingLabel.setMaximumSize(new java.awt.Dimension(500, 60)); + loadingLabel.setMinimumSize(new java.awt.Dimension(200, 20)); + loadingLabel.setPreferredSize(new java.awt.Dimension(200, 60)); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 11; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + add(loadingLabel, gridBagConstraints); }// //GEN-END:initComponents @NbBundle.Messages({"ImageFilePanel.000.confirmationMessage=The selected file" @@ -349,9 +498,12 @@ public class ImageFilePanel extends JPanel implements DocumentListener { private javax.swing.JLabel errorLabel; private javax.swing.JLabel hashValuesLabel; private javax.swing.JLabel hashValuesNoteLabel; + private javax.swing.JLabel loadingLabel; private javax.swing.JLabel md5HashLabel; private javax.swing.JTextField md5HashTextField; private javax.swing.JCheckBox noFatOrphansCheckbox; + private javax.swing.JLabel passwordLabel; + private javax.swing.JTextField passwordTextField; private javax.swing.JLabel pathLabel; private javax.swing.JTextField pathTextField; private javax.swing.JComboBox sectorSizeComboBox; @@ -436,6 +588,10 @@ public class ImageFilePanel extends JPanel implements DocumentListener { String getSha256() { return this.sha256HashTextField.getText(); } + + String getPassword() { + return this.passwordTextField.getText(); + } public void reset() { //reset the UI elements to default @@ -443,6 +599,24 @@ public class ImageFilePanel extends JPanel implements DocumentListener { this.md5HashTextField.setText(null); this.sha1HashTextField.setText(null); this.sha256HashTextField.setText(null); + this.passwordTextField.setText(null); + } + + /** + * Sets UI enabled state. + * + * @param enabled True + */ + private void setUIEnabled(boolean enabled, boolean validNonE01) { + this.browseButton.setEnabled(enabled); + this.noFatOrphansCheckbox.setEnabled(enabled); + this.passwordTextField.setEnabled(enabled); + this.pathTextField.setEnabled(enabled); + this.sectorSizeComboBox.setEnabled(enabled); + this.md5HashTextField.setEnabled(enabled && validNonE01); + this.sha1HashTextField.setEnabled(enabled && validNonE01); + this.sha256HashTextField.setEnabled(enabled && validNonE01); + this.timeZoneComboBox.setEnabled(enabled); } /** @@ -454,49 +628,113 @@ public class ImageFilePanel extends JPanel implements DocumentListener { "ImageFilePanel.validatePanel.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive", "ImageFilePanel.validatePanel.invalidMD5=Invalid MD5 hash", "ImageFilePanel.validatePanel.invalidSHA1=Invalid SHA1 hash", - "ImageFilePanel.validatePanel.invalidSHA256=Invalid SHA256 hash",}) + "ImageFilePanel.validatePanel.invalidSHA256=Invalid SHA256 hash", + "# {0} - imageOpenError", + "ImageFilePanel_validatePanel_imageOpenError=

An error occurred while opening the image:{0}

", + "ImageFilePanel_validatePanel_unknownErrorMsg=", + "ImageFilePanel_validatePanel_unknownError=

An unknown error occurred while attempting to validate the image

" + }) public boolean validatePanel() { - errorLabel.setVisible(false); + return runWithLock(this.validationLock, () -> { + boolean validNonE01 = true; + try { - String path = getContentPaths(); - if (!isImagePathValid()) { - return false; - } + // acquire field values at the beginning to minimize chance of changing while validating. + String path = getContentPaths(); - if (!StringUtils.isBlank(getMd5()) && !HashUtility.isValidMd5Hash(getMd5())) { + validNonE01 = isValidNonE01(path); + setUIEnabled(false, validNonE01); + + String md5 = getMd5(); + String sha1 = getSha1(); + String sha256 = getSha256(); + String password = getPassword(); + + if (!isImagePathValid(path)) { + showError(null); + return false; + } + + if (!StringUtils.isBlank(md5) && !HashUtility.isValidMd5Hash(md5)) { + showError(Bundle.ImageFilePanel_validatePanel_invalidMD5()); + return false; + } + + if (!StringUtils.isBlank(sha1) && !HashUtility.isValidSha1Hash(sha1)) { + showError(Bundle.ImageFilePanel_validatePanel_invalidSHA1()); + return false; + } + + if (!StringUtils.isBlank(sha256) && !HashUtility.isValidSha256Hash(sha256)) { + showError(Bundle.ImageFilePanel_validatePanel_invalidSHA256()); + return false; + } + + try { + TestOpenImageResult testResult = SleuthkitJNI.testOpenImage(path, password); + if (!testResult.wasSuccessful()) { + showError(Bundle.ImageFilePanel_validatePanel_imageOpenError( + StringUtils.defaultIfBlank( + testResult.getMessage(), + Bundle.ImageFilePanel_validatePanel_unknownErrorMsg()))); + return false; + } + } catch (Throwable t) { + logger.log(Level.SEVERE, "An unknown error occurred test opening image: " + path, t); + showError(Bundle.ImageFilePanel_validatePanel_unknownError()); + return false; + } + + if (!PathValidator.isValidForCaseType(path, Case.getCurrentCase().getCaseType())) { + showError(Bundle.ImageFilePanel_validatePanel_dataSourceOnCDriveError()); + } else { + showError(null); + } + return true; + } finally { + setUIEnabled(true, validNonE01); + } + }); + } + + /** + * Show an error message if error message is non-empty. Otherwise, hide + * error message. Either way, hide loading label. + * + * @param errorMessage The error message to show or null for no error. + */ + private void showError(String errorMessage) { + loadingLabel.setVisible(false); + if (StringUtils.isNotBlank(errorMessage)) { errorLabel.setVisible(true); - errorLabel.setText(Bundle.ImageFilePanel_validatePanel_invalidMD5()); - return false; + errorLabel.setText(errorMessage); + } else { + errorLabel.setVisible(false); + errorLabel.setText(""); } + } - if (!StringUtils.isBlank(getSha1()) && !HashUtility.isValidSha1Hash(getSha1())) { - errorLabel.setVisible(true); - errorLabel.setText(Bundle.ImageFilePanel_validatePanel_invalidSHA1()); + /** + * Returns true if path is valid for processing. + * + * @param path The path. + * @return True if valid for processing. + */ + private boolean isImagePathValid(String path) { + if (StringUtils.isBlank(path) || (!(new File(path).isFile() || DriveUtils.isPhysicalDrive(path) || DriveUtils.isPartition(path)))) { return false; } - if (!StringUtils.isBlank(getSha256()) && !HashUtility.isValidSha256Hash(getSha256())) { - errorLabel.setVisible(true); - errorLabel.setText(Bundle.ImageFilePanel_validatePanel_invalidSHA256()); - return false; - } - - if (!PathValidator.isValidForCaseType(path, Case.getCurrentCase().getCaseType())) { - errorLabel.setVisible(true); - errorLabel.setText(Bundle.ImageFilePanel_validatePanel_dataSourceOnCDriveError()); - } - return true; } - private boolean isImagePathValid() { - String path = getContentPaths(); - - if (StringUtils.isBlank(path) || (!(new File(path).isFile() || DriveUtils.isPhysicalDrive(path) || DriveUtils.isPartition(path)))) { - return false; - } - - return true; + /** + * Returns true if the path is a valid image that is not an E01. + * @param path The path. + * @return True if valid image and not E01. + */ + private boolean isValidNonE01(String path) { + return StringUtils.isNotBlank(path) && isImagePathValid(path) && !path.toLowerCase().endsWith(".e01"); } public void storeSettings() { @@ -514,21 +752,6 @@ public class ImageFilePanel extends JPanel implements DocumentListener { } } - @Override - public void insertUpdate(DocumentEvent e) { - updateHelper(); - } - - @Override - public void removeUpdate(DocumentEvent e) { - updateHelper(); - } - - @Override - public void changedUpdate(DocumentEvent e) { - updateHelper(); - } - /** * Update functions are called by the pathTextField which has this set as * it's DocumentEventListener. Each update function fires a property change @@ -539,12 +762,13 @@ public class ImageFilePanel extends JPanel implements DocumentListener { "ImageFilePanel.moduleErr.msg=A module caused an error listening to ImageFilePanel updates." + " See log to determine which module. Some data could be incomplete.\n"}) private void updateHelper() { - if (isImagePathValid() && !getContentPaths().toLowerCase().endsWith(".e01")) { + String path = getContentPaths(); + if (isValidNonE01(path)) { setHashValuesComponentsEnabled(true); } else { setHashValuesComponentsEnabled(false); } - + firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } @@ -554,4 +778,119 @@ public class ImageFilePanel extends JPanel implements DocumentListener { public void select() { pathTextField.requestFocusInWindow(); } + + /** + * Runs the supplier action with the reentrant lock or blocks until + * acquired. + * + * @param + * @param lock The reentrant lock. + * @param action The action to run. + * @return The value of the supplier. + */ + private T runWithLock(ReentrantLock lock, Supplier action) { + try { + lock.lock(); + return action.get(); + } finally { + lock.unlock(); + } + } + + /** + * @return True if the panel is on a delay for validating (i.e. typing a + * password for bitlocker). + */ + public boolean isValidationLoading() { + return runWithLock(this.validationWaitingLock, () -> this.validateFuture != null + && !this.validateFuture.isCancelled() + && !this.validateFuture.isDone()); + } + + /** + * This class validates on a delay canceling any tasks previously scheduled + * so that password validation doesn't lock up the system. + */ + private class DelayedValidationDocListener implements DocumentListener { + + @Override + public void insertUpdate(DocumentEvent e) { + delayValidate(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + delayValidate(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + delayValidate(); + } + + /** + * Run validation on a delay to avoid password checking too many times + * while typing. + */ + private void delayValidate() { + + boolean triggerUpdate = runWithLock(validationWaitingLock, () -> { + + boolean toRetTriggerUpdate = false; + if (isValidationLoading()) { + validateFuture.cancel(true); + toRetTriggerUpdate = true; + } + + validateAction = new ValidationRunnable(); + + validateFuture = delayedValidationService.schedule( + validateAction, + VALIDATE_TIMEOUT_MILLIS, + TimeUnit.MILLISECONDS); + + return toRetTriggerUpdate; + }); + + errorLabel.setVisible(false); + loadingLabel.setVisible(true); + + // trigger invalidation after setting up new runnable if not already triggered + if (triggerUpdate) { + firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); + } + } + + /** + * Runnable to run the updateHelper if the validation action remains + * this runnable. + */ + private class ValidationRunnable implements Runnable { + + @Override + public void run() { + + boolean isRunningAction = runWithLock(validationWaitingLock, () -> { + if (validateAction != this) { + return false; + } + + // set the validation action to null to indicate that this is done running and can be validated. + validateAction = null; + validateFuture = null; + + return true; + }); + + if (!isRunningAction) { + return; + } else if (Thread.interrupted()) { + return; + } + + ImageFilePanel.this.updateHelper(); + } + + } + } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java index c659727d74..463d5c9bcd 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java @@ -59,6 +59,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { private Host host; private ImageWriterSettings imageWriterSettings; private boolean ignoreFatOrphanFiles; + private String password; /** * Constructs a local drive data source processor that implements the @@ -135,9 +136,14 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { */ @Override public void run(DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { - run(null, progressMonitor, callback); + run(null, null, progressMonitor, callback); } + @Override + public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { + run(null, host, progressMonitor, callback); + } + /** * Adds a data source to the case database using a background task in a * separate thread and the settings provided by the selection and @@ -154,7 +160,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { * to return results. */ @Override - public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { + public void run(String password, Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { deviceId = UUID.randomUUID().toString(); drivePath = configPanel.getContentPath(); sectorSize = configPanel.getSectorSize(); @@ -167,12 +173,13 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { } this.host = host; + this.password = password; Image image; try { image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), new String[]{drivePath}, sectorSize, - timeZone, null, null, null, deviceId, this.host); + timeZone, null, null, null, deviceId, this.password, this.host); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error adding local disk with path " + drivePath + " to database", ex); final List errors = new ArrayList<>(); @@ -182,7 +189,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { } addDiskTask = new AddImageTask( - new AddImageTask.ImageDetails(deviceId, image, sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, imageWriterSettings), + new AddImageTask.ImageDetails(deviceId, image, sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, imageWriterSettings, this.password), progressMonitor, new StreamingAddDataSourceCallbacks(new DefaultIngestStream()), new StreamingAddImageTaskCallback(new DefaultIngestStream(), callback)); @@ -241,7 +248,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { try { image = SleuthkitJNI.addImageToDatabase(Case.getCurrentCase().getSleuthkitCase(), new String[]{drivePath}, sectorSize, - timeZone, null, null, null, deviceId); + timeZone, null, null, null, deviceId, this.password, null); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error adding local disk with path " + drivePath + " to database", ex); final List errors = new ArrayList<>(); @@ -250,7 +257,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { return; } - addDiskTask = new AddImageTask(new AddImageTask.ImageDetails(deviceId, image, sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, imageWriterSettings), + addDiskTask = new AddImageTask(new AddImageTask.ImageDetails(deviceId, image, sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, imageWriterSettings, this.password), progressMonitor, new StreamingAddDataSourceCallbacks(new DefaultIngestStream()), new StreamingAddImageTaskCallback(new DefaultIngestStream(), callback)); diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CRDefaultSetupAction.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CRDefaultSetupAction.java new file mode 100644 index 0000000000..fc514ff5f7 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CRDefaultSetupAction.java @@ -0,0 +1,119 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2017-2020 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.centralrepository.eventlisteners; + +import java.lang.reflect.InvocationTargetException; +import java.util.Map; +import java.util.logging.Level; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; +import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbChoice; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; +import org.sleuthkit.autopsy.core.RuntimeProperties; +import org.sleuthkit.autopsy.core.UserPreferences; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.coreutils.ModuleSettings; + +/** + * Runs the default setup for central repository and notifies the user if a) + * running with GUI and b) first launch. + */ +public class CRDefaultSetupAction { + + private static final Logger logger = Logger.getLogger(CRDefaultSetupAction.class.getName()); + private static final CRDefaultSetupAction INSTANCE = new CRDefaultSetupAction(); + + public static CRDefaultSetupAction getInstance() { + return INSTANCE; + } + + private CRDefaultSetupAction() { + } + + /** + * Checks if the central repository has been set up and configured. If not, + * does the set up unconditionally. + * + * @return Returns true if first run and a default CR was setup. + */ + public boolean setupDefaultCentralRepository() { + Map centralRepoSettings = ModuleSettings.getConfigSettings(CentralRepoSettings.getInstance().getModuleSettingsKey()); + String initializedStr = centralRepoSettings.get("initialized"); + + // check to see if the repo has been initialized asking to setup cr + boolean initialized = Boolean.parseBoolean(initializedStr); + + // if it hasn't received that flag, check for a previous install where cr is already setup + if (!initialized) { + boolean prevRepo = Boolean.parseBoolean(centralRepoSettings.get("db.useCentralRepo")); + // if it has been previously set up and is in use, mark as previously initialized and save the settings + if (prevRepo) { + initialized = true; + ModuleSettings.setConfigSetting(CentralRepoSettings.getInstance().getModuleSettingsKey(), "initialized", "true"); + } + } + + if (initialized) { + return false; // Nothing to do + } + + try { + CentralRepoDbManager manager = new CentralRepoDbManager(); + if (UserPreferences.getIsMultiUserModeEnabled()) { + // Set up using existing multi-user settings. + manager.setupPostgresDb(CentralRepoDbChoice.POSTGRESQL_MULTIUSER); + } else { + manager.setupDefaultSqliteDb(); + } + } catch (CentralRepoException ex) { + logger.log(Level.SEVERE, "There was an error while initializing the central repository database", ex); + + doMessageBoxIfRunningInGUI(ex); + } + + ModuleSettings.setConfigSetting(CentralRepoSettings.getInstance().getModuleSettingsKey(), "initialized", "true"); + return true; + } + + /** + * Display a central repository exception in a message box if running with a + * GUI. + * + * @param ex The exception. + */ + @NbBundle.Messages({"Installer.centralRepoUpgradeFailed.title=Central repository disabled"}) + private void doMessageBoxIfRunningInGUI(CentralRepoException ex) { + if (RuntimeProperties.runningWithGUI()) { + try { + SwingUtilities.invokeAndWait(() -> { + JOptionPane.showMessageDialog(null, + ex.getUserMessage(), + NbBundle.getMessage(this.getClass(), "Installer.centralRepoUpgradeFailed.title"), + JOptionPane.ERROR_MESSAGE); + }); + } catch (InterruptedException | InvocationTargetException e) { + logger.log(Level.WARNING, e.getMessage(), e); + } + } + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CentralRepositoryNotificationDialog.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CentralRepositoryNotificationDialog.java index 883d979c90..39ce238b2d 100755 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CentralRepositoryNotificationDialog.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CentralRepositoryNotificationDialog.java @@ -33,7 +33,7 @@ public class CentralRepositoryNotificationDialog { * This dialog should display iff the mode is RELEASE and the * application is running with a GUI. */ - static boolean shouldDisplay() { + public static boolean shouldDisplay() { return Version.getBuildType() == Version.Type.RELEASE && RuntimeProperties.runningWithGUI(); } @@ -50,7 +50,7 @@ public class CentralRepositoryNotificationDialog { "CentralRepositoryNotificationDialog.bulletThree=Create personas that group accounts", "CentralRepositoryNotificationDialog.finalRemarks=To limit what is stored, use the Central Repository options panel." }) - static void display() { + public static void display() { assert shouldDisplay(); MessageNotifyUtil.Message.info( diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Installer.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Installer.java index f15dec3029..d233e2764f 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Installer.java @@ -20,21 +20,12 @@ package org.sleuthkit.autopsy.centralrepository.eventlisteners; import java.io.File; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.nio.file.Paths; import java.util.Map; import java.util.logging.Level; -import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; import org.apache.commons.io.FileUtils; import org.openide.modules.ModuleInstall; -import org.openide.util.NbBundle; -import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbChoice; -import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager; -import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings; -import org.sleuthkit.autopsy.core.RuntimeProperties; -import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.PlatformUtil; @@ -90,7 +81,6 @@ public class Installer extends ModuleInstall { public void restored() { // must happen first to move any legacy settings that exist. upgradeSettingsPath(); - setupDefaultCentralRepository(); } @@ -151,76 +141,6 @@ public class Installer extends ModuleInstall { } } - /** - * Checks if the central repository has been set up and configured. If not, - * does the set up unconditionally. If the application is running with a - * GUI, a notification will be displayed to the user if the mode is RELEASE - * (in other words, developers are exempt from seeing the notification). - */ - private void setupDefaultCentralRepository() { - Map centralRepoSettings = ModuleSettings.getConfigSettings(CentralRepoSettings.getInstance().getModuleSettingsKey()); - String initializedStr = centralRepoSettings.get("initialized"); - - // check to see if the repo has been initialized asking to setup cr - boolean initialized = Boolean.parseBoolean(initializedStr); - - // if it hasn't received that flag, check for a previous install where cr is already setup - if (!initialized) { - boolean prevRepo = Boolean.parseBoolean(centralRepoSettings.get("db.useCentralRepo")); - // if it has been previously set up and is in use, mark as previously initialized and save the settings - if (prevRepo) { - initialized = true; - ModuleSettings.setConfigSetting(CentralRepoSettings.getInstance().getModuleSettingsKey(), "initialized", "true"); - } - } - - if(initialized) { - return; // Nothing to do - } - - if (CentralRepositoryNotificationDialog.shouldDisplay()) { - CentralRepositoryNotificationDialog.display(); - } - - try { - CentralRepoDbManager manager = new CentralRepoDbManager(); - if (UserPreferences.getIsMultiUserModeEnabled()) { - // Set up using existing multi-user settings. - manager.setupPostgresDb(CentralRepoDbChoice.POSTGRESQL_MULTIUSER); - } else { - manager.setupDefaultSqliteDb(); - } - } catch (CentralRepoException ex) { - logger.log(Level.SEVERE, "There was an error while initializing the central repository database", ex); - - doMessageBoxIfRunningInGUI(ex); - } - - ModuleSettings.setConfigSetting(CentralRepoSettings.getInstance().getModuleSettingsKey(), "initialized", "true"); - } - - /** - * Display a central repository exception in a message box if running with a - * GUI. - * - * @param ex The exception. - */ - @NbBundle.Messages({"Installer.centralRepoUpgradeFailed.title=Central repository disabled"}) - private void doMessageBoxIfRunningInGUI(CentralRepoException ex) { - if (RuntimeProperties.runningWithGUI()) { - try { - SwingUtilities.invokeAndWait(() -> { - JOptionPane.showMessageDialog(null, - ex.getUserMessage(), - NbBundle.getMessage(this.getClass(), "Installer.centralRepoUpgradeFailed.title"), - JOptionPane.ERROR_MESSAGE); - }); - } catch (InterruptedException | InvocationTargetException e) { - logger.log(Level.WARNING, e.getMessage(), e); - } - } - } - @Override public void uninstalled() { /* diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineCommand.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineCommand.java index 1cacabe67c..378af77b75 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineCommand.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineCommand.java @@ -49,7 +49,9 @@ class CommandLineCommand { DATA_SOURCE_PATH, DATA_SOURCE_ID, INGEST_PROFILE_NAME, - REPORT_PROFILE_NAME; + REPORT_PROFILE_NAME, + BITLOCKER_KEY, + ; } private final CommandType type; diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java index ffc31fff1c..64940a022d 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java @@ -198,7 +198,8 @@ public class CommandLineIngestManager extends CommandLineManager { } String dataSourcePath = inputs.get(CommandLineCommand.InputType.DATA_SOURCE_PATH.name()); - dataSource = new AutoIngestDataSource(UUID.randomUUID().toString(), Paths.get(dataSourcePath)); + String password = inputs.get(CommandLineCommand.InputType.BITLOCKER_KEY.name()); + dataSource = new AutoIngestDataSource(UUID.randomUUID().toString(), Paths.get(dataSourcePath), password); runDataSourceProcessor(caseForJob, dataSource); String outputDirPath = getOutputDirPath(caseForJob); @@ -406,7 +407,7 @@ public class CommandLineIngestManager extends CommandLineManager { // Get an ordered list of data source processors to try List validDataSourceProcessors; try { - validDataSourceProcessors = DataSourceProcessorUtility.getOrderedListOfDataSourceProcessors(dataSource.getPath()); + validDataSourceProcessors = DataSourceProcessorUtility.getOrderedListOfDataSourceProcessors(dataSource.getPath(), dataSource.getPassword()); } catch (AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException ex) { LOGGER.log(Level.SEVERE, "Exception while determining best data source processor for {0}", dataSource.getPath()); // rethrow the exception. @@ -429,7 +430,7 @@ public class CommandLineIngestManager extends CommandLineManager { DataSourceProcessorCallback callBack = new AddDataSourceCallback(caseForJob, dataSource, taskId, ingestLock); caseForJob.notifyAddingDataSource(taskId); LOGGER.log(Level.INFO, "Identified data source type for {0} as {1}", new Object[]{dataSource.getPath(), selectedProcessor.getDataSourceType()}); - selectedProcessor.process(dataSource.getDeviceId(), dataSource.getPath(), progressMonitor, callBack); + selectedProcessor.process(dataSource.getDeviceId(), dataSource.getPath(), dataSource.getPassword(), null, progressMonitor, callBack); ingestLock.wait(); // at this point we got the content object(s) from the current DSP. diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java index 921c2e0a65..dc2a84e727 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineOptionProcessor.java @@ -30,6 +30,7 @@ import java.util.Set; import java.util.logging.Level; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.apache.commons.lang3.ArrayUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.netbeans.api.sendopts.CommandException; import org.netbeans.spi.sendopts.Env; @@ -52,6 +53,7 @@ public class CommandLineOptionProcessor extends OptionProcessor { private final Option dataSourcePathOption = Option.requiredArgument('s', "dataSourcePath"); private final Option dataSourceObjectIdOption = Option.requiredArgument('i', "dataSourceObjectId"); private final Option addDataSourceCommandOption = Option.withoutArgument('a', "addDataSource"); + private final Option bitlockerKeyCommandOption = Option.requiredArgument('k', "key"); private final Option runIngestCommandOption = Option.optionalArgument('r', "runIngest"); private final Option listAllDataSourcesCommandOption = Option.withoutArgument('l', "listAllDataSources"); private final Option generateReportsOption = Option.optionalArgument('g', "generateReports"); @@ -81,20 +83,21 @@ public class CommandLineOptionProcessor extends OptionProcessor { @Override protected Set