diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties index 2d9daa4c7b..68677cb3f7 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties @@ -3,3 +3,7 @@ # Click nbfs://nbhost/SystemFileSystem/Templates/Other/properties.properties to edit this template OptionsCategory_Name_CyberTriage=CyberTriage OptionsCategory_Keywords_CyberTriage=CyberTriage,Cyber,Triage +LicenseDisclaimerPanel.disclaimer.text=The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a non-free license to use. +LicenseDisclaimerPanel.purchaseFromLabel.text=You can purchase a license from +LicenseDisclaimerPanel.link.text=https://cybertriage.com/autopsy-checkout +LicenseDisclaimerPanel.border.title=Disclaimer diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties-MERGED b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties-MERGED index 2d9daa4c7b..68677cb3f7 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties-MERGED +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/Bundle.properties-MERGED @@ -3,3 +3,7 @@ # Click nbfs://nbhost/SystemFileSystem/Templates/Other/properties.properties to edit this template OptionsCategory_Name_CyberTriage=CyberTriage OptionsCategory_Keywords_CyberTriage=CyberTriage,Cyber,Triage +LicenseDisclaimerPanel.disclaimer.text=The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a non-free license to use. +LicenseDisclaimerPanel.purchaseFromLabel.text=You can purchase a license from +LicenseDisclaimerPanel.link.text=https://cybertriage.com/autopsy-checkout +LicenseDisclaimerPanel.border.title=Disclaimer 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 24d78897e2..6eb72dd73e 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 = 500; + private static final int MAX_SUBPANEL_WIDTH = 650; private static final Logger logger = Logger.getLogger(CTOptionsPanel.class.getName()); @@ -65,10 +65,21 @@ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { .filter(item -> item != null) .sorted(Comparator.comparing(p -> p.getClass().getSimpleName().toUpperCase())) .collect(Collectors.toList()); - addSubOptionsPanels(this.subPanels); + addSubOptionsPanels(new LicenseDisclaimerPanel(), this.subPanels); } - private void addSubOptionsPanels(List subPanels) { + private void addSubOptionsPanels(JPanel disclaimerPanel, 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; + + contentPane.add(disclaimerPanel, disclaimerConstraints); + for (int i = 0; i < subPanels.size(); i++) { CTOptionsSubPanel subPanel = subPanels.get(i); @@ -83,10 +94,10 @@ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = i; + gridBagConstraints.gridy = i + 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(i == 0 ? 5 : 0, 5, 5, 5); + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); gridBagConstraints.weighty = 0; gridBagConstraints.weightx = 0; @@ -95,7 +106,7 @@ public class CTOptionsPanel extends IngestModuleGlobalSettingsPanel { GridBagConstraints verticalConstraints = new GridBagConstraints(); verticalConstraints.gridx = 0; - verticalConstraints.gridy = subPanels.size(); + verticalConstraints.gridy = subPanels.size() + 1; verticalConstraints.weighty = 1; verticalConstraints.weightx = 0; diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/LicenseDisclaimerPanel.form b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/LicenseDisclaimerPanel.form new file mode 100644 index 0000000000..83e3c8440a --- /dev/null +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/LicenseDisclaimerPanel.form @@ -0,0 +1,117 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/LicenseDisclaimerPanel.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/LicenseDisclaimerPanel.java new file mode 100644 index 0000000000..ffd3760e6f --- /dev/null +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/LicenseDisclaimerPanel.java @@ -0,0 +1,128 @@ +/* + * 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; + +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import org.sleuthkit.autopsy.coreutils.Logger; + +/** + * Disclaimer for license and place to purchase CT license. + */ +public class LicenseDisclaimerPanel extends javax.swing.JPanel { + private static final Logger LOGGER = Logger.getLogger(LicenseDisclaimerPanel.class.getName()); + + private static final String CHECKOUT_PAGE_URL = "https://cybertriage.com/autopsy-checkout"; + + /** + * Creates new form LicenseDisclaimerPanel + */ + public LicenseDisclaimerPanel() { + initComponents(); + } + + /** + * 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 + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; + + javax.swing.JLabel disclaimer = new javax.swing.JLabel(); + javax.swing.JLabel purchaseFromLabel = new javax.swing.JLabel(); + javax.swing.JLabel link = new javax.swing.JLabel(); + javax.swing.JPanel spacer = new javax.swing.JPanel(); + + setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.border.title"))); // NOI18N + setMaximumSize(new java.awt.Dimension(2147483647, 90)); + setMinimumSize(new java.awt.Dimension(562, 90)); + setPreferredSize(new java.awt.Dimension(400, 90)); + setLayout(new java.awt.GridBagLayout()); + + org.openide.awt.Mnemonics.setLocalizedText(disclaimer, org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.disclaimer.text")); // NOI18N + disclaimer.setVerticalAlignment(javax.swing.SwingConstants.TOP); + 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); + add(disclaimer, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(purchaseFromLabel, org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.purchaseFromLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 3); + add(purchaseFromLabel, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(link, org.openide.util.NbBundle.getMessage(LicenseDisclaimerPanel.class, "LicenseDisclaimerPanel.link.text")); // NOI18N + link.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + link.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + linkMouseClicked(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 5); + add(link, gridBagConstraints); + + javax.swing.GroupLayout spacerLayout = new javax.swing.GroupLayout(spacer); + spacer.setLayout(spacerLayout); + spacerLayout.setHorizontalGroup( + spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + spacerLayout.setVerticalGroup( + spacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.weighty = 1.0; + add(spacer, gridBagConstraints); + }// //GEN-END:initComponents + + private void linkMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_linkMouseClicked + if (Desktop.isDesktopSupported()) { + try { + Desktop.getDesktop().browse(new URI(CHECKOUT_PAGE_URL)); + } catch (IOException | URISyntaxException e) { + /* TODO: error handling */ } + } else { + /* TODO: error handling */ + } + }//GEN-LAST:event_linkMouseClicked + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +}