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 |
Some CodeSonar hub interactions take place in sessions, which can be either user sessions or anonymous sessions.
User sessions and anonymous sessions are both licensed resources.
CodeSonar sessions can be divided into user
sessions and anonymous sessions.
In some cases, sessions of either type can be overflow
sessions.
| user session | A session that has been authenticated by a non-Anonymous hub user account (including
Administrator). |
|---|---|
| anonymous session | A session that has not been authenticated by a
non-Anonymous hub user
account. These sessions are treated as belonging to special user Anonymous, and are only available if Anonymous has G_SIGN_IN permission. |
| overflow session |
One of the following.
An overflow session has reduced functionality. There is no access to licensed behavior, even if the Session User would otherwise have the relevant permissions through their assigned roles. A message specifying that the user is in an "overflow session" will be displayed above the GUI page footer. Note: overflow sessions cannot be created through the HTTP API. If no licensed slots are available, session creation through the HTTP API will fail. If a licensed slot becomes available, you can claim it by ending the overflow session and then creating a new session. |
This section describes each of the properties of a session. The full list of properties is (in alphabetical order):
| Name | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Bearer Token |
A unique security token associated with the session. You can
present this token to perform bearer
authentication.
The Bearer Token is reported as a result of explicitly creating a session on the User Sessions page or through the HTTP API. It is not available afterward, or for sessions created by other means. |
||||||||
| Expires | The date and time at which the session will expire. If
Keep Alive? is set to
"true", this will be repeatedly extended while activity is
taking place in the session. If not explicitly specified when the session is created, the initial Expires value is computed by adding the hub's HTTP session timeout to the current date/time. |
||||||||
| ID | A unique numeric identifier for the session. | ||||||||
| Keep Alive? |
"True" if the Expires
date/time should be extended when the session is not idle. If
set to "false", the Expires value is fixed at the
time the session is created and does not change.
Session extension works as follows. Each time you use a session with Keep Alive?="true", CodeSonar checks the current date/time.
|
||||||||
| Note | A user-specified note, provided when the session was initially created. | ||||||||
| Overflow? | "True" if this is an overflow session, "false" otherwise. | ||||||||
| Precious? | "True" if the session is protected from forced deletion, "false" otherwise. | ||||||||
| Pool |
A text label naming the "pool" to which the session
belongs. Two sessions with the same Pool value are considered
to belong to the same pool. Pools provide another dimension for imposing session limits. Along with the hub-wide and per-user limits, there is a user-pool limit for each pool. For example, suppose you have a "ci" pool that is used only by CodeSonar operations in your organization's continuous integration system. Setting a user-pool limit on the "ci" pool helps ensure that the continuous integration does not take up all available session slots. New sessions are assigned to pools as follows.
|
||||||||
| Session User |
The hub user account
associated with the session. If this user is Anonymous then the session is an anonymous session, otherwise it is a user session. Per-user and user-pool session limits provide restrictions on the number of simultaneous user sessions with the same Session User. |
Sessions can be created as shown in the following table.
| Permissions Required | ||
|---|---|---|
| Implicit Creation: GUI | Signing in to the web GUI implicitly starts a user
session. Accessing the web GUI without signing in implicitly starts an anonymous session. |
|
| Explicit Creation: GUI |
You can create sessions for a given user from the corresponding
User Sessions page.
|
|
| Explicit Creation: codesonar generate_hubbearerfile.py |
You can use codesonar
generate_hubbearerfile.py to create a new user session
and save its bearer token to a file.
For more information, see codesonar generate_hubbearerfile.py: Create/Delete a Hub User Session and Bearer File. |
|
| Explicit Creation: HTTP API | POST /session/create-anonymous/[*] | |
| POST /session/create-basic-auth/[*] | ||
| POST /session/create-impersonate/[*] |
|
|
| POST /session/create-new-account/[*] | ||
| POST /session/create-reset-password/[*] | ||
| POST /session/create-tls-client-certificate/[*] |
The various mechanisms for ending a session are shown in the following table.
| Method | Permissions Required | |||||
|---|---|---|---|---|---|---|
| Ordinary Expiration | A session is automatically deleted when its Expires timestamp is reached. If Keep Alive?="true", the Expires value will be repeatedly extended while activity is taking place in the session. |
- | ||||
| Forced Deletion |
A session with Precious?="false" can be
forcibly deleted to allow creation of a new session.
Suppose a user U attempts to start a new session Sn in pool P.
|
- | ||||
| Implicit Deletion: GUI | If Sessions expire on browser close? is enabled for the hub, user sessions or anonymous sessions that were browsing the web GUI are deleted when you close the corresponding browser, unless the browser prevents this. | - | ||||
| Explicit Deletion: GUI |
The CodeSonar web GUI provides session deletion functionality
in several contexts.
|
|
||||
| Explicit Deletion: codesonar generate_hubbearerfile.py |
You can use codesonar
generate_hubbearerfile.py with the --delete option to delete the user
session associated with a specified bearer file.
For more information, see codesonar generate_hubbearerfile.py: Create/Delete a Hub User Session and Bearer File. |
|
||||
| Explicit Deletion: HTTP API | DELETE /session/[*] |
|
Session information is available in the CodeSonar GUI as follows.
| User Sessions | Detailed information about all sessions associated with the corresponding user, along with functionality for deleting sessions and creating new sessions. |
|---|---|
| License Utilization | Current user session and anonymous session counts for the hub. |
Session limits are applied at several levels of detail.
| licensed anonymous sessions |
The maximum number of anonymous
sessions that can run simultaneously on the hub.
|
|---|---|
| licensed user sessions |
The maximum number of user sessions
that can run simultaneously on the hub.
|
| per-user limit |
The total number of licensed sessions (that is, sessions with
Overflow?="false") that
a single non-Anonymous hub
user can run simultaneously.
|
| user-pool limits |
For each pool, the maximum number of
icensed sessions (that is, sessions with Overflow?="false") that a single
non-Anonymous hub user can run
simultaneously in that pool.
|
You can change the per-user and user-pool limits for your hub by editing the hub's constants.py file.
CodeSonar SaaS Note: If you are using CodeSonar SaaS, you will not have access to the constants.py file. Contact CodeSecure support if you wish to change these limits.
On the machine that is running the hub, do the following.
| MAX_SESSIONS_PER_USER | The hub's per-user limit: a single value. |
| MAX_SESSIONS_PER_USER_POOL |
The hub's user-pool
limits, as a dictionary of pool_name:pool_limit
pairs.
|
A session's bearer token can be used to perform bearer authentication.
The expected use case for bearer authentication is for automated operations that are noninteractive or unattended, such as continuous integration or nightly scripts.
The general technique is as follows.
Note. This page contains references to HTTP API documentation, which is served directly by the hub and cannot be accessed via a file:// URL. For active HTTP API documentation links, start a hub (if one is not already running), then open the manual from the hub.
To report problems with this documentation, please visit https://support.codesecure.com/.