Configure Deep Security Manager System Settings

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

The following SDK classes provide access to 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: Defines objects that hold a single string value. Use SettingValue objects to access the values of SystemSettings properties, which are of type SettingValue.
  • SystemSettingsApi: Enables you to list and modify system settings on Deep Security Manager.

General steps

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

  1. Create a SettingValue object and set the value to the value that you want for the system setting.
  2. Create a SystemSettings object and set the property to the SettingValue object.
  3. Create a SystemSettingsApi object and use it to modify the system setting 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 = "20";
Java
SettingValue maxSessionsValue = new SettingValue();
maxSessionsValue.setValue(Integer.toString(maxSessions));
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);
<\pre>

Example

The following example sets the system setting that controls the maximum number of sessions that a user can create.

Python

source

# Create the SettingValue object and set the max sessions value
max_sessions = api.SettingValue()
max_sessions.value = "100"

# Add the SettingValue object to a SystemSettings object
system_settings = api.SystemSettings()
system_settings.platform_setting_active_sessions_max_num = max_sessions

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

source

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

source

// Create the setting value
SettingValue maxSessionsValue = new SettingValue();
maxSessionsValue.setValue(Integer.toString(maxSessions));= new SystemSettings();
systemSettings.setPlatformSettingActiveSessionsMax(maxSessionsValue);= 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.