Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-3130

Investigate trust following certificate modal

    Details

      Description

      Situation: A user reported a problem with IGB on Windows where they were unable to interact with the "Trust following certificate" modal that appeared. Because they were unable to interact with the modal, the user was unable to use IGB.

      Task: Reproduce the issue on Windows and investigate why the modal is unable to be interacted with.

        Attachments

          Issue Links

            Activity

            nfreese Nowlan Freese created issue -
            nfreese Nowlan Freese made changes -
            Field Original Value New Value
            Epic Link IGBF-1765 [ 17855 ]
            nfreese Nowlan Freese made changes -
            Link This issue relates to IGBF-3128 [ IGBF-3128 ]
            nfreese Nowlan Freese made changes -
            Link This issue relates to IGBF-2370 [ IGBF-2370 ]
            Hide
            nfreese Nowlan Freese added a comment - - edited

            To view the modal popup consistently you need to modify the code in IGBTrustManager.java checkServerTrusted() so that the modal appears every time a certificate is authenticated.

            For example:

                public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
            
                    StringBuilder certificates = new StringBuilder("\n\n");
                    IGB app = IGB.getInstance();
                    for (X509Certificate cert : certs) {
                        certificates.append(cert.getIssuerX500Principal().getName()).append(",").append("\n");
                    }
                    JComponent comp = (app == null) ? null : app.getFrame().getRootPane();
            //        try {
                        //kiran:IGBF-1362: First try to validate the certificate using the default trust store
            //            defaultTm.checkServerTrusted(certs,authType);
                        logger.info("Authenticated {} certificates using default trust store",certificates.toString().replace("\n", "").replace("\r", ""));
            //        } catch (CertificateException e) {
                        //if certificate not found then ask the user to validate the certificate
                        boolean response = ModalUtils.confirmPanel(comp, "Trust following certificate? " + certificates.toString(),
                                PreferenceUtils.getCertificatePrefsNode(), certificates.toString(), true, "Do not show this again for the publisher above");
            
                        if (!response) {
                            throw new RuntimeException("Untrusted certificate.");
                        }
            //        }
                }
            
            Show
            nfreese Nowlan Freese added a comment - - edited To view the modal popup consistently you need to modify the code in IGBTrustManager.java checkServerTrusted() so that the modal appears every time a certificate is authenticated. For example: public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) { StringBuilder certificates = new StringBuilder( "\n\n" ); IGB app = IGB.getInstance(); for (X509Certificate cert : certs) { certificates.append(cert.getIssuerX500Principal().getName()).append( "," ).append( "\n" ); } JComponent comp = (app == null ) ? null : app.getFrame().getRootPane(); // try { //kiran:IGBF-1362: First try to validate the certificate using the default trust store // defaultTm.checkServerTrusted(certs,authType); logger.info( "Authenticated {} certificates using default trust store" ,certificates.toString().replace( "\n" , "").replace(" \r ", " ")); // } catch (CertificateException e) { // if certificate not found then ask the user to validate the certificate boolean response = ModalUtils.confirmPanel(comp, "Trust following certificate? " + certificates.toString(), PreferenceUtils.getCertificatePrefsNode(), certificates.toString(), true , "Do not show this again for the publisher above" ); if (!response) { throw new RuntimeException( "Untrusted certificate." ); } // } }
            Hide
            nfreese Nowlan Freese added a comment - - edited

            What calls the checkServerTrusted() method?

            Answer: See comment below.

            Is it called when App Store apps are loaded, or just when Quickloads or genome data are loaded?

            Answer: When loading Apps from the App Manager the certificates are checked through checkServerTrusted(). So any modifications of checkServerTrusted() will need to test the App Manager as well.

            Show
            nfreese Nowlan Freese added a comment - - edited What calls the checkServerTrusted() method? Answer: See comment below. Is it called when App Store apps are loaded, or just when Quickloads or genome data are loaded? Answer: When loading Apps from the App Manager the certificates are checked through checkServerTrusted(). So any modifications of checkServerTrusted() will need to test the App Manager as well.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            If the user selects "No" in the modal, is the quickload data still made available?

            Answer: The data are not made available and a "java.lang.RuntimeException: Untrusted certificate" is thrown. So this appears to be working correctly.

            Show
            nfreese Nowlan Freese added a comment - - edited If the user selects "No" in the modal, is the quickload data still made available? Answer: The data are not made available and a "java.lang.RuntimeException: Untrusted certificate" is thrown. So this appears to be working correctly.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Can you interact with the modal on a Windows machine?

            Answer: Yes, see comment below, we were unable to replicate this issue.

            Show
            nfreese Nowlan Freese added a comment - - edited Can you interact with the modal on a Windows machine? Answer: Yes, see comment below, we were unable to replicate this issue.
            Hide
            nfreese Nowlan Freese added a comment -

            Idea from Karthik: Mark Data Sources in the Data Sources tab of the Preferences window that have issues with their certificates. We could include additional information in the info modal (click on the i next to the data source). When a user adds a new quickload we could check the certs and display a modal if there is an issue with the certs (somewhat unclear, but it appears that new quickload certs are only checked when the user selects a genome).

            Show
            nfreese Nowlan Freese added a comment - Idea from Karthik: Mark Data Sources in the Data Sources tab of the Preferences window that have issues with their certificates. We could include additional information in the info modal (click on the i next to the data source). When a user adds a new quickload we could check the certs and display a modal if there is an issue with the certs (somewhat unclear, but it appears that new quickload certs are only checked when the user selects a genome).
            Hide
            nfreese Nowlan Freese added a comment - - edited

            What calls checkServerTrusted()?

            Quickload data added by user
            QuickloadUtils.java getGenomeVersionData() > isValidRepositoryUrl(annotsXmlUrl) -> isValidRepository() -> AnnotsURL.openConnection()).getResponseCode() - this makes a call to checkServerTrusted()

            IGB App Manager
            BundleActionManager.java isInternetReachable() -> urlConnect.getContent() - this makes a call to checkServerTrusted()
            BundleActionManager.java installBundle() -> resolver.deploy(Resolver.START) - this makes a call to checkServerTrusted()

            Show
            nfreese Nowlan Freese added a comment - - edited What calls checkServerTrusted()? Quickload data added by user QuickloadUtils.java getGenomeVersionData() > isValidRepositoryUrl(annotsXmlUrl) -> isValidRepository() -> AnnotsURL.openConnection()).getResponseCode() - this makes a call to checkServerTrusted() IGB App Manager BundleActionManager.java isInternetReachable() -> urlConnect.getContent() - this makes a call to checkServerTrusted() BundleActionManager.java installBundle() -> resolver.deploy(Resolver.START) - this makes a call to checkServerTrusted()
            Hide
            nfreese Nowlan Freese added a comment -

            If we do keep the current modal in checkServerTrusted() it may be worth changing or adding the following line:

            certificates.append(cert.getIssuerX500Principal().getName()).append(",").append("\n");

            to

            certificates.append(cert.getSubjectX500Principal().getName()).append(",").append("\n");

            The modal is less cryptic as the "Subject" includes the website address associated with the certificate. For example, this quickload https://data.cyverse.org/dav-anon/iplant/home/shared/BioViz/rnaseq asks if it is okay to trust the certificate from *.cyverse.org.

            Show
            nfreese Nowlan Freese added a comment - If we do keep the current modal in checkServerTrusted() it may be worth changing or adding the following line: certificates.append(cert.getIssuerX500Principal().getName()).append( "," ).append( "\n" ); to certificates.append(cert.getSubjectX500Principal().getName()).append( "," ).append( "\n" ); The modal is less cryptic as the "Subject" includes the website address associated with the certificate. For example, this quickload https://data.cyverse.org/dav-anon/iplant/home/shared/BioViz/rnaseq asks if it is okay to trust the certificate from *.cyverse.org.
            karthik Karthik Raveendran made changes -
            Status To-Do [ 10305 ] In Progress [ 3 ]
            Hide
            nfreese Nowlan Freese added a comment -

            Testing with Karthik on Windows 11 was unable to replicate the issue where the modal became unresponsive to input from the user.

            Show
            nfreese Nowlan Freese added a comment - Testing with Karthik on Windows 11 was unable to replicate the issue where the modal became unresponsive to input from the user.
            Hide
            nfreese Nowlan Freese added a comment -

            Currently, the default Quickloads included in igbDefaultPrefs.json do not have their certs checked until a genome is loaded that includes data from the Quickload.

            Show
            nfreese Nowlan Freese added a comment - Currently, the default Quickloads included in igbDefaultPrefs.json do not have their certs checked until a genome is loaded that includes data from the Quickload.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Proposed ideal business logic:

            1. # User starts IGB.
            2. As IGB starts, default Quickloads are checked for valid certs.
              1. During IGB startup, if a cert is not valid, that Quickload’s (or DAS) cert is marked as invalid (and stored somewhere that we can retrieve the status of).
                1. Where are the Quickload statuses stored (data provider manager)?
                2. Question, are the default Quickloads stored with the user added Quickloads?
            3. User navigates to the Data Sources tab of the Preferences window.
            4. IGB retrieves status of the available Quickloads, including previously added user quickloads and IGB default quickloads.
            5. Any Quickload that is marked as having an invalid cert is highlighted (orange?).
            6. User adds new Quickload that includes https.
            7. IGB checks if Quickload is reachable.
            8. IGB checks if cert is valid.
              1. Cert is valid.
                1. IGB completes process of further validating and then adding Quickload as new data source.
              2. Cert is invalid.
                1. Modal appears informing user that cert is invalid and asking user if they would still like to add the Quickload.
                  1. User wants to add Quickload that has invalid cert.
                    1. IGB completes process of further validating and then adding Quickload as new data source.
                    2. The new Quickload is highlighted (orange?).
                  2. User does not want to add Quickload that has invalid cert.
                    1. The Quickload is removed from the Data Sources tab.
            • Clicking the ouroborus (refresh) icon in the Data Sources tab will check the status of the cert.
            • Clicking the i icon in the Data Sources tab will include information on the status of the cert, the issuer, and the subject.
            • If a user has opted to use a Quickload with invalid certs, no modal will appear when they select a genome.
            • If a default Quickload has invalid certs, no modal will appear when they select a genome.
            • If an app installed through the IGB App Manager has invalid certs, the modal will appear.
            • Nowlan: Investigate how IGBTrustManager works with DAS.
            • Karthik: Investigate getting rid of IGBTrustManager.
            Show
            nfreese Nowlan Freese added a comment - - edited Proposed ideal business logic: # User starts IGB. As IGB starts, default Quickloads are checked for valid certs. During IGB startup, if a cert is not valid, that Quickload’s (or DAS) cert is marked as invalid (and stored somewhere that we can retrieve the status of). Where are the Quickload statuses stored (data provider manager)? Question, are the default Quickloads stored with the user added Quickloads? User navigates to the Data Sources tab of the Preferences window. IGB retrieves status of the available Quickloads, including previously added user quickloads and IGB default quickloads. Any Quickload that is marked as having an invalid cert is highlighted (orange?). User adds new Quickload that includes https. IGB checks if Quickload is reachable. IGB checks if cert is valid. Cert is valid. IGB completes process of further validating and then adding Quickload as new data source. Cert is invalid. Modal appears informing user that cert is invalid and asking user if they would still like to add the Quickload. User wants to add Quickload that has invalid cert. IGB completes process of further validating and then adding Quickload as new data source. The new Quickload is highlighted (orange?). User does not want to add Quickload that has invalid cert. The Quickload is removed from the Data Sources tab. Clicking the ouroborus (refresh) icon in the Data Sources tab will check the status of the cert. Clicking the i icon in the Data Sources tab will include information on the status of the cert, the issuer , and the subject . If a user has opted to use a Quickload with invalid certs, no modal will appear when they select a genome. If a default Quickload has invalid certs, no modal will appear when they select a genome. If an app installed through the IGB App Manager has invalid certs, the modal will appear. Nowlan: Investigate how IGBTrustManager works with DAS. Karthik: Investigate getting rid of IGBTrustManager.
            Hide
            ann.loraine Ann Loraine added a comment -

            Suggestion: You could test getting rid of the IGBTrustManager using the old expired bioviz certificate.

            Show
            ann.loraine Ann Loraine added a comment - Suggestion: You could test getting rid of the IGBTrustManager using the old expired bioviz certificate.
            Hide
            ann.loraine Ann Loraine added a comment -

            On Friday scrum, NF and AL recalled an additional instance of IGB over-riding a base Java function related to opening SSL connections. Now linked to the ticket: IGBF-3001

            Show
            ann.loraine Ann Loraine added a comment - On Friday scrum, NF and AL recalled an additional instance of IGB over-riding a base Java function related to opening SSL connections. Now linked to the ticket: IGBF-3001
            ann.loraine Ann Loraine made changes -
            Link This issue relates to IGBF-3001 [ IGBF-3001 ]
            ann.loraine Ann Loraine made changes -
            Sprint Summer 2 2022 June 6 [ 148 ] Summer 2 2022 June 6, Summer 3 2022 June 20 [ 148, 149 ]
            ann.loraine Ann Loraine made changes -
            Rank Ranked higher
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            BioViz Test host https://bioviztest3.bioviz.org/ is up and running with expired "start" bioviz.org certificate installed, along with the DigiCert server chain certificate previously installed.

            Show
            ann.loraine Ann Loraine added a comment - - edited BioViz Test host https://bioviztest3.bioviz.org/ is up and running with expired "start" bioviz.org certificate installed, along with the DigiCert server chain certificate previously installed.
            Hide
            nfreese Nowlan Freese added a comment -

            After discussion between Nowlan and Karthik, the current approach will be to remove the modal from the IGBTrustManager and add the modal logic to the App Store specifically, as well as improve the logic for informing the user that a Quickload's certificates are invalid.

            Show
            nfreese Nowlan Freese added a comment - After discussion between Nowlan and Karthik, the current approach will be to remove the modal from the IGBTrustManager and add the modal logic to the App Store specifically, as well as improve the logic for informing the user that a Quickload's certificates are invalid.
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            AL: Suggests get rid of modal, print to log instead for everything. Observe and document effects when an App Store jar file is being accessed or downloaded from a host with a bogus SSL certificate. You can probably observe the latter behavior by setting up a repository.xml that directs IGB to download 'jar' from an https URL that's bogus due to expired or non-existent certificate.

            Show
            ann.loraine Ann Loraine added a comment - - edited AL: Suggests get rid of modal, print to log instead for everything. Observe and document effects when an App Store jar file is being accessed or downloaded from a host with a bogus SSL certificate. You can probably observe the latter behavior by setting up a repository.xml that directs IGB to download 'jar' from an https URL that's bogus due to expired or non-existent certificate.
            nfreese Nowlan Freese made changes -
            Link This issue relates to IGBF-3136 [ IGBF-3136 ]
            nfreese Nowlan Freese made changes -
            Status In Progress [ 3 ] Needs 1st Level Review [ 10005 ]
            nfreese Nowlan Freese made changes -
            Status Needs 1st Level Review [ 10005 ] First Level Review in Progress [ 10301 ]
            nfreese Nowlan Freese made changes -
            Assignee Karthik Raveendran [ karthik ] Nowlan Freese [ nfreese ]
            nfreese Nowlan Freese made changes -
            Link This issue relates to IGBF-3137 [ IGBF-3137 ]
            nfreese Nowlan Freese made changes -
            Link This issue relates to IGBF-3138 [ IGBF-3138 ]
            Hide
            nfreese Nowlan Freese added a comment -

            After discussion we have decided to close this ticket and open the following tickets:

            IGBF-3136 - This ticket will remove the modal from IGBTrustManager checkServerTrusted(). If a certificate is invalid, checkServerTrusted() will print the certificate information in the IGB log.
            IGBF-3137 - This ticket will migrate the modal logic used in IGBTrustManager to the IGB App Manager. If a certificate is invalid the user will be presented with the option of trusting or rejecting the certificate.
            IGBF-3138 - This ticket will investigate the role of the Update plugin in IGB on checking for updated versions of IGB on startup.

            Show
            nfreese Nowlan Freese added a comment - After discussion we have decided to close this ticket and open the following tickets: IGBF-3136 - This ticket will remove the modal from IGBTrustManager checkServerTrusted(). If a certificate is invalid, checkServerTrusted() will print the certificate information in the IGB log. IGBF-3137 - This ticket will migrate the modal logic used in IGBTrustManager to the IGB App Manager. If a certificate is invalid the user will be presented with the option of trusting or rejecting the certificate. IGBF-3138 - This ticket will investigate the role of the Update plugin in IGB on checking for updated versions of IGB on startup.
            nfreese Nowlan Freese made changes -
            Status First Level Review in Progress [ 10301 ] Ready for Pull Request [ 10304 ]
            nfreese Nowlan Freese made changes -
            Status Ready for Pull Request [ 10304 ] Pull Request Submitted [ 10101 ]
            nfreese Nowlan Freese made changes -
            Status Pull Request Submitted [ 10101 ] Reviewing Pull Request [ 10303 ]
            nfreese Nowlan Freese made changes -
            Status Reviewing Pull Request [ 10303 ] Merged Needs Testing [ 10002 ]
            nfreese Nowlan Freese made changes -
            Status Merged Needs Testing [ 10002 ] Post-merge Testing In Progress [ 10003 ]
            nfreese Nowlan Freese made changes -
            Resolution Done [ 10000 ]
            Status Post-merge Testing In Progress [ 10003 ] Closed [ 6 ]
            nfreese Nowlan Freese made changes -
            Fix Version/s 9.1.10 Major Release [ 10700 ]
            nfreese Nowlan Freese made changes -
            Issue Type Task [ 3 ] Bug [ 1 ]

              People

              • Assignee:
                nfreese Nowlan Freese
                Reporter:
                nfreese Nowlan Freese
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: