From 035f35f91eb3049e979b1a7cbab100a7765e3755 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 13 Sep 2023 13:34:13 -0400 Subject: [PATCH 1/8] updates for CT license UI changes --- .../autopsy/ctapi/CTCloudException.java | 2 +- .../ctoptions/ctcloud/Bundle.properties | 2 + .../ctcloud/Bundle.properties-MERGED | 2 + .../ctcloud/CTLicensePersistence.java | 9 ++ .../ctcloud/CTMalwareScannerOptionsPanel.form | 96 +++++++++------ .../ctcloud/CTMalwareScannerOptionsPanel.java | 110 +++++++++++------- .../malwarescan/Bundle.properties-MERGED | 3 + .../malwarescan/MalwareScanIngestModule.java | 19 ++- 8 files changed, 168 insertions(+), 75 deletions(-) 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/ctcloud/Bundle.properties b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties index 8ad7ccebe9..85ee5a7663 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 @@ -26,3 +26,5 @@ 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 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..bc9fbf0a2d 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 @@ -66,3 +66,5 @@ 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 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..185d634399 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 @@ -123,43 +123,22 @@ - + - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -171,19 +150,43 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -195,7 +198,34 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 deff21d423..1cf5accde9 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 @@ -81,6 +81,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. @@ -131,7 +132,7 @@ 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); @@ -168,9 +169,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 +198,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,11 +212,11 @@ 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(); @@ -238,12 +240,14 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { licenseInfoIdLabel = new javax.swing.JLabel(); licenseInfoUserLabel = new javax.swing.JLabel(); licenseInfoAddButton = new javax.swing.JButton(); - maxFileUploadsLabel = new javax.swing.JLabel(); + licenseInfoRemoveButton = new javax.swing.JButton(); + 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(); @@ -312,24 +316,39 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 5); licenseInfoPanel.add(licenseInfoAddButton, gridBagConstraints); - org.openide.awt.Mnemonics.setLocalizedText(maxFileUploadsLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.maxFileUploadsLabel.text")); // NOI18N + 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 = 2; + gridBagConstraints.gridy = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + licenseInfoPanel.add(licenseInfoRemoveButton, 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 = 4; + 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(maxFileUploadsLabel, gridBagConstraints); + 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 = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -338,39 +357,47 @@ 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 = 5; 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 = 6; 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 = 6; + 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 = 7; 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 = 8; + gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - licenseInfoPanel.add(fileUploadsRemainingLabel, gridBagConstraints); + licenseInfoPanel.add(licenseErrorLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -455,6 +482,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 + this.ctPersistence.deleteLicenseResponse(); + setLicenseDisplay(null, null); + setMalwareScansDisplay(null, null, null); + }//GEN-LAST:event_licenseInfoRemoveButtonActionPerformed + @NbBundle.Messages({ "# {0} - userName", "# {1} - email", @@ -477,10 +510,14 @@ 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); @@ -719,6 +756,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { @Override protected void done() { AuthTokenResponse authTokenResponse = null; + String authTokenError = null; try { authTokenResponse = get(); } catch (InterruptedException | CancellationException ex) { @@ -726,24 +764,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, authTokenError); } } } @@ -755,10 +785,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/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..4971d1b94e 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,21 @@ class MalwareScanIngestModule implements FileIngestModule { try { ingestJobState = getNewJobState(context, uploadFiles); + } catch (CTCloudException cloudEx) { + ingestJobState = IngestJobState.DISABLED; + if (cloudEx.getErrorCode() == CTCloudException.ErrorCode.INVALID_KEY) { + notifyWarning( + Bundle.MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_title(), + Bundle.MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_desc(), + cloudEx); + } else { + logger.log(Level.WARNING, "An error occurred while starting the MalwareScanIngestModule.", cloudEx); + } + throw new IngestModuleException(cloudEx.getErrorDetails(), cloudEx); } 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); } } From 441be9e4fd7fd1bcb326fea6bcc88af0c43ef069 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 13 Sep 2023 15:32:59 -0400 Subject: [PATCH 2/8] UI fixes --- .../autopsy/ctoptions/CTOptionsPanel.java | 16 ++--- .../ctcloud/CTMalwareScannerOptionsPanel.form | 40 +++++++++---- .../ctcloud/CTMalwareScannerOptionsPanel.java | 24 ++++---- .../autopsy/incidentoptions/Bundle.properties | 4 +- .../incidentoptions/Bundle.properties-MERGED | 4 +- .../CTIncidentImportOptionsPanel.form | 59 ++++++++++++++++--- .../CTIncidentImportOptionsPanel.java | 24 +++++++- 7 files changed, 131 insertions(+), 40 deletions(-) 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..59777deb58 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java @@ -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/CTMalwareScannerOptionsPanel.form b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.form index 185d634399..b9c3961153 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,14 @@
+ + + + + + + + @@ -11,10 +19,10 @@ - + - + @@ -25,10 +33,16 @@ + + + + + + - - + + @@ -40,6 +54,12 @@ + + + + + + @@ -72,7 +92,7 @@ - + @@ -108,7 +128,7 @@ - + @@ -150,7 +170,7 @@ - + @@ -210,7 +230,7 @@ - + @@ -225,7 +245,7 @@ - + @@ -238,7 +258,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 1cf5accde9..70ce1cd1de 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 @@ -252,13 +252,19 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { purchaseFromLabel = new javax.swing.JLabel(); purchaseLink = new javax.swing.JLabel(); - setLayout(new java.awt.GridBagLayout()); + setMaximumSize(new java.awt.Dimension(650, 2147483647)); + setPreferredSize(null); + setLayout(new java.awt.BorderLayout()); 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.setPreferredSize(null); malwareScansPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(disclaimer, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.disclaimer.text")); // NOI18N disclaimer.setVerticalAlignment(javax.swing.SwingConstants.TOP); + disclaimer.setMaximumSize(new java.awt.Dimension(600, 16)); + disclaimer.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; @@ -274,6 +280,7 @@ 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; @@ -302,6 +309,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -339,7 +347,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -385,6 +393,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; + gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); @@ -397,6 +406,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; licenseInfoPanel.add(licenseErrorLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); @@ -433,20 +443,14 @@ 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; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); 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); + add(malwareScansPanel, java.awt.BorderLayout.CENTER); }// //GEN-END:initComponents @Messages({ 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..9c98d8ae1b 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,12 @@ + + + + + + @@ -26,9 +32,14 @@ + + + + + - + @@ -39,10 +50,16 @@ + + + + + + - + @@ -51,6 +68,9 @@ + + + @@ -58,7 +78,7 @@ - + @@ -77,9 +97,14 @@ + + + + + - + @@ -90,6 +115,9 @@ + + + @@ -108,22 +136,30 @@ + + + - + + + + + + - + @@ -134,6 +170,12 @@ + + + + + + @@ -150,6 +192,9 @@ + + + @@ -189,7 +234,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..aa5f0bcc57 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)); + setPreferredSize(null); setLayout(new java.awt.GridBagLayout()); + incidentTextPanel.setPreferredSize(null); 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, 16)); + 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,15 @@ 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.setPreferredSize(null); 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 +220,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 +230,24 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 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.setPreferredSize(null); 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 From b0a0b5768d1cc12a6d29c0b0a87f4d11999fa7fc Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 13 Sep 2023 20:40:36 -0400 Subject: [PATCH 3/8] layout changes --- .../ctcloud/CTMalwareScannerOptionsPanel.form | 103 ++++++++++-------- .../ctcloud/CTMalwareScannerOptionsPanel.java | 91 +++++++++------- .../CTIncidentImportOptionsPanel.form | 21 +--- .../CTIncidentImportOptionsPanel.java | 7 +- 4 files changed, 116 insertions(+), 106 deletions(-) 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 b9c3961153..75138db2d4 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 @@ -5,9 +5,6 @@ - - - @@ -19,7 +16,7 @@ - + @@ -37,7 +34,7 @@ - + @@ -55,7 +52,7 @@ - + @@ -72,6 +69,11 @@ + + + + + @@ -132,36 +134,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -170,7 +142,7 @@ - + @@ -182,7 +154,7 @@ - + @@ -194,7 +166,7 @@ - + @@ -206,7 +178,7 @@ - + @@ -218,7 +190,7 @@ - + @@ -230,7 +202,7 @@ - + @@ -245,10 +217,55 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 70ce1cd1de..46c0952d0d 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 @@ -239,8 +239,6 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { licenseInfoExpiresLabel = new javax.swing.JLabel(); licenseInfoIdLabel = new javax.swing.JLabel(); licenseInfoUserLabel = new javax.swing.JLabel(); - licenseInfoAddButton = new javax.swing.JButton(); - licenseInfoRemoveButton = new javax.swing.JButton(); malwareScansMessageLabel = new javax.swing.JLabel(); maxHashLookupsLabel = new javax.swing.JLabel(); hashLookupsRemainingLabel = new javax.swing.JLabel(); @@ -248,22 +246,24 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { fileUploadsRemainingLabel = new javax.swing.JLabel(); countersResetLabel = new javax.swing.JLabel(); licenseErrorLabel = new javax.swing.JLabel(); + javax.swing.JPanel buttonPanel = new javax.swing.JPanel(); + licenseInfoAddButton = new javax.swing.JButton(); + licenseInfoRemoveButton = new javax.swing.JButton(); javax.swing.JPanel purchasePanel = new javax.swing.JPanel(); purchaseFromLabel = new javax.swing.JLabel(); purchaseLink = new javax.swing.JLabel(); setMaximumSize(new java.awt.Dimension(650, 2147483647)); - setPreferredSize(null); setLayout(new java.awt.BorderLayout()); 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.setPreferredSize(null); + malwareScansPanel.setPreferredSize(new java.awt.Dimension(650, 181)); malwareScansPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(disclaimer, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.disclaimer.text")); // NOI18N disclaimer.setVerticalAlignment(javax.swing.SwingConstants.TOP); - disclaimer.setMaximumSize(new java.awt.Dimension(600, 16)); + disclaimer.setMaximumSize(new java.awt.Dimension(600, 32)); disclaimer.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -274,6 +274,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); malwareScansPanel.add(disclaimer, gridBagConstraints); + licenseInfoPanel.setPreferredSize(null); licenseInfoPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(licenseInfoMessageLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoMessageLabel.text")); // NOI18N @@ -315,38 +316,10 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); licenseInfoPanel.add(licenseInfoUserLabel, gridBagConstraints); - org.openide.awt.Mnemonics.setLocalizedText(licenseInfoAddButton, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoAddButton.text")); // NOI18N - licenseInfoAddButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - licenseInfoAddButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 5); - licenseInfoPanel.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 = 2; - gridBagConstraints.gridy = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - licenseInfoPanel.add(licenseInfoRemoveButton, 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 = 4; + gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; @@ -356,7 +329,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 5; + gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -365,7 +338,7 @@ 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 = 5; + gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -374,7 +347,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 6; + gridBagConstraints.gridy = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); @@ -383,7 +356,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 6; + gridBagConstraints.gridy = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); @@ -392,7 +365,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 7; + gridBagConstraints.gridy = 6; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; @@ -403,12 +376,50 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { org.openide.awt.Mnemonics.setLocalizedText(licenseErrorLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseErrorLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 8; + gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; licenseInfoPanel.add(licenseErrorLabel, 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() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + 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(0, 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 = 1; + gridBagConstraints.gridheight = 6; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; + licenseInfoPanel.add(buttonPanel, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; 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 9c98d8ae1b..077c385a23 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form @@ -13,7 +13,7 @@ - + @@ -26,17 +26,12 @@ - + - - - - - @@ -51,7 +46,7 @@ - + @@ -97,11 +92,6 @@ - - - - - @@ -152,11 +142,6 @@ - - - - - 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 aa5f0bcc57..e289a55cb3 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java @@ -162,14 +162,13 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.border.title_1"))); // NOI18N setMaximumSize(new java.awt.Dimension(650, 2147483647)); - setPreferredSize(null); + setPreferredSize(new java.awt.Dimension(650, 176)); setLayout(new java.awt.GridBagLayout()); - incidentTextPanel.setPreferredSize(null); 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, 16)); + incidentTextLabel.setMaximumSize(new java.awt.Dimension(600, 32)); incidentTextLabel.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -205,7 +204,6 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.weightx = 1.0; add(incidentTextPanel, gridBagConstraints); - instructionsPanel.setPreferredSize(null); instructionsPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(instructionsTextLabel, org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.instructionsTextLabel.text")); // NOI18N @@ -242,7 +240,6 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.weightx = 1.0; add(instructionsPanel, gridBagConstraints); - repoPanel.setPreferredSize(null); repoPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(fileRepoPathLabel, org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.fileRepoPathLabel.text")); // NOI18N From cc17c1a96ba23836c129496f56356a74a6af431b Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Thu, 14 Sep 2023 09:27:32 -0400 Subject: [PATCH 4/8] changes for layout --- .../df/cybertriage/autopsy/ctoptions/CTOptionsPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 59777deb58..07d2bf8d20 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 = 750; private static final Logger logger = Logger.getLogger(CTOptionsPanel.class.getName()); From 5a6a17380e76a8490b50b5cd8407d4677bf5bf66 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Thu, 14 Sep 2023 10:27:24 -0400 Subject: [PATCH 5/8] UI updates --- .../autopsy/ctoptions/CTOptionsPanel.java | 2 +- .../ctoptions/ctcloud/Bundle.properties | 2 +- .../ctcloud/Bundle.properties-MERGED | 2 +- .../ctcloud/CTMalwareScannerOptionsPanel.form | 283 ++++++++++-------- .../ctcloud/CTMalwareScannerOptionsPanel.java | 216 ++++++------- .../CTIncidentImportOptionsPanel.form | 2 +- .../CTIncidentImportOptionsPanel.java | 2 +- 7 files changed, 270 insertions(+), 239 deletions(-) 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 07d2bf8d20..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 = 750; + private static final int MAX_SUBPANEL_WIDTH = 700; private static final Logger logger = Logger.getLogger(CTOptionsPanel.class.getName()); 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 85ee5a7663..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,8 +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 bc9fbf0a2d..d41692d048 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 @@ -63,8 +63,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/CTMalwareScannerOptionsPanel.form b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.form index 75138db2d4..7c229dd137 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 @@ -3,7 +3,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -33,13 +33,10 @@ - - - - - + + @@ -48,14 +45,15 @@ - + - + + - + @@ -69,11 +67,6 @@ - - - - - @@ -98,129 +91,30 @@ - + - - + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -228,7 +122,7 @@ - + @@ -245,7 +139,7 @@ - + @@ -266,6 +160,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 46c0952d0d..3cbad65a18 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 @@ -236,6 +236,10 @@ 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(); @@ -246,25 +250,22 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { fileUploadsRemainingLabel = new javax.swing.JLabel(); countersResetLabel = new javax.swing.JLabel(); licenseErrorLabel = new javax.swing.JLabel(); - javax.swing.JPanel buttonPanel = new javax.swing.JPanel(); - licenseInfoAddButton = new javax.swing.JButton(); - licenseInfoRemoveButton = new javax.swing.JButton(); javax.swing.JPanel purchasePanel = new javax.swing.JPanel(); purchaseFromLabel = new javax.swing.JLabel(); purchaseLink = new javax.swing.JLabel(); - setMaximumSize(new java.awt.Dimension(650, 2147483647)); - setLayout(new java.awt.BorderLayout()); + 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.setPreferredSize(new java.awt.Dimension(650, 181)); 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(600, 32)); - disclaimer.setPreferredSize(null); + 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; @@ -274,7 +275,6 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); malwareScansPanel.add(disclaimer, gridBagConstraints); - licenseInfoPanel.setPreferredSize(null); licenseInfoPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(licenseInfoMessageLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseInfoMessageLabel.text")); // NOI18N @@ -288,100 +288,16 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 + 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 = 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 - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; 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(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 = 3; - 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 = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); - licenseInfoPanel.add(maxHashLookupsLabel, gridBagConstraints); - - 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 = 4; - 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(maxFileUploadsLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.maxFileUploadsLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 5; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; - 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 = 5; - 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 = 6; - 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); - - 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 = 0; - gridBagConstraints.gridy = 7; - gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - licenseInfoPanel.add(licenseErrorLabel, gridBagConstraints); + licenseInfoPanel.add(buttonSpacer, gridBagConstraints); buttonPanel.setLayout(new java.awt.GridBagLayout()); @@ -396,7 +312,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + 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 @@ -416,10 +332,105 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; - gridBagConstraints.gridheight = 6; + gridBagConstraints.gridheight = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; licenseInfoPanel.add(buttonPanel, 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 = 2; + 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 = 2; + 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 = 3; + 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(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 = 4; + 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 = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + licenseInfoPanel.add(maxHashLookupsLabel, gridBagConstraints); + + 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 = 5; + 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(maxFileUploadsLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.maxFileUploadsLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 6; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + 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 = 6; + 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 = 7; + 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); + + 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 = 0; + gridBagConstraints.gridy = 8; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + licenseInfoPanel.add(licenseErrorLabel, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; @@ -461,7 +472,10 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); malwareScansPanel.add(purchasePanel, gridBagConstraints); - add(malwareScansPanel, java.awt.BorderLayout.CENTER); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.weightx = 1.0; + add(malwareScansPanel, gridBagConstraints); }// //GEN-END:initComponents @Messages({ 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 077c385a23..549502e0da 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form @@ -135,7 +135,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 e289a55cb3..ddda4e9078 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java @@ -229,7 +229,7 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); + gridBagConstraints.insets = new java.awt.Insets(5, 2, 5, 5); instructionsPanel.add(instructionsLinkLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); From f57eefed1527184927feab7d8873b55075f8b25b Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Thu, 14 Sep 2023 14:20:27 -0400 Subject: [PATCH 6/8] updates --- .../ctcloud/Bundle.properties-MERGED | 2 +- .../ctcloud/CTMalwareScannerOptionsPanel.form | 24 ++-- .../ctcloud/CTMalwareScannerOptionsPanel.java | 115 ++++++++---------- .../CTIncidentImportOptionsPanel.form | 15 ++- .../CTIncidentImportOptionsPanel.java | 5 +- .../malwarescan/MalwareScanIngestModule.java | 20 +-- 6 files changed, 84 insertions(+), 97 deletions(-) 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 d41692d048..537ca234f9 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 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 7c229dd137..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 @@ -109,7 +109,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -168,7 +168,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -216,7 +216,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -279,7 +279,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 3cbad65a18..e3fc7c358c 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; @@ -139,7 +138,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { this.purchaseLink.setVisible(false); } else { this.purchaseFromLabel.setVisible(true); - this.purchaseLink.setVisible(true); + this.purchaseLink.setVisible(true); } } @@ -161,7 +160,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; @@ -222,6 +221,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 @@ -293,7 +298,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { buttonSpacer.setPreferredSize(new java.awt.Dimension(5, 0)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; + gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; @@ -331,7 +336,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 1; + gridBagConstraints.gridy = 2; gridBagConstraints.gridheight = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; licenseInfoPanel.add(buttonPanel, gridBagConstraints); @@ -339,7 +344,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 2; + gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -348,7 +353,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 2; + gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -357,7 +362,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 3; + gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; @@ -367,7 +372,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 4; + gridBagConstraints.gridy = 5; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; @@ -377,7 +382,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 5; + gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -386,7 +391,7 @@ 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 = 5; + gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); @@ -395,7 +400,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 6; + gridBagConstraints.gridy = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); @@ -404,7 +409,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 6; + gridBagConstraints.gridy = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); @@ -413,7 +418,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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 = 7; + gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; @@ -424,11 +429,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { org.openide.awt.Mnemonics.setLocalizedText(licenseErrorLabel, org.openide.util.NbBundle.getMessage(CTMalwareScannerOptionsPanel.class, "CTMalwareScannerOptionsPanel.licenseErrorLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 8; + 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(5, 5, 5, 5); licenseInfoPanel.add(licenseErrorLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); @@ -484,7 +490,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); @@ -498,11 +504,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 @@ -540,22 +542,22 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { 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( @@ -658,16 +660,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())); } } @@ -700,16 +698,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"); @@ -718,41 +711,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.getErrorCode().getDescription(); } 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; @@ -778,8 +759,8 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { if (this.isCancelled()) { return null; } - - return ctApiDAO.getAuthToken(decryptedLicense); + + return ctApiDAO.getAuthToken(decryptedLicense); } @Override @@ -793,16 +774,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); - authTokenError = "" + cloudEx.getErrorDetails() + ""; + authTokenError = cloudEx.getErrorDetails(); } else { logger.log(Level.WARNING, "An error occurred while fetching data", ex); - authTokenError = "" + Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_desc() + ""; + authTokenError = Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_desc(); } } finally { synchronized (CTMalwareScannerOptionsPanel.this) { CTMalwareScannerOptionsPanel.this.authTokenFetcher = null; if (!this.isCancelled()) { - setMalwareScansDisplay(authTokenResponse, null, authTokenError); + setMalwareScansDisplay(authTokenResponse, null, htmlWrap(authTokenError)); } } } 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 549502e0da..eb0385de70 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.form @@ -12,8 +12,11 @@ + + + - + @@ -26,7 +29,7 @@ - + @@ -142,6 +145,14 @@ + + + + + + + + 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 ddda4e9078..31151c41bc 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTIncidentImportOptionsPanel.java @@ -162,7 +162,8 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CTIncidentImportOptionsPanel.class, "CTIncidentImportOptionsPanel.border.title_1"))); // NOI18N setMaximumSize(new java.awt.Dimension(650, 2147483647)); - setPreferredSize(new java.awt.Dimension(650, 176)); + 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()); @@ -240,6 +241,8 @@ public class CTIncidentImportOptionsPanel extends CTOptionsSubPanel { 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 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 4971d1b94e..c0e62f0fc0 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/malwarescan/MalwareScanIngestModule.java @@ -175,15 +175,12 @@ class MalwareScanIngestModule implements FileIngestModule { ingestJobState = getNewJobState(context, uploadFiles); } catch (CTCloudException cloudEx) { ingestJobState = IngestJobState.DISABLED; - if (cloudEx.getErrorCode() == CTCloudException.ErrorCode.INVALID_KEY) { - notifyWarning( - Bundle.MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_title(), - Bundle.MalwareScanIngestModule_ShareProcessing_startup_invalidLicenseWarning_desc(), - cloudEx); - } else { - logger.log(Level.WARNING, "An error occurred while starting the MalwareScanIngestModule.", cloudEx); - } + 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; logger.log(Level.WARNING, "An error occurred while starting the MalwareScanIngestModule.", ex); @@ -203,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()); From e9cd61953384b4dfc7eb75ef30277e87c43f0028 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Thu, 14 Sep 2023 15:04:56 -0400 Subject: [PATCH 7/8] updates to check license at autopsy startup --- .../ctcloud/Bundle.properties-MERGED | 1 + .../ctcloud/CTMalwareScannerOptionsPanel.java | 2 +- .../autopsy/ctoptions/ctcloud/Installer.java | 75 +++++++++++++++++++ .../org/sleuthkit/autopsy/core/Installer.java | 1 + 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Installer.java 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 537ca234f9..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 @@ -68,3 +68,4 @@ CTLicenseDialog.licenseNumberTextField.toolTipText=AUT-XXXXXXXX-XXXX-XXXX-XXXX-X 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/CTMalwareScannerOptionsPanel.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTMalwareScannerOptionsPanel.java index e3fc7c358c..a8c6d604d6 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 @@ -727,7 +727,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { String errMessage; if (ex.getCause() != null && ex.getCause() instanceof CTCloudException cloudEx) { logger.log(Level.WARNING, "An API error occurred while fetching license information", cloudEx); - errMessage = cloudEx.getErrorCode().getDescription(); + errMessage = cloudEx.getErrorDetails(); } else { logger.log(Level.WARNING, "An error occurred while fetching data", ex); errMessage = Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc(); 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/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index 24c40e9967..fca2db5f30 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -217,6 +217,7 @@ public class Installer extends ModuleInstall { packageInstallers.add(org.sleuthkit.autopsy.casemodule.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.modules.hashdatabase.infrastructure.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.report.infrastructure.Installer.getDefault()); + packageInstallers.add(com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud.Installer.getDefault()); /** * This is a temporary workaround for the following bug in Tika that From 3cabad12e6baf090314fbbe11bab0c86d5db967c Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Fri, 15 Sep 2023 12:45:20 -0400 Subject: [PATCH 8/8] persistence fix --- .../ctoptions/ctcloud/CTMalwareScannerOptionsPanel.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 a8c6d604d6..64db074a64 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 @@ -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 @@ -514,9 +519,9 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel { }//GEN-LAST:event_purchaseLinkMouseClicked private void licenseInfoRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_licenseInfoRemoveButtonActionPerformed - this.ctPersistence.deleteLicenseResponse(); setLicenseDisplay(null, null); setMalwareScansDisplay(null, null, null); + this.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); }//GEN-LAST:event_licenseInfoRemoveButtonActionPerformed @NbBundle.Messages({