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.
-
If you access the manual through the hub's Web GUI, the
functionality will not be suppressed because the hub is a web
server.
-
Alternatively, your browser may allow you to explicitly
disable the security setting that suppresses functionality. See
the CodeSonar
FAQ for more information.
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.
- If you do not need to start a new hub as part of your
installation process, go back to Installation: Setting Up The Hub and
use the decision tree provided to navigate to the appropriate hub
setup instructions.
- 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:
- CodeSonar SaaS Note: if you
are using CodeSonar SaaS, you will use your dedicated SaaS hub
instead of starting a new hub. Follow the instructions in
Installation: Hub Setup:
Connecting to a Existing Hub to connect to your SaaS
hub.
Creating a CodeSonar hub involves several major steps.
- A. Decide where to store the hub
database and where to run the hub.
- B. Perform any necessary
preliminary steps.
- C. Start the hub.
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:
To configure CodeSonar, you will need to determine where to store
the hub database and where to run the hub.
-
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. |
- 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.
- YES: You can run a single hub on that machine.
- NO: you will need to run multiple
hubs.
- 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.
- Minimum length: 12 characters
- Minimum number of character classes (e.g. 'upper case', 'lower case', 'digit'): 3
Make sure your user account and machine are ready to start a
hub.
- 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.
- 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/
- You will need to expand the shared
memory. See Running a Hub Under
Linux.
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.
- If you haven't already done so, obtain your artifacts.codesonar.com CLI secret.
- Navigate to https://artifacts.codesonar.com/.
- Sign in with your CodeSonar Support credentials.
- Select User Profile from the menu at top right.
Your User Profile page will open.
- Make a note of the Username.
- 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/.
- Log in to the registry.
docker login artifacts.codesonar.com
Provide your credentials when prompted.
- User name is your artifacts.codesonar.com Username.
- Password is your artifacts.codesonar.com CLI secret.
- Create a Docker volume to store the hub.
docker volume create codesonar-hub
- 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. |
- Go on to Hub Setup: Hub License
Key.
The following entries from Frequently Asked Questions: Hub and User
Accounts are particularly relevant.
If your system does not support IPv6 addresses, use IPv4 to
specify addresses instead.
- 127.0.0.1 instead of
::1
- 0.0.0.0 instead of
::