Automate Deep Security Deployments

Automate the deployment of Deep Security Agent and Deep Security Manager to quickly and reliably protect the assets in your environment.

Use the Deep Security deployment scripts

Trend Micro provides several utilities and scripts that you can adapt to your environments for deploying Deep Security Manager and Deep Security Agent. The deep-security GitHub repositories contain the following useful scripts:

  • CloudFormation templates for deploying Deep Security Manager to AWS.
  • Scripts that deploy the Deep Security VM Extension on Azure.
  • Ansible playbooks, Chef cookbooks, and Puppet manifests that deploy Deep Security Agent.
  • Elastic Beanstalk scripts that deploy Deep Securty Agent to AWS images.
  • Bash and Powershell scripts for automating various Agent and Manager tasks.

Scripts are also provided for automating typical tasks on Deep Security Manager and Agent.

You can use Deep Security Manager to generate deployment scripts for installing the agent locally. (See Use deployment scripts to add and protect computers in the Deep Security Help Center.)

See the README for each repository to discover the level of support that Trend Micro  provides for the script or utility.

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 SystemSettings endpoint enables you to list and modify system settings. Use the following general steps to use a client library to modify system settings:

  1. Create one or more SettingValue objects and set the desired value for them.
  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 setting on Deep Security Manager according to the SystemSettings object.

See also Configure Settings.

Example: Set the maximum number of sessions for a user

Python
def configure_system_settings(client, configuration, api_version, api_exception):
    """ Configures the maximum number of active sessions. Demonstrates how to
    configure system properties.

    :param client: The Deep Security API modules.
    :param configuration: Configuration object to pass to the client.
    :param api_version: The version of the API to use.
    :param api_exception: The Deep Security API exception module.
    :return: A SystemSettingsApi object that contains the ID of the updated system settings.
    """

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

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

    try:
        # Modify system settings on Deep Security Manager
        settings_api = client.SystemSettingsApi(client.ApiClient(configuration))
        return settings_api.modify_system_settings(system_settings, api_version)

    except api_exception as e:
        return "Exception: " + str(e)
Javascript
/*
* Configures the maximum number of active sessions.
* Demonstrates how to configure system properties.
* @param {object} api The api module.
* @param {String} apiVersion The api version to use.
* @returs {Promise} The promise that SystemSettingsApi.modifySystemSettings returns. 
*/
exports.configureSystemSettings = function(api, apiVersion) {

    // Create the settings value
    const maxSessions = new api.SettingValue();
    maxSessions.value = "20";

    // Cretae 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);
};
Java
/*
 * Configures the maximum number of active sessions. 
 * Demonstrates how to configure system properties.
 */
public static void configureSystemSettings() {

    //Create the setting value
    SettingValue maxSessions = new SettingValue();
    maxSessions.setValue("20");
    
    //Create a SystemSettings object and set the property
    SystemSettings systemSettings = new SystemSettings();
    systemSettings.setPlatformSettingActiveSessionsMax(maxSessions);
    
    //Modify system settings on Deep Security Manager
    SystemSettingsApi settingsApi = new SystemSettingsApi();
    try {
        settingsApi.modifySystemSettings(systemSettings, "v1");
    } catch (ApiException e) {
        e.printStackTrace();
    }
}

For information about authenticating API calls, see Authenticate with Deep Security Manager.