JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc

Installation: Hub Setup: Starting a New Hub with Docker Images From artifacts.codesonar.com

This section is for users who need to start a new CodeSonar Hub as part of the CodeSonar installation. It explains the factors involved in deciding on a hub location and describes how to start the hub.



Overview

Creating a CodeSonar hub involves several major steps.

The remainder of this page describes these steps and provides links to further information.

If you need to start a new hub, but prefer not to use a container, follow the instructions in Installation: Hub Setup: Starting a New Hub instead.

You can also install CodeSonar on a Kubernetes cluster and run a hub pod:

A. Important Decisions

To configure CodeSonar, you will need to determine where to store the hub database and where to run the hub.

  1. Choose a hub machine and interface using the following table.
    Number of Users Analysis /Result Browsing Machine(s) Hub Machine Hub Interface
    one All analyses take place on one machine, and you will browse analysis results from the same machine. The same machine as the analyses. Run the hub on a restricted interface such as ::1.
    (See the IPv4 note if your system does not support IPv6 addresses.)
    one Analyses or result browsing (or both) may take place on machines other than the hub. Choose a hub machine that all analysis machines/users and hub browsing machines/users can access. Ensure, however, that your hub is not visible to the entire internet. Are the hub machine and all users behind a firewall?
    • YES: Run the hub on :: to listen on all interfaces.
    • NO: Specify a restricted interface such as ::1, and use a VPN to connect.
      For a detailed example, see Task: ssh Tunnel to a Hub.
    (See the IPv4 note if your system does not support IPv6 addresses.)
    multiple All cases.
  2. Determine how many hubs you will need.
    Do you have a machine that is accessible to all hub users and can handle the number of connections that this entails? All analysis machines, and all users that will want to use the web GUI, must be able to connect to the hub.
  3. Choose a strong, memorable password for the hub Administrator account. You will be prompted to set a password for this account during the hub setup procedure.
    The Administrator account has a broad range of hub permissions: setting a weak password will substantially undermine hub security.
    By default, the following minimum password requirements apply.

B. Preliminary Steps

Make sure your user account and machine are ready to start a hub.

  1. Determine whether you have sufficient user permissions to run software that listens on any port.
    If not, a system administrator will need to start the hub.
  2. Make sure you are logged in as an ordinary user: the hub cannot be run as root.
    This user must have write permissions for the following, where $CSONAR is the CodeSonar installation directory.
    • $CSONAR/codesonar/template.conf
    • $CSONAR/codesonar/default_presets/
    • $CSONAR/codesonar/presets/
  3. You will need to expand the shared memory. See Running a Hub Under Linux.

C. Start The Hub

Once you have made the important decisions and performed the preliminary steps, start the hub.

The hub should be started on the machine you selected in step A.

  1. If you haven't already done so, obtain your artifacts.codesonar.com CLI secret.
    1. Navigate to https://artifacts.codesonar.com/.
    2. Sign in with your CodeSonar Support credentials.
    3. Select User Profile from the menu at top right.
      Your User Profile page will open.
    4. Make a note of the Username.
    5. Click the copy icon on the CLI secret line to copy the CLI secret to your clipboard.

    Note. Your CLI secret will expire after a month. If necessary, repeat these steps obtain a new secret from https://artifacts.codesonar.com/.

  2. Log in to the registry.
    docker login artifacts.codesonar.com

    Provide your credentials when prompted.

  3. Create a Docker volume to store the hub.
    docker volume create codesonar-hub
  4. Run the following command to start the hub.
    docker run -d -v codesonar-hub:/home/codesonar \
    -e CSHUB_PASSWORD=<admin_passwd> \
    [-e CSHUB_DISABLE_ANON=1] \
    -p <hub_port>:7340 \
    https://artifacts.codesonar.com/cso/codesonar-hub
    where
    <admin_passwd> is the Administrator password you chose in step A.
    -p <hub_port>:7340 specifies that the hub should listen on port <hub_port> on all interfaces.
    If you want to specify a restricted interface such as ::1, replace this option with
    -p [::1]:<hub_port>:7340

    Command notes:

    -d Causes the Docker container to run as a background process.
    [-e CSHUB_DISABLE_ANON=1] Disables anonymous access to the hub.
  5. Go on to Hub Setup: Hub License Key.

Troubleshooting

The following entries from Frequently Asked Questions: Hub and User Accounts are particularly relevant.

IPv4 Note

If your system does not support IPv6 addresses, use IPv4 to specify addresses instead.

 

To report problems with this documentation, please visit https://support.codesecure.com/.