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 |
A launch daemon is a process that initiates CodeSonar analysis operations as instructed by a hub or build process. Most users will never interact directly with the launch daemon.
Launch daemons are securable resources. The various LAUNCHD_* permissions control access to launch daemon information. For a given role R and launch daemon L, role R may have one or more of these permissions directly assigned to L, resource-inherited from a launchd group that directly or transitively contains L, or any combination of these.
A launch daemon is a process that initiates CodeSonar analysis operations as instructed by a hub or build process. Most users will never interact directly with the launch daemon.
Each instruction to the launch daemon has the following elements.
Each launch daemon is associated with a hub, and has an entry in the hub's analysis cloud register. Launch daemon properties are discussed below.
The remainder of this section uses "appropriate launch daemon" as a shorthand for referring to a launch daemon that is associated with the correct hub and has an identifying property tuple that matches that of the analysis of interest.
CodeSonar SaaS Note: You do not need to explicitly or implicitly start any launch daemons when using CodeSonar SaaS. Launch daemons are provided in your SaaS hub's saas launchd group.
A launch daemon is required whenever a hub is interacting with an analysis. There are several ways to start a launch daemon:
Important: the hub must be running before the launch daemon is started.
The following main menu options in the configuration tool include steps for configuring and starting a launch daemon to communicate with the specified hub. The hub's analysis cloud register will be updated when the launch daemon connects.
The general form of the command line for starting a CodeSonar launch daemon is
Where the command components are as follows.
| -no-services | (Windows only) specifies that the launch daemon should not be run as a service (see section CodeSonar as a Windows Service for more information). |
|---|---|
| -foreground | Execute the cslaunchd process in the foreground instead of spinning off a background process. If successful, the codesonar install-launchd command will run forever, or at least until the hub shuts down. |
| [-auth authtype], [-hubuser username], [-hubpwfile pwfile], [-hubbearerfile bearerfile], [-hubcert certfile], [-hubkey privatekeyfile] |
Specify how CodeSonar should attempt to authenticate this
command. For details, see Hub
Authentication: Authenticated codesonar Subcommands. The username of the authorizing Hub User is recorded as a property of the launch daemon. |
| [-launchd-group ldgroup] |
If this is a new launch daemon (that is, its identifying tuple does not correspond to an
existing entry in the hub's analysis
cloud register), its Parent
LDGroup will be set to the launch daemon group G that is
specified by ldgroup. The value of ldgroup can be
either a string or an integer.
G must already exist on the hub, and the authorizing user must have LAUNCHDGROUP_ADD_CHILD permission for G. If the analysis launch daemon is not new, this option has no effect. You can change the parent launchd group for an existing launch daemon from the corresponding Launchd Group page. |
| [-launchd-key ldkey] | Specify the launch daemon key. |
| [-launchd-home ldhomedir] | Specify the launch daemon Home Directory. |
| [-launchd-quota ldquota] | Specify the launch daemon Space Quota: the maximum permitted size (in MB) of the Home Directory. |
| [-max-processes proclimit] | Specify the launch daemon process limit: either a non-negative integer, or auto. |
| [[protocol://]address:port] |
The launch daemon will connect to the hub at this location.
The codesonar install-launchd command will fail without starting a new launch daemon if no hub is running at the specified location, or if a hub is running but a launch daemon with the same identifying property tuple is already connected. The hub's analysis cloud register will be updated when the launch daemon connects. |
The launch daemon will be connected to the specified hub.
Note. Your CLI secret will expire after a month. If necessary, repeat these steps obtain a new secret from https://artifacts.codesonar.com/.
Provide your credentials when prompted.
A standard project build/analysis command of the form
(or its Windows build wizard equivalent) can start a launch daemon implicitly if a hub was already running at [protocol://]host:port before the build/analysis command was executed. The hub's analysis cloud register will be updated when the launch daemon connects.
Special cases:
If you perform a foreground analysis and subsequently wish to use the web GUI to view or browse code from the analysis, you will need to manually start a launch daemon as described above. Other GUI functionality, such as viewing warning reports reports for the analysis, does not require a launch daemon.
There are three situations in which a launch daemon is needed.
| During Results Browsing | Pages requested by the user may require results generated by a codesonar command. The hub issues the necessary command to the appropriate launch daemon. |
|---|---|
| During Build/Analysis | The analysis phase of the build/analysis is initiated by a launch daemon. If an appropriate launch daemon is not running, CodeSonar will start one. |
| Distributed Analyses | Launch daemons in the hub's analysis cloud register are used to start new analysis slaves and daemon slaves requested by remote-requesting masters. |
If any user is viewing or browsing source code from a specific analysis on a hub, the hub must be connected to a launch daemon that is:
If no such launch daemon is running, the hub is not able to start one. The user who ran the analysis must start a launch daemon on the appropriate machine as described above.
The CodeSonar build/analysis uses a launch daemon to start the analysis phase, as shown in the diagram in section Build/Analysis Steps.
A remote-requesting master requests additional distributed slaves from the hub when it needs them; the hub then instructs each eligible launch daemon in its analysis cloud register to start a new slave. For full details, see section Distributed Analysis.
In normal usage you will not usually need to manually stop a launch daemon.
The launch daemon process is called cslaunchd.exe on Windows systems, cslaunchd otherwise. It is run as the user that executes the build/analysis (which may not be the same user as the one that started the hub).
On Windows systems the launch daemon runs as a service by default. For more information, see CodeSonar as a Windows Service.
The following table describes each of the properties of a launch daemon. The full list of properties is (in alphabetical order):
A launch daemon is always associated with a hub. Information about the launch daemon properties is managed in the hub's analysis cloud register.
| Name | Description |
|---|---|
| Machine | The name of the machine on which the launch daemon is running. |
| Address | The IP address of the launch daemon Machine. |
| System User |
The system user who is running the launch daemon.
Note that this is a user on the launch daemon Machine, not on the hub. In particular, it does not need to match the launch daemon Hub User (although it may do so, whether deliberately or coincidentally). |
| System User ID |
The system-assigned unique identifier of the System User.
|
| Derived Name |
The string sysuser@machine, where
This string provides a somewhat human-readable identifier for use in the CodeSonar GUI; it can also be used (in combination with the Parent LDGroup path) to specify values for configuration parameters REMOTE_ANALYSIS_SLAVES_LAUNCHDS and REMOTE_DAEMON_SLAVES_LAUNCHDS. Note that it is not a unique identifier: all launch daemons with the same System User and Machine will have the same Derived Name. |
| Hub User |
The username
of the hub
user account that authorized
the launch daemon's connection to the hub.
This does not need to match the launch daemon System User (although it may do so, whether deliberately or coincidentally). CodeSonar always behaves as if the Hub User has all LAUNCHD_* permissions for the launch daemon. |
| Installation | The absolute pathname (on Machine) of the root directory for the CodeSonar installation the launch daemon is running from. |
| Key |
A user-specified identifying string. The Key is included in the
identifying tuple in order to permit distinction between
multiple launch daemons with the same Machine, System
User, Hub User, and Installation.
For any command that starts or is otherwise associated with a launch daemon, the launch daemon Key is determined as follows.
|
| Protocol Version | The protocol version for the CodeSonar installation that is running the launch daemon. A remote-requesting analysis master will only be able to obtain slaves from launch daemons with the same protocol version. |
| Process Limit |
The maximum number of analysis slaves and daemon slaves that
the launch daemon can be cloud associated
with at a time: either a non-negative integer, or
"auto".
When a launch daemon process starts, its process limit is determined as follows.
For information about how the process limit is applied for distributed analyses, see Distributed Analysis: Analysis Cloud Register: Process Limit. |
| Current Processes | The set of analysis slaves and daemon slaves that are
currently cloud associated
with the launch daemon. For information about how the set is managed in distributed analyses, see Distributed Analysis: Analysis Cloud Register: Current Processes. |
| Status | An online/offline designation indicating whether the launch daemon is connected to the hub. |
| Launch Daemon ID | A unique numeric identifier for the launch daemon. |
| Parent LDGroup |
The launchd
group that directly contains the launch daemon.
The Parent LDGroup for a new launch daemon (that is, a launch daemon whose identifying property tuple does not match an existing entry in the analysis cloud register) is determined as follows.
|
| LDPath |
Derived from the launch daemon's Parent LDGroup, System
User, and Name: the full path from the hub's root launchd
group to the launch daemon. The LDPath for a launch daemon L is always displayed and specified as a /-separated sequence of the form ldgrouppath/sysuser@machine, where:
|
| Home Directory |
The directory on Machine under which the
launch daemon will store project
analysis directories for all of the remote-managed
analyses that it manages.
For a remote-managed analysis A, the analysis directory path is ald-home/aid/pfilesname.prj_files, where
|
| Space Quota |
The maximum permitted size of the Home Directory.
If Space Used exceeds Space Quota, the launch daemon cannot be the Analysis Launch Daemon for a remote-managed analysis. |
| Space Used | The total disk space currently used by the Home Directory. |
CodeSonar uses a tuple of launch daemon properties to identify launch daemons and determine their association with build and analysis processes. The tuple properties are:
The hub uses this tuple to uniquely identify the launch daemons connected to it. In particular, if a launch daemon stops and is later restarted, the hub will consider the new process to be 'the same' launch daemon as the previous one.
The section on distributed analysis discusses the various situations in which this tuple is used.
CodeSonar permissions apply to launch daemons as follows.
Launch daemon operations are governed by various LAUNCHD_* and LAUNCHDGROUP_* permissions.
| Operation | Permissions Required |
|---|---|
| Start a launch daemon |
Requirements depend on whether or not the launch daemon is
already present in the hub's analysis
cloud register.
Launch daemon
tokens.
|
| Automatically add an analysis slave or daemon
slave by requesting from launch daemon L (remote-requesting; local-requesting) |
The authenticated user authorizing the analysis command must have LAUNCHD_START_SLAVE permission for L. |
| Manually add an
analysis slave or daemon slave from launch daemon L |
Manually adding an analysis slave or daemon slave is only possible when environment variable CS_MASTER_WIDE_OPEN is set to 1 in the environment in which the analysis master is running. When this variable is defined, permissions are not checked, and the master will not authenticate slaves. See Parallelism In CodeSonar: Manually Started Slaves for a full discussion. |
| Change the process limit for launch daemon L | LAUNCHD_EXISTS and LAUNCHD_WRITE for L. |
| View/modify launch daemon settings | Permission requirements for pages that provide access to launch daemon information are detailed in the GUI reference: |
Suppose a new launch daemon L is started in launchd group G, authorized by Hub User U. No explicit role-permissions are initially applied to L, but the following permissions will apply through other means.
There are initially no other role-permissions applied to L. To add further permissions, use the Resource Role-Permissions page for L (or G, any of G's ancestor Launchd Groups).
To report problems with this documentation, please visit https://support.codesecure.com/.