Hub Email Extension


This plugin is no longer maintained. Official support for this implementation ended on 5/31/2018.

Version 1.3.2


Hub Email Extension overview

The Black Duck Hub Email Extension runs independently from the Hub and provides additional functionality. It automatically sends email alerts and information that you need to know, based on your preferences.
Triggering events in the Hub generate an email alert. You can specify the triggering events, based on your personal preferences and workflow needs. Emails can be sent:

  • Individually in real-time.
  • Collectively in a daily digest format.
  • Collectively in a digest, based on your custom schedule configuration.

As a Hub user, the Hub Email Extension enables you to:

  • Select the email notifications you want to receive, based on your selected triggering events.
  • Opt in or opt out of email notifications.
  • Receive daily email digests of triggering event notifications.
  • Receive real-time emails of triggering event notifications.
  • Customize the email template to fit your workflow needs.
  • Add your company logo to notification emails.   

After installing and configuring the Hub Email Extension, email digests are automatically sent to all users opted-in for email notifications. No further user interaction is required. You can change the global configuration as needed, and you can edit your personal preferences at any time.

Downloading the Hub Email Extension

The Hub Email Extension installer is available as a .zip file at GitHub. Download the .zip file, and then install as follows.


To download the Hub Email Extension installer:

  1. Navigate to the Git Hub download page at at https://github.com/blackducksoftware/hub-email-extension
  2. Download the file hub-email-extension-version_number.zip

Installing the Hub Email Extension

The following installation routine is for a Dockerized environment.  To install in a non-Dockerized environment, refer to Installing the Hub Email Extension in a non-Dockerized Environment.

Dockerized Hub Email Extension installation

To install the Hub Email Extension in a Dockerized environment (Black Duck Hub versions 3.7, 4.1.0, and higher), use the following procedure.

Hub Email Extension is not compatible with Black Duck Hub version 4.0.0.

Prerequisites

  1. An environment running Hub versions 4.1.0, or higher, with Docker.
  2. Java version 8.  This is included in the Docker image.
  3. The Hub cannot be running during the installation of the Hub Email Extension.  Stop the Hub using the command:

    docker-compose -p hub down

Configure

Update the docker-compose.yml file to include the email extension.  Add the following section to the docker-compose.yml file after the webserver: section and before the volumes: section.

Be sure to change the <version> tag to the appropriate version of the email extension image.  For example, 1.2.0 or 1.2.0-SNAPSHOT

hub-email-extension:
	  links: [webapp, cfssl]      
	  image: blackducksoftware/hub-email-extension:<version>
      container_name: hub-email-extension
      ports: ['55000:55000']
	  volumes: ['email-extension-config-volume:/opt/blackduck/extensions']
      env_file: [hub-webserver.env]

At the end of the docker-compose.yml file, you must modify the existing volume list and add the newly created email-extension-config-volume.  Add the following lines to your docker-compose.yml file.

volumes: {data-volume: null, cert-volume: null, config-volume: null, log-volume: null,
webserver-volume: null, webapp-volume: null, search-volume: null, email-extension-config-volume: null}

Proxy settings

If using a proxy, include the following:

hub-email-extension:
	  links: [webapp, cfssl]      
	  image: blackducksoftware/hub-email-extension:<version>
      container_name: hub-email-extension
      ports: ['55000:55000']
	  volumes: ['email-extension-config-volume:/opt/blackduck/extensions']
      env_file: [hub-webserver.env, hub-proxy.env]

Double-proxy environments

Running the Hub Email Extension in an environment wherein your Hub instance is behind a proxy, and your email server is also behind a proxy is not currently supported. This functionality will be added in a future version of the Hub Email Extension.

Installing in a non-Docker or non-Hub environment

Certificate import

Auto import

The certificate is imported automatically by the docker-entrypoint.sh file.  If the import fails, the Docker log <email_extension_container_id> displays log messages for importing the certificate.  If an error occurred, then the error messages display in the log at the startup of the container.

Manual import

If the auto import fails, you can perform a manual import of the certificate as follows.

  1. Disable the auto-import feature.
  2. Copy the certificate into the email extension container.
  3. Execute a shell in the email extension container.
  4. Import the certificate.

Disabling the auto import feature

Stop the Hub using the following command.

docker-compose -file docker-compose.yml -p hub down
Edit the compose file as follows.
hub_email_extension:
    links: [webapp, cfssl]
    image: blackducksoftware/hub-email-extension:1.2.2-SNAPSHOT
    container_name: hub-email-extension
    ports: ['55000:55000']
    volumes: ['email-extension-config-volume:/opt/blackduck/extensions']
    env_file: [hub-webserver.env]
    environment: {EMAIL_EXT_IMPORT_CERT=false}

Starting the Hub

After configuring the docker-compose.yml file to include the email extension, you must start the Hub.  To start the Hub, execute the following command:

docker-compose -f docker-compose.yml -p hub up -d

When you start the Hub, you may see log messages for the Hub containers in the command line window.

Copying the certificate

Use the following command to copy the certificate.  Replace <certificate file> with your certificate path, and replace <container_id> with the email extensions ID.  <dest_path> is your selected location in the container.

docker cp <certificate_file> <container_id>:<dest_path>

Execute the shell into the container

Use the following command to execute the shell into the container.  Replace <container_id> with the email extensions ID.

docker exec -it <container_id> /bin/sh

Importing the certificate into local JAVA_HOME

Execute the following command to import the Hub certificate into the cacerts file of the email extension container.  Double-click to select the entire code example for copying and pasting.  Make sure you fit the entire command on a single line prior to executing.  Note that the <file_copied> property is the file named in the certificate copy step.  For <publichubwebserver>, you can use the default name, or supply your own.  Supplying your own can be helpful in case auto-import is accidentally enabled. 

If the line environment: {EMAIL_EXT_IMPORT_CERT=false} is omitted, or if the value is true, auto-import is enabled.



keytool -importcert -file <file_copied> -keystore "$JAVA_HOME/lib/security/cacerts" -storepass changeit -alias <publichubwebserver or custom name> -noprompt' -v


If you change the certificate on the Hub server, you must update the publichubwebserver. This is accomplished using keytool -delete to remove the certificate with the publichubwebserver alias from the email extension container.


Always trust server certificate

 When running Hub Email Extension, you must import the proper certificate into your Java. Oherwise, a PKIX error is generated. You can implicitly trust all certificates using the following configuration.

This is a convenience feature, and your certificates should be imported by your administrator. Black Duck recommends that you configure certificates based on your specific environment.

Use the following steps:

  1. Stop the Hub.
  2. Edit the compose file.
  3. Start the Hub.

Stopping the Hub

Use the following command to stop the Hub.

docker-compose -file docker-compose.yml -p hub down

Editing the compose file

Use the following to edit the compose file.

hub_email_extension:
    links: [webapp, cfssl]
    image: blackducksoftware/hub-email-extension:1.2.2-SNAPSHOT
    container_name: hub-email-extension
    ports: ['55000:55000']
    volumes: ['email-extension-config-volume:/opt/blackduck/extensions']
    env_file: [hub-webserver.env, hub-proxy.env]
    environment: { EMAIL_EXT_IMPORT_CERT=false, EXTENSION_ALWAYS_TRUST_SERVER_CERTIFICATE=true }

This is a convenience feature, and your certificates should be imported by your administrator. Black Duck recommends that you configure certificates based on your specific environment.


Starting the Hub

Use the following command to start the Hub.

docker-compose -file docker-compose.yml -p hub up -d


Updating the SSL certificate

If the email extension is to be run with an SSL certificate, the procedure to update the certificates is the same.  Follow the Configuring for SSL section in this documentation.  However, you must use a command line on the container to execute the required commands.  Use docker exec to open a command line in the email extension container.  Then, execute the following steps.

  1. Use the command user docker cp to copy the certificate files to the email extension container.
  2. Use the command user docker cp user docker exec to open a command line prompt to follow the steps in the Configuring for SSL section.

Configuring the Hub Email Extension through the Hub UI

Configure the Hub Email Extension in your Dockerized environment as follows.

  1. Add the email extension to the Hub with the URL: http://hub-email-extension:55000
  2. Note that this URL may not work correctly, depending on your network environment. If you encounter issues, use the FQDN to add the extension. The FQDN is the same hostname used to access the Hub UI.
  3. Then, configure the Hub Email Extension through the Hub UI.  This process is described in the topics Basic Configuration of the Hub Email Extension and Advanced Configuration of the Hub Email Extension, located below in this documentation.

Cannot authorize the Email Extension

If you can add the Hub Email Extension, but cannot authorize it, then the Docker network may have failed after the IP table service is restarted, which is described here: https://github.com/moby/moby/issues/12294.  This usually manifests as an unknown host exception in the hub-webapp container when trying to communicate with the email extension container, and is related to the IP table rules on the Docker bridge network. To address the issue, incoming traffic from the Docker bridge must be allowed where the destination port is 443/tcp and 55000/tcp. 

There are two approaches to address the issue.  Choose the approach that best fits your IT security policies.

  1. Allow traffic to those ports coming from any network interface:

    iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT 
    iptables -I INPUT 1 -p tcp --dport 55000 -j ACCEPT
    
  2. Allow traffic coming from the Docker bridge: 

    iptables -I INPUT 1 -i <docker_bridge_NIC> -j ACCEPT

Creating email extension-named volumes

Use the following code to create email extension-named volumes.

hub-email-extension:
image: blackducksoftware/hub-email-extension:<version>
depends_on: [webapp]
container_name: hub-email-extension
ports: ['55000:55000']
volumes: ['email-extension-config-volume:/opt/blackduck/extensions']
env_file: hub-webserver.env

Upgrading the Hub Email Extension

To upgrade your existing version of the Hub Email Extension, use the following procedure.

  1. Login to the Hub, and navigate to Administration > Extensions.
  2. Delete the currently-installed Hub Email Extension.
  3. Download the current version of the Hub Email Extension.
  4. Follow the appropriate installation procedure to install the new version of the Hub Email Extension:
    1. Dockerized Hub Email Extension installation
    2. Installing the Hub Email Extension in a non-Dockerized Environment

Basic configuration of the Hub Email Extension

The following topics are configuration procedures that must be performed for both Hub server and non-Hub system environments.

Updating the extension properties file

You must configure the extension. The first step is to select an available port. By default, the extension contains port 8000 in its URL. However, based on your environment, this port may not be available.


Check port numbers
For more information on TCP and UDP port numbers, refer to https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.
To check the port number:

  1. Switch to the root user by using the command su.
  2. Get the list of ports in use by using the command netstat -nap.
  3. Check if the intended port is in use.
  4. Switch back to the original user by using the command exit.

To avoid collisions with known ports, port number 55000 will be used.

Updating the URL

Next, change the URL for the email extension to match the server name used to access the Hub. Change the port to 55000.
To edit the file:

  1. Execute the command: 

    vi /opt/blackduck/extensions/hub-email-extension-<version>/config/extension.properties
  2. Find the hub.extension.url property:

    hub.extension.url=http\//:localhost\:8000
  3. Edit the URL so that the host name matches the host name used to access the Hub, and change the port number to 55000:

    hub.extension.url=http://hub.server.url:55000
  4. Save the changes to extension.properties.

Configuring for SSL

To configure the email extension to run over Secure Socket Layers (SSL), then the extension.properties file must be configured to be aware of the certificate in use. If the Hub server is running over SSL, then the certificate for Hub communication over SSL can be used here as well.
Prerequisites:

  • The certificate to use must be on the file system of the Hub server, and have read access by the user.
  • The password for the certificate keystore.
  • The password for the private key used with the keystore.
  • The type of keystore (PKCS12 or JKS).

To configure for SSL:

  1. Execute the command: 

    vi /opt/blackduck/extensions/hub-email-extension-<version>/config/extension.properties.
  2. Locate the following section for SSL configuration:

    # HTTPS optional config
    hub.extension.ssl.keyStorePath= 
    hub.extension.ssl.keyStorePassword= 
    hub.extension.ssl.keyPassword= 
    hub.extension.ssl.keyStoreType=
  3. Edit the path to the certificate file:

    # HTTPS optional config
    hub.extension.ssl.keyStorePath=/opt/blackduck/install/certificate.pkcs12
    hub.extension.ssl.keyStorePassword= 
    hub.extension.ssl.keyPassword= 
    hub.extension.ssl.keyStoreType=
  4. Edit the keystore password:

    # HTTPS optional config
    hub.extension.ssl.keyStorePath=/opt/blackduck/install/certificate.pkcs12 
    hub.extension.ssl.keyStorePassword=keystorepassword 
    hub.extension.ssl.keyPassword= 
    hub.extension.ssl.keyStoreType=
  5. Edit the key password. Note that for PKCS12 keystores, the keystore password and the key password are the same.

    # HTTPS optional config
    hub.extension.ssl.keyStorePath=/opt/blackduck/install/certificate.pkcs12
    hub.extension.ssl.keyStorePassword=keystorepassword
    hub.extension.ssl.keyPassword=keystorepassword 
    hub.extension.ssl.keyStoreType=
  6. Edit the keystore type:

    # HTTPS optional config
    hub.extension.ssl.keyStorePath=/opt/blackduck/install/certificate.pkcs12
    hub.extension.ssl.keyStorePassword=keystorepassword
    hub.extension.ssl.keyPassword=keystorepassword 
    hub.extension.ssl.keyStoreType=PKCS12
  7. Save and close the extension.properties file.

After this is configured, you can start the Hub Email Extension.

Testing your installation

At this point, the Hub Email Extension should be configured such that it can be started. Run the email_extension.sh script file as the original user.
Use the following commands for testing your configuration.

  • Starting the extension:

    /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh start
  • Stopping the extension:

    /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh stop
  • Checking the status:

    /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh status

Checking the logs

If the start command doesn't report a pid number, then the Hub Email Extension configuration may be wrong; specifically permissions on folders. Refer to the logs for more details.
Check the log file at: /opt/blackduck/extensions/hub-email-extension-<version>/logs.
The first time the extension starts, the log contains the following message:

09:28:27.362 [main] ERROR com.blackducksoftware.integration.email.EmailEngine - Error Starting Email Engine java.lang.IllegalStateException: No token present to refresh 
at com.blackducksoftware.integration.email.extension.server.oauth.TokenManager.refreshUserAccessToken(TokenManager.java:204) ~[hub-email-extension-1.1.0.jar:?] 
at com.blackducksoftware.integration.email.extension.server.oauth.TokenManager.refreshToken(TokenManager.java:140) ~[hub-email-extension-1.1.0.jar:?] 
at com.blackducksoftware.integration.email.EmailEngine.start(EmailEngine.java:187) [hub-email-extension-1.1.0.jar:?] 
at com.blackducksoftware.integration.email.Application.<init>(Application.java:61) [hub-email-extension-1.1.0.jar:?] 
at com.blackducksoftware.integration.email.Application.main(Application.java:38) [hub-email-extension-1.1.0.jar:?] 


This is not a failure of the extension to start. It indicates that the extension has not been authorized.

Extension information URL

Once the extension is up and running, you can get the extension information through the URL:

http(s)://hub.server.url:55000/extension/info

If the URL for which the extension is configured doesn't work, make sure port 55000 is open for accepting connections. To do so, you must create iptable rules to open the ports. You may need to configure two rules to open the port for the email extension.

Due to differences in Linux distributions, Black Duck recommends that you consult your IT department before performing the following steps.


To get the extension information from the URL:

  1. Stop the email extension using the command:

     /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh stop
  2. Switch to a user that can execute the iptables command.
  3. Execute the command:

    iptables -I INPUT -m tcp -p tcp --dport 55000 -j ACCEPT
  4. Then, execute the command:

    iptables -I OUTPUT -m tcp -p tcp --dport 55000 -j ACCEPT
  5. Start the email extension using the command:

    /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh start
  6. Retry accessing the extension URL.

Register the extension to the Hub

After the URL displays the JSON payload describing the extension, you can register the extension as normal.

Advanced configuration of the Hub Email Extension

After you have successfully installed the Hub Email Extension, you must authenticate and configure the extension. The steps are:

  • Extension authentication.
  • Hub environment (global configuration).
  • Individual preferences (user configuration).

These procedures are described in the following sections.
Additional configuration options including:

  • JavaMail properties
  • Using HTTPS with the Hub Email Extension

are also described in the following sections.

Hub Email Extension authentication

After installing the Hub Email Extension, you must complete the extension authentication process.

You must have administrator rights to perform authentications.


To authenticate the Hub Email Extension:

  1. Log in to the Hub as administrator.
  2. Click the hamburger menu in the upper left corner, and select Administration to open the Administration page.
  3. On the Administration page, click Extensions. Note the status message in the green box, stating that the extension has been successfully added to the Hub.
  4. In the Extensions URL field on the Extensions page, type the URL you used in the hub.extension.url field in the extension.properties file.
  5. Click Save.
  6. Below the Extensions URL field, click the drop-down selector at the right of the email extension entry, and select Authorize. This option is only available in the drop-down menu if the extension is installed, but not yet authorized. Note that an authorization status of No displays at the right of the extensions table in the Authenticated column.
  7. In the confirmation box, click Authorize. The email extension is now authenticated, and you can complete the global configuration process. Note that an authorization status of Yes displays at the right of the extensions table in the Authenticated column.

Hub Email Extension global configuration

After you have successfully installed and authenticated the Hub Email Extension, you must configure it for your environment. This is referred to as the global configuration. You must have administrator rights to configure the email extension.

If the Hub Email Extension is not running, then the Hub Email Extension > Extension Configuration section does not display.


To globally configure and authenticate the Hub Email Extension:

  1. Log in to the Hub.
  2. In the hamburger menu on the left, select Administration.
  3. On the Administration page, select Hub Extensions.
  4. On the Hub Extensions page, select Hub Email Extension.
  5. On the Hub Email Extension page in the Extension Configuration section, complete the following fields:
    1. Mail SMTP Server Host: Type the URL for your email server. For authenticated SMTP servers, the user name and password must be manually configured in the extension.properties file. For more information on configuring a connection to authenticated SMTP servers, refer to JavaMail Configuration on page .
    2. Mail SMTP Server Port: Type the SMTP port number for your email server.
    3. Email From Address: Type the name which is seen by the email recipient as the email sender.
    4. Email Reply To Address: Type the email from address which is seen by the email recipient. This is used as the reply address if the recipient chooses to reply.
    5. Default Subject Line: Type the email subject line. It can be helpful to recipients if you specify Daily digest in the subject line.
    6. Default Logo Image(optional): Type the path to the image to be used for your custom logo that appears in emails. If no custom logo is specified, the default logo image is the Black Duck logo. If only a file name is provided, then the system looks to see if the file exists in the Images folder of the Hub Email Extension. If the full path for the image is provided, the system verifies that the image file exists at the path specified on the system where the extension is running.
  6. Click Save.

By default, all users are opted-in for the email digest. Administrator users can edit the user.configuration.json file to globally opt all users in or out. Users can configure their personal settings to opt-in or opt-out on an individual basis. For more information, refer to Hub Email Extension user configuration.

Hub Email Extension user configuration

