diff --git a/Core/ivysettings.xml b/Core/ivysettings.xml index fd792f6844f0c78fa2357fa110b701e129530917..06c2d9308f9e3cee938c0fb910351f006e24aa43 100644 --- a/Core/ivysettings.xml +++ b/Core/ivysettings.xml @@ -4,6 +4,7 @@ <chain name="main"> <ibiblio name="central" root="https://repo1.maven.org/maven2" m2compatible="true"/> <ibiblio name="maven.restlet.org" root="http://maven.restlet.com" m2compatible="true" /> + <ibiblio name="license4j.com" root="http://www.license4j.com/maven/" m2compatible="true" /> </chain> </resolvers> <property name="packaging.type" value="jar" /> diff --git a/Core/nbproject/project.xml b/Core/nbproject/project.xml index 2cab2a535f61ecc153f8abc96434d21c1ae02720..9b960955aa222a2f48a1dc3b87c8e1faec7e18b6 100644 --- a/Core/nbproject/project.xml +++ b/Core/nbproject/project.xml @@ -323,6 +323,7 @@ </test-type> </test-dependencies> <public-packages> + <package>com.basistech.df.cybertriage.autopsy.ctoptions.subpanel</package> <package>net.sf.sevenzipjbinding</package> <package>net.sf.sevenzipjbinding.impl</package> <package>net.sf.sevenzipjbinding.simple</package> 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 698afc32977b11356aa8a9ef2600a38c9a8147d6..52d586ee5366add0266082c26129c9ee208fce46 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudException.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudException.java @@ -24,11 +24,9 @@ import org.apache.commons.lang3.exception.ExceptionUtils; /** - * - * @author rishwanth + * An exception thrown due to an error that occurs while making a CT Cloud REST + * API request. */ - - public class CTCloudException extends Exception{ private final ErrorCode errorCode; diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudHttpClient.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudHttpClient.java index b5d62f91de57431371dd4e3da4037b00332d4832..91a180e9bc787b6812b109652ba1e19a87929481 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudHttpClient.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/CTCloudHttpClient.java @@ -65,7 +65,7 @@ import org.sleuthkit.autopsy.coreutils.Version; /** - * Actually makes the http requests to CT cloud. + * Makes the http requests to CT cloud. */ public class CTCloudHttpClient { @@ -293,12 +293,10 @@ private void configureRequestTimeout(HttpRequestBase request) { } /** - * Creates and returns a CloseableHttpClient SYSTEM and MANUAL looks up from - * runtime proxy config settings. These are updated accordingly from the - * Proxy Config UI. This allows us to keep the CreateConnection call fairly - * simple and not have to deal with the System Proxy settings and such. - * - * @return + * Creates a connection to CT Cloud with the given arguments. + * @param proxySettings The network proxy settings. + * @param sslContext The ssl context or null. + * @return The connection to CT Cloud. */ private static CloseableHttpClient createConnection(ProxySettingArgs proxySettings, SSLContext sslContext) { HttpClientBuilder builder = getHttpClientBuilder(proxySettings); diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/Constants.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/Constants.java index ddda5b45089223c343b5980f77921f5c0ec8e1e1..9587b3cd44dbf4984aac10a9b5639661e5f4a883 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/Constants.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/Constants.java @@ -20,6 +20,9 @@ import java.net.URI; +/** + * Constants regarding connections to cyber triage cloud. + */ final public class Constants { public static final String CYBER_TRIAGE = "CyberTriage"; diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/ProxySettings.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/ProxySettings.java index 2d3f0d667f80cde6d4a3de7bf3a8e443b3eaa6c6..f710a6ab1bb1641d4f890a70de926e93647bc021 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/ProxySettings.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/ProxySettings.java @@ -18,8 +18,6 @@ */ package com.basistech.df.cybertriage.autopsy.ctapi; - - import java.net.*; import java.util.*; import java.util.logging.Level; diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/json/DecryptedLicenseResponse.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/json/DecryptedLicenseResponse.java index 5be0996a9e8fce291b0008d3e62a8460f425b06a..c6f91721ef7d05f679963727e0b787c11b2ea04a 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/json/DecryptedLicenseResponse.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/json/DecryptedLicenseResponse.java @@ -41,6 +41,7 @@ public class DecryptedLicenseResponse { private final String limitType; private final String timezone; private final String customerEmail; + private final String customerName; @JsonCreator public DecryptedLicenseResponse( @@ -55,7 +56,8 @@ public DecryptedLicenseResponse( @JsonProperty("product") String product, @JsonProperty("limitType") String limitType, @JsonProperty("timezone") String timezone, - @JsonProperty("customerEmail") String customerEmail + @JsonProperty("customerEmail") String customerEmail, + @JsonProperty("customerName") String customerName ) { this.boostLicenseId = boostLicenseId; this.licenseHostId = licenseHostId; @@ -67,6 +69,7 @@ public DecryptedLicenseResponse( this.limitType = limitType; this.timezone = timezone; this.customerEmail = customerEmail; + this.customerName = customerName; } public String getBoostLicenseId() { @@ -108,4 +111,8 @@ public String getTimezone() { public String getCustomerEmail() { return customerEmail; } + + public String getCustomerName() { + return customerName; + } } diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/util/ObjectMapperUtil.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/util/ObjectMapperUtil.java index d59d8f8307f42c5f49ddd1455b295afd4df4b2c9..5562141255a2ee83b71bd9590be2feee59e08a29 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/util/ObjectMapperUtil.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctapi/util/ObjectMapperUtil.java @@ -26,8 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.io.IOException; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.time.DateTimeException; import java.time.Instant; import java.time.LocalDate; @@ -37,7 +35,6 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.format.DateTimeParseException; -import java.util.Date; import java.util.Locale; import java.util.function.Function; @@ -58,7 +55,6 @@ private ObjectMapperUtil() { public ObjectMapper getDefaultObjectMapper() { ObjectMapper defaultMapper = new ObjectMapper(); - // defaultMapper.configure(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); defaultMapper.registerModule(new JavaTimeModule()); return defaultMapper; } 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 6eb72dd73e64e021582fadee0a748d91c242ab13..745aa1d03db8ef43b393d2659f8d9aad4c6edb1f 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java @@ -35,7 +35,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; /** - * Options panel for CyberTriage. + * Options panel for Cyber Triage. */ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { @@ -46,7 +46,8 @@ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { private final List<CTOptionsSubPanel> subPanels; /** - * Creates new form CTOptions + * Creates new form CTOptions loading any CTOptionsSubPanel instances to be + * displayed. */ public CTOptionsPanel() { initComponents(); 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 b380dded422c5b61f8bde48d57c7d3b3deaac7d3..34db819373796c21cbe502b96be62f2ca6ddde13 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 @@ -48,7 +48,8 @@ import org.sleuthkit.autopsy.core.UserPreferences; /** - * Options panel for CyberTriage options for importing a CyberTriage incident + * Options panel to be displayed in the CTOptionsPanel for settings regarding + * Cyber Triage Malware Scanner settings and license setup. */ @ServiceProvider(service = CTOptionsSubPanel.class) public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { @@ -75,7 +76,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { private volatile AuthTokenFetcher authTokenFetcher = null; /** - * Creates new form CTIncidentImportOptionsPanel + * Main constructor. */ public CTMalwareScannerOptionsPanel() { initComponents(); @@ -461,15 +462,15 @@ private synchronized void renderLicenseState() { } else { this.licenseInfoExpiresLabel.setVisible(true); this.licenseInfoExpiresLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_expires( - this.licenseInfo.getDecryptedLicense().getExpirationDate() == null - ? "" - : LICENSE_EXPIRES_FORMAT.format(this.licenseInfo.getDecryptedLicense().getExpirationDate()))); + this.licenseInfo.getDecryptedLicense().getExpirationDate() == null + ? "" + : LICENSE_EXPIRES_FORMAT.format(this.licenseInfo.getDecryptedLicense().getExpirationDate()))); this.licenseInfoIdLabel.setVisible(true); - this.licenseInfoIdLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_id(this.licenseInfo.getDecryptedLicense().getBoostLicenseId())); + this.licenseInfoIdLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_id(StringUtils.defaultString(this.licenseInfo.getDecryptedLicense().getBoostLicenseId()))); this.licenseInfoUserLabel.setVisible(true); this.licenseInfoUserLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_userInfo( - "TBD", - this.licenseInfo.getDecryptedLicense().getCustomerEmail())); + StringUtils.defaultString(this.licenseInfo.getDecryptedLicense().getCustomerName()), + StringUtils.defaultString(this.licenseInfo.getDecryptedLicense().getCustomerEmail()))); } this.malwareScansPanel.setVisible(StringUtils.isNotBlank(this.authTokenMessage) || authTokenResponse != null); diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/EULADialog.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/EULADialog.java index 8b93e80c506f71cea90c97cb718594d5ebb84a3c..31056e1f2a982412340a782755ffe77e98c5fdce 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/EULADialog.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/EULADialog.java @@ -34,8 +34,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; /** - * - * @author gregd + * Dialog for displaying the Cyber Triage EULA before the license is saved. */ public class EULADialog extends javax.swing.JDialog {