Configure Deep Security Manager System Settings

The API provides access to many of the Deep Security Manager system settings. It is useful to automate configurations immediately after deployment.

You use the following SDK classes to interact with system settings:

  • SystemSettings: Defines properties for all of the available system settings. The properties are named after the system setting with which they correspond. For a list of system settings, see System Settings in the Settings Reference.
  • SettingValue: Stores a single string value. Use SettingValue objects to store the values of SystemSettings properties, which are of type SettingValue.
  • SystemSettingsApi: Enables you to list and modify system settings on Deep Security Manager (using a SystemSettings object), and to get, modify, and reset the value of a specific system setting.

Retrieve, modify, or reset a single system setting

When you are working with one or a small number of system settings, use the methods or functions of the SystemSettingsApi class that provide access to a single system setting:

  • To retrieve a setting or to reset it to the default value, create a SystemSettingsApi class and use the describeSystemSetting or resetSystemSetting method or function. Include the setting name as an argument. (See System Settings for a list of settings.)
  • To modify a setting, create a SystemSettingsApi class and use the modifySystemSetting method or function, and include the setting name and setting value as arguments. The value is a SettingValue object.

To modify a system setting, you need the name of the setting, and a SettingValue object that contains the desired value. Note the value of a SettingValue object is a String:

Python
# value for platform_setting_agent_initiated_activation_enabled
allow_value = api.SettingValue()
allow_value.value = str(allow)
JavaScript
settingName = "platformSettingAgentInitiatedActivationEnabled";
const agentInitiatedActionEnabled = new api.SettingValue();
agentInitiatedActionEnabled.value = allowValue;
Java
String settingName = "platformSettingAgentInitiatedActivationEnabled";
SettingValue agentInitiatedActivationEnabled = new SettingValue();
agentInitiatedActivationEnabled.setValue(allowValue);

Then, use a SystemSettingsApi object to modify the setting:

Python
system_settings_api = api.SystemSettingsApi(api.ApiClient(configuration))
return system_settings_api.modify_system_setting(api.SystemSettings.platform_setting_agent_initiated_activation_enabled, allow_value, api_version)
JavaScript
const systemSettingsApi = new api.SystemSettingsApi();
return systemSettingsApi.modifySystemSetting(settingName, allowValue, apiVersion);
Java
SystemSettingsApi settingsApi = new SystemSettingsApi();
return settingsApi.modifySystemSetting(settingName, agentInitiatedActivationEnabled, apiVersion);

Example: Modify a single system setting

The following example sets the value of the system setting that controls whether agent-initiated activation is allowed.

Python

View source

# Create the setting value
allow_value = api.SettingValue()
allow_value.value = str(allow)
try:
    # Modify system setting on Deep Security Manager
    system_settings_api = api.SystemSettingsApi(api.ApiClient(configuration))
    return system_settings_api.modify_system_setting(api.SystemSettings.platform_setting_agent_initiated_activation_enabled, allow_value, api_version)
except api_exception as e:
    return "Exception: " + str(e)
JavaScript

View source

settingName = "platformSettingAgentInitiatedActivationEnabled";= new api.SettingValue();
agentInitiatedActionEnabled.value = allowValue;= new api.SystemSettingsApi();
return systemSettingsApi.modifySystemSetting(settingName, allowValue, apiVersion);
Java

View source

String settingName = "platformSettingAgentInitiatedActivationEnabled";= new SettingValue();
agentInitiatedActivationEnabled.setValue(allowValue);= new SystemSettingsApi();
return settingsApi.modifySystemSetting(settingName, agentInitiatedActivationEnabled, apiVersion);

Also see the Modify a System Setting operation in the API Reference.

List or modify multiple system settings

When you are working with many system settings, use the methods or functions of the SystemSettingsApi class that provide access to all system settings in a single call:

  • listSystemSettings: Returns a SystemSettings object that contains the values that are set for all system settings on Deep Security Manager.
  • modifySystemSettings: Modifies all system settings according to the SystemSettings object that is provided as an argument.