After you have successfully installed and authenticated the Hub Email Extension, and configured it for your environment, you can configure it according to your personal preferences. This is referred to as the user configuration. You can change your personal notification email preferences at any time.
To configure your user preferences for the Hub Email Extension:

  1. Log in to the Hub.
  2. In the username drop-down menu on the right, select My Profile.
  3. On the Profile page, under Extensions, click Email Extension to open the Email Extension page. Note that if the Hub Email Extension is not available, the Extensions > Email Extension option does not display.
  4. On the Email Extension page, complete the following steps:
    1. Opt In / Opt Out: While the global default is that all users are opted in for email notifications, you can elect to opt out to stop receiving notification emails. Select Opt In to receive notification emails; select Opt Out to stop receiving notification emails.
    2. Email Frequency: When you are opted in for notification emails, you can select how often you'd like to receive the emails. The options are:
      1. As Events Occur: One email per event. Emails are sent in real-time as notification events occur.
      2. Daily Digest: (Default) One email digest per 24-hour period.
      3. Custom (Configured by Extension Admin: One email digest is sent based on the administrator's custom email configuration. For example, this could be every other Thursday at 11:00 AM, every Monday at 6:00 PM, and so forth. Consult with your administrator for details.
    3. The emails you receive display the type of frequency in the body of the email. For example, if you have selected Daily Summary, the email displays Daily Digest. In this manner, you always know the frequency of your email notifications without resorting to your user configuration settings.
    4. Email Notification Events: Select the notification events for which your emails are sent. Clicking in this field displays a drop-down selector with notification events; click one or more events to select. Selected email notification events display in this field. To remove notification events, click the X at the right of the notification event to remove.
    5. Template Name: Select the preferred email formatting template for your email digests. The template has no effect on the contents of your notification emails; only the formatting of the information contained within the emails. The values for template names correspond to the template files located in the Templates folder in the Hub Email Extension installation location.
  5. Click Save.

Custom email distribution schedules

As a Hub administrator, you can determine a custom interval for delivery of your notification email digests. Distribution options are:

  • Daily (default): You receive a single email digest, containing all notification events for the preceding 24-hour period.
  • As Events Occur: You receive individual emails as each notification event transpires.
  • Custom (optional): You can configure when to receive an email digest. The default custom setting is an hourly digest.

Setting up a custom email notification option may be a better fit for your workflow, and can allow greater flexibility for your users.


To configure a custom notification email distribution schedule:

  1. In the Hub email extension Config folder, locate the Properties file.
  2. Open the Properties file, and locate the lines:

    # default custom interval is to run every hour
    hub.email.notifier.variable.customDigest.cron.expression=0 0 0/1 1/1 * ? *
The default custom setting sends notification emails in an hourly digest. You can keep this setting, or configure your custom distribution to fit your workflow requirements.
  1. Using Cron expression syntax, edit the values in expression=0 0 0/1 1/1 * ? *.
  2. Save and close the Properties file.
  3. Restart the Hub Email Extension using the email_extension.sh file.
Because Hub extensions require Cron job settings using Cron expressions and syntax, reference websites and examples are provided in Cron Reference Information for Hub Extensions.

JavaMail configuration

The Hub Email Extension supports JavaMail configuration properties. This is achieved by adding properties to the extension.properties file beginning with the prefix hub.email.javamail.config. This allows an administrator of the extension to configure the full set of JavaMail properties as outlined on the Oracle website:
https://docs.oracle.com/javaee/7/api/javax/mail/package-summary.html
If you are using an authenticated SMTP server, specify the following properties in your extension.properties file to configure the user name and password.

hub.email.javamail.config.mail.smtp.user=<username>
hub.email.javamail.config.mail.smtp.password=<password>
hub.email.javamail.config.mail.smtp.auth=true

JavaMail configuration with SSL or TLS

If your environment includes an SMTP server requiring SSL, use the parameter:

hub.email.javamail.config.mail.smtp.ssl.enable=true

If your environment includes an SMTP server using TLS, use the parameter:

hub.email.javamail.config.mail.smtp.starttls.enable=true

With SSL or TLS enabled, the certificates must be in a trust store recognized by the JVM to use SSL or TLS.

For additional JavaMail SMTP configuration properties, refer to https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html.

HTTPS configuration

The Hub Email Extension supports SSL communication between the Hub and the extension. The certificate used by the extension must be signed by a certificate authority (CA) that the Hub server recognizes in its keystore for the Hub server to create a Secure Socket Layers (SSL) handshake between the Hub and the extension.
In the extension.properties file, the property hub.extension.url must contain https as the protocol scheme in the URL. For example, https://localhost:8000.
Next, the optional SSL parameters in the extension.properties file must contain valid values as follows:

  • hub.extension.ssl.keyStorePath = The full path to the keystore file containing the certificate for the extension.
  • hub.extension.ssl.keyStorePassword = The password of the keystore containing the certificate.
  • hub.extension.ssl.keyPassword = The password of the key used in the certificate. Note that if the keystore type is PKCS12, then values for the keyPassword and the keyStorePassword are the same.
  • hub.extension.ssl.keyStoreType = The type of keystore of the keystore file. For example, JKS or PKCS12.

For more information, refer to the Restlet documentation located at:
https://restlet.com/technical-resources/restlet-framework/guide/2.3/core/security/https

Testing your email configuration

The Hub Email Extension features a test page that is hosted by the extension. After authorizing and configuring the extension, you can use the test page to verify that your configuration is correct. The test page is accessed using the URL http://<extension_host_and_port>/extension/test. For example, http://mailextension.company.com:8000/extension/test.


To test your Hub Email Extension configuration:

  1. The Hub Email Extension can only be accessed after the Hub Email Extension is authorized.
  2. In a web browser, type the URL: http://mailextension.company.com:8000/extension/test, replacing the company and port values as appropriate for your environment.
  3. On the test page in the Email Address text box, type an email address to which a sample test email is sent. This process retrieves the global configuration options from the Hub configuration of the extension, and then sends an email to the address specified in the text box.
  4. Click Test.

Restarting the Hub Email Extension container

When restarting the Hub Email Extension container, you must delete the extension from the Hub, re-add it, and then authorize the extension. When adding the extension to the Hub, note that if the container is restarted, you must delete the extension and perform these steps again.

Uninstalling the Hub Email Extension

If the Hub Email Extension is no longer required, you can uninstall it using the following process.


To uninstall the Hub Email Extension:

  1. Log in to the Hub.
  2. In the hamburger menu on the left, select Administration.
  3. On the Administration page, select Hub Extensions.
  4. On the Hub Extensions page, select Hub Email Extension.
  5. On the Hub Email Extension page in Extension ConfigurationExtension Details, click Delete Extension.


After removing the Hub Email Extension, the installation and configuration files remain on your system. Therefore, you can reinstall the Hub Email Extension at any time. For more information, refer to the Hub Email Extension installation section.

Cron reference information for Hub extensions

Cron is a Unix tool with an established history. Its scheduling capabilities are both powerful and proven. The CronTrigger class is based on the scheduling capabilities of Cron.
CronTrigger uses Cron expressions, which are able to create distribution schedules such as:

  • At 5:00 pm every other day.
  • At 1:30 am every second Friday of the month.

For information and resources on cron syntax and more, refer to Cron Job References.

Troubleshooting your Hub Email Extension

Should you experience difficulties with your Hub Email Extension, refer to the following topics for troubleshooting techniques.

Cannot retrieve extension information

If you cannot retrieve the extension information, try running the following commands.

  1. List the iptables:

    iptables -L INPUT
  2. Check if the port is listed:

    iptables -L OUTPUT
  3. Check if the port is listed:

 netstat -nap | grep -i '<port_number>'


If nothing is returned, then the Hub Email Extension either isn't able to use the port, or the Hub Email Extension isn't running.

Extension previously authorized must be re-authorized

Scenario: you register the Hub Email Extension, and then delete it from the Hub. Before you can register and authorize it again, you must complete the following procedure.


To re-register and re-authorize the Hub Email Extension:

  1. Stop the extension using the command:

    /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh stop
  2. Delete the file containing the token using the command:

    /opt/blackduck/extensions/hub-email-extension-<version>/config/oauth.properties
  3. Start the extension using the command:

    /opt/blackduck/extensions/hub-email-extension-<version>/bin/email_extension.sh start

CentOS 7 firewall configuration

To properly set the firewall with CentOS versions 7.0 and higher, use the firewall-cmd command. If you have questions, refer to the manual page of the firewall-cmd command. Additionally, consult your IT department if you have further questions regarding requirements within your specific environment.
The following sections address specific areas of CentOS firewall configurations. Run the commands in the sections pertaining to your firewall configuration issues.


Check if firewalld is running:
To verify that the firewalld firewall service is running, use the following commands:

>systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)


Open ports
If firewalld is running, use the following command to open the appropriate ports:

>firewall-cmd --zone=public --add-port=<port number>/tcp --permanent 


Consult with your IT department before opening ports.


You must open the following port:

  1. The port of the Hub Email Extension; for example, 55000.

Example:

>firewall-cmd --zone=public --add-port=55000/tcp --permanent


For the firewall changes to take effect, you must issue the reload command:

>firewall-cmd --reload

Hub Email Extension Release Notes

Changes in release 1.3.2
  • Compatibility with Hub version 4.5.0.
  • Resolved an issue involving a null pointer error (NPE) on Hub 4.5.0.
  • Resolved an authentication error with Hub 4.5.0.
Changes in release 1.3.0
  • Added support for automatically importing the certificate.
  • Added support for manually importing the certificate.
  • Added support for the always-trust server certificate.
  • Added support for applying Hub proxy settings.
Changes in release 1.2.1
  • Added information about creating email extension-named volumes.
  • Resolved an issue wherein emails may contain duplicated contents if the project has the same vulnerabilities or policies in the same version. 
  • Added a process for restarting the Hub email extension container.
Changes in release 1.2.0
  • Added a Dockerized installation option.
  • Incorporated additional stability enhancements.
Changes in release 1.1.1
  • Addressed an issue with refreshing the user token.
  • Test emails now accept case-sensitive email addresses.
Changes in release 1.1.0
  • Notification emails are now available in real-time as notification events occur.
  • New installation and configuration procedures for both Hub and non-Hub server installations.
Changes in release 1.0.0
  • First release of Black Duck Hub Email Extension.



©2023 Synopsys, Inc. All Rights Reserved