Health (including Hardening) and Connectivity Status
This category covers the agent installation health, hardening, and the connectivity status. Installation health is based on SComC and SK service states (more details below). Both checks and control are provided for hardening and connectivity status.
Enumerations
enum HSDCHealth : DWORD { HSDCHealthUnknown = 0, HSDCHealthNotInstalled, HSDCHealthNotRunning, HSDCHealthOk }
enum HSDCHardening : DWORD { HSDCHardeningUnknown = 0, HSDCHardeningOff, HSDCHardeningRelaxed, HSDCHardeningOn }
enum HSDCConnectivityStatus : DWORD { HSDCStatusUnknown = 0, HSDCStatusOffline, HSDCStatusOnline }
Functions
HSDCError HSDCAPI HSDCGetHealth (DWORD *pHealth, DWORD *pHardening, char **pJstr)
Provides an aggregated health status of the agent installation.
HSDCError HSDCAPI HSDCRelaxHardening (const char *jstr, const unsigned char *signature, unsigned int signatureLength)
Relaxes hardening using a digitally signed JSON payload.
HSDCError HSDCAPI HSDCRelaxHardeningWithTicket (const wchar_t *filename)
Relaxes hardening using a digitally signed ticket. This format is a binary structure generated by the Device Control server, this approach should not be used in an agent integration.
HSDCError HSDCAPI HSDCGetConnectivityStatus (DWORD *pStatus, char **pJstr)
Gets the current connectivity status. The meaning depends on the option 60 ( oiOnlineAsWired) mode.
HSDCError HSDCAPI HSDCSetConnectivityStatus (DWORD status)
Sets the current connectivity status. This function has a meaning only when the option 60 ( oiOnlineAsWired) is set to manual.
HSDCError HSDCAPI HSDCGatherDiagnosticInfo (const wchar_t *const outputPath=nullptr)
Gathers a set of diagnostic information related to the agent's environment, policies, and status. It adds these items into an EsDiag folder within that path.
Enumeration Type Documentation
HSDCHealth
enum HSDCHealth : DWORD
Enumerators
Case not covered above like invalid service path, tampered files, and so on. |
|
At least one service (SComC or SK) does not exist. |
|
Both SComC and SK services are installed, at least one service is not running, associated binaries are digitally signed and not tampered. |
|
Both SComC and SK services are running, associated binaries are digitally signed and not tampered. |
HSDCHardening
enum HSDCHardening : DWORD
Enumerators
Unknown hardening state. |
|
Hardening off. |
|
Hardening relaxed, maintenance mode. |
|
Hardening on. |
HSDCConnectivityStatus
enum HSDCConnectivityStatus : DWORD
Enumerators
Unknown connectivity status. |
|
Connectivity status offline. |
|
Connectivity status online. |
Function Documentation
HSDCGetHealth()
HSDCError HSDCAPI HSDCGetHealth ( DWORD * pHealth, DWORD * pHardening, char ** pJstr )
Provides an aggregated health status of the agent installation.
Parameters
pHealth |
[out] Non nullptr pointer to a DWORD value which upon success will contain the a member of HSDCHealth. |
pHardening |
[out] Non nullptr pointer to a DWORD value which upon success will contain the a member of HSDCHardening. |
pJstr |
Returns a JSON string with all details, formatted as below: Copy
|
Returns
HSDCErrorSuccess |
The operation succeeded |
HSDCErrorInvalidArg |
Input was nullptr |
HSDCErrorUnexpected |
Unexpected error |
HSDCErrorNotInitialized |
Initialization was not performed |
HSDCRelaxHardening()
HSDCError HSDCAPI HSDCRelaxHardening ( const char * jstr, const unsigned char * signature, unsigned int signatureLength )
Relaxes hardening using a digitally signed JSON payload.
Parameters
jstr |
A JSON string containing the maintenance ticket information, as below: Copy
Salt is needed if the endpoint is in extended mode. Server, admin, and comments are for information only. |
signature |
RSA signature of jstr parameter, this signature is going to be checked with the sx-public.key in the sxdata folder (which is loaded by SComC at start). |
signatureLength |
RSA signature length (2048 bits / 256 bytes with the current agent key length). |
Returns
HSDCErrorSuccess |
The operation succeeded |
HSDCErrorInvalidArg |
Input was nullptr |
HSDCErrorUnexpected |
Unexpected error |
HSDCErrorNotInitialized |
Initialization was not performed |
HSDCRelaxHardeningWithTicket()
HSDCError HSDCAPI HSDCRelaxHardeningWithTicket ( const wchar_t * filename )
Relaxes hardening using a digitally signed ticket. This format is a binary structure generated by the Device Control server, this approach should not be used in an agent integration.
An alternative is to copy the file in the Ticket folder specified during installation steps, but this will be asynchronous and will lack the feedback.
Parameters
filename |
The full path of the maintenance ticket |
Returns
HSDCErrorSuccess |
The operation succeeded |
HSDCErrorInvalidArg |
Input was nullptr |
HSDCErrorUnexpected |
Unexpected error |
HSDCErrorNotInitialized |
Initialization was not performed |
HSDCGetConnectivityStatus()
HSDCError HSDCAPI HSDCGetConnectivityStatus ( DWORD * pStatus, char ** pJstr )
Gets the current connectivity status. The meaning depends on the option 60 ( oiOnlineAsWired) mode as described below:
- 0 "server": Online if the last agent communication with the device control server was successful, Offline otherwise
- 1 "wired" : Online if the network communication is performed though a wired NIC, Offline otherwise(WiFi, ...)
- 2 "manual": Online / Offline is controlled through the API
Parameters
pStatus |
[out] The status value (one of |
pJstr |
[out] JSON string with all details, formatted as below: Copy
|
Returns
HSDCErrorSuccess |
The operation succeeded |
HSDCErrorInvalidArg |
Input was nullptr |
HSDCErrorUnexpected |
Unexpected error |
HSDCErrorScomcCommFailure |
Unable to communicate with SComC service |
HSDCErrorNotInitialized |
Initialization was not performed |
HSDCSetConnectivityStatus()
HSDCError HSDCAPI HSDCSetConnectivityStatus ( DWORD status )
Sets the current connectivity status. This function has a meaning only when the option 60 ( oiOnlineAsWired) is set to manual.
Parameters
status |
One of the HSDCConnectivityStatus values |
Returns
HSDCErrorSuccess |
The operation succeeded |
HSDCErrorInvalidArg |
Input was nullptr |
HSDCErrorUnexpected |
Unexpected error |
HSDCErrorAccessDenied |
Calling process is not privileged or option 60 is not set to manual |
HSDCGatherDiagnosticInfo()
HSDCError HSDCAPI HSDCGatherDiagnosticInfo ( const wchar_t *const outputPath = nullptr )
Gathers a set of diagnostic information related to the agent's environment, policies, and status. It adds these items into an EsDiag folder within that path.
Parameters
outputPath |
The destination folder into which the EsDiag folder is placed. By default, or if nullptr or an empty string is provided, the file is placed next to the calling process executable. |
Returns
One of the HSDCError enum members |
|
HSDCErrorNotInitialized |
The API is not correctly set up using |
HSDCErrorInvalidFile |
The function failed to set up the output directory or files |