Use the following general steps to use an SDK to modify a system setting:

  1. Create a SettingValue object for every system setting that you are configuring. Set the value of each object to the value that you want for the corresponding system setting.
  2. Create a SystemSettings object and set the properties to the SettingValue objects.
  3. Create a SystemSettingsApi object and use it to modify the system settings on Deep Security Manager according to the SystemSettings object.

SettingValue values are of type String. The following example creates a SettingValue for a setting that you want to set to 100:

Python
max_sessions = api.SettingValue()
max_sessions.value = "100"
JavaScript
const maxSessions = new api.SettingValue();
maxSessions.value = "100";
Java
SettingValue maxSessionsValue = new SettingValue();
maxSessionsValue.setValue(100);
Use the SettingValue as the value of a setting:

Python
system_settings = api.SystemSettings()
system_settings.platform_setting_active_sessions_max_num = max_sessions
JavaScript
const systemSettings = new api.SystemSettings();
systemSettings.platformSettingActiveSessionsMax = maxSessions;
Java
SystemSettings systemSettings = new SystemSettings();
systemSettings.setPlatformSettingActiveSessionsMax(maxSessionsValue);
Finally, modify the setting on Deep Security Manager:

Python
settings_api = api.SystemSettingsApi(api.ApiClient(configuration))
return settings_api.modify_system_settings(system_settings, api_version)
JavaScript
const systemSettingsApi = new api.SystemSettingsApi();
return systemSettingsApi.modifySystemSettings(systemSettings, apiVersion);
Java
SystemSettingsApi settingsApi = new SystemSettingsApi();
return settingsApi.modifySystemSettings(systemSettings, apiVersion);

Example: Modify multiple system settings

The following example sets two system settings: the system setting that controls the maximum number of sessions that a user can create, and the action that the manager takes when the maximum is exceeded.

Python

View source

# Create the SettingValue object and set the max sessions value
max_sessions = api.SettingValue()
max_sessions.value = str(max_allowed)
# Add the SettingValue object to a SystemSettings object
system_settings = api.SystemSettings()
system_settings.platform_setting_active_sessions_max_num = max_sessions
# Repeat for the platform_setting_active_sessions_max_exceeded_action
exceed_action = api.SettingValue()
exceed_action.value = action
system_settings.platform_setting_active_sessions_max_exceeded_action = exceed_action
try:
    # Modify system settings on Deep Security Manager
    settings_api = api.SystemSettingsApi(api.ApiClient(configuration))
    return settings_api.modify_system_settings(system_settings, api_version)
except api_exception as e:
    return "Exception: " + str(e)
JavaScript

View source

// Create the settings value
const maxSessions = new api.SettingValue();
maxSessions.value = maxValue;= new api.SystemSettings();
systemSettings.platformSettingActiveSessionsMax = maxSessions;= new api.SettingValue();
exceedAction.value = action;
systemSettings.platformSettingActiveSessionsMaxExceededAction = exceedAction;= new api.SystemSettingsApi();
return systemSettingsApi.modifySystemSettings(systemSettings, apiVersion);
Java

View source

// Create the setting value for PlatformSettingActiveSessionsMax
SettingValue maxSessionsValue = new SettingValue();
maxSessionsValue.setValue(Integer.toString(maxSessions));= new SystemSettings();
systemSettings.setPlatformSettingActiveSessionsMax(maxSessionsValue);= new SettingValue();
maxSessionsExceededAction.setValue(exceedAction);
systemSettings.setPlatformSettingActiveSessionsMaxExceededAction(maxSessionsExceededAction);= new SystemSettingsApi();
return settingsApi.modifySystemSettings(systemSettings, apiVersion);

Also see the Modify System Settings operation in the API Reference. For information about authenticating API calls, see Authenticate with Deep Security Manager.