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. UseSettingValue
objects to access the values ofSystemSettings
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:
- Create a
SettingValue
object and set the value to the value that you want for the system setting. - Create a
SystemSettings
object and set the property to the SettingValue object. - Create a
SystemSettingsApi
object and use it to modify the system setting on Deep Security Manager according to theSystemSettings
object.
SettingValue
values are of type String. The following example creates a SettingValue
for a setting that you want to set to 100:
max_sessions = api.SettingValue() max_sessions.value = "100"
const maxSessions = new api.SettingValue(); maxSessions.value = "20";
SettingValue maxSessionsValue = new SettingValue(); maxSessionsValue.setValue(Integer.toString(maxSessions));
Use the SettingValue
as the value of a setting:
system_settings = api.SystemSettings() system_settings.platform_setting_active_sessions_max_num = max_sessions
const systemSettings = new api.SystemSettings(); systemSettings.platformSettingActiveSessionsMax = maxSessions;
SystemSettings systemSettings = new SystemSettings(); systemSettings.setPlatformSettingActiveSessionsMax(maxSessionsValue);
Finally, modify the setting on Deep Security Manager:
settings_api = api.SystemSettingsApi(api.ApiClient(configuration)) return settings_api.modify_system_settings(system_settings, api_version)
const systemSettingsApi = new api.SystemSettingsApi(); return systemSettingsApi.modifySystemSettings(systemSettings, apiVersion);
SystemSettingsApi settingsApi = new SystemSettingsApi(); return settingsApi.modifySystemSettings(systemSettings, apiVersion);
Example
The following example sets the system setting that controls the maximum number of sessions that a user can create.
# 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 # Modify system settings on Deep Security Manager settings_api = api.SystemSettingsApi(api.ApiClient(configuration)) return settings_api.modify_system_settings(system_settings, api_version)
// Create the settings value const maxSessions = new api.SettingValue(); maxSessions.value = "20"; // Create a SystemSettings object and set the setting value const systemSettings = new api.SystemSettings(); systemSettings.platformSettingActiveSessionsMax = maxSessions; // Modify the settings on Deep Security Manager const systemSettingsApi = new api.SystemSettingsApi(); return systemSettingsApi.modifySystemSettings(systemSettings, apiVersion);
// Create the setting value SettingValue maxSessionsValue = new SettingValue(); maxSessionsValue.setValue(Integer.toString(maxSessions)); // Create a SystemSettings object and set the property SystemSettings systemSettings = new SystemSettings(); systemSettings.setPlatformSettingActiveSessionsMax(maxSessionsValue); // Modify system settings on Deep Security Manager SystemSettingsApi settingsApi = 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.