Create policy
Service endpoint | /policies/v2 |
Optional query string parameters | — |
Example | https://protectapi.cylance.com/policies/v2 |
Method | HTTP/1.1 POST |
Request headers |
|
Request
The following example creates a policy with most features enabled and includes some sample exclusions. You can copy this example, change the user_id, and this should create an example policy in your tenant.
This example is provided just for testing the API. Do not use this example policy on your devices. Device policies should be tested before applying to a large number of devices in your organization.
"policy_name": "testPolicy", "script_control": { "activescript_settings": { "control_mode": "Alert", "control_mode_v2":"BlockAbnormal" }, "global_settings": { "allowed_folders": ["/path.py"], "allowed_folders_ext": [ { "comment": "any test 200 chars long" } ], "control_mode": "Alert", "score_all_scripts": false, "upload_script_to_cloud": false, "must_obtain_score_from_cloud": false, "alert_suspicious_script_exec_only": false }, "macro_settings": { "control_mode": "Alert" }, "powershell_settings": { "control_mode": "Block", "console_mode": "Block", "control_mode_v2":"BlockAbnormal" } }
Response
Please see the Response status codes for more information.
Request JSON schema
Field Name | Description |
---|---|
checksum | Checksum is required when creating a policy. This uses an empty value. Example:
|
device_control | Device Control allows or blocks access to USB mass storage devices. device_control must be enabled under policy . All device_class entries must be included in the request.
Device control exclusion list allows or blocks access to specific USB mass storage devices.
One way to find the Vendor ID for a USB mass storage device is to enable Device Control in a policy, assign that policy to an endpoint, then attach the USB mass storage device to the endpoint. You can view External Device logs in the management console, on the Protection page or the Device Details page (External Devices tab). Example:
|
file_exclusions | This adds file exclusions to the policy safe list, under file actions. Policy safe list are file exclusions specific to the policy, and any endpoints assigned to the policy will allow the excluded files to run.
Example:
|
filetype_actions | These actions indicate the autoquarantine of unsafe and abnormal files.
|
logpolicy | These are the agent log file settings.
|
memoryviolation _actions | These are the violation types for memory protection. The following 3 rows explain the possible violation types: |
memory_violations |
|
memory_violations _ext |
|
memory_violations _ext_v2 |
|
memory_exclusion _list_v2 | These are the executable files to exclude from Memory Protection. This must be a relative path to the excluded executable file. Example:
|
policy | Various policy settings are contained within this section. Some policy settings are enabled under policy and configured in a different section, like device_control and logpolicy. For most policy settings, the possible values will be either 0 (disabled) or 1 (enabled). The remaining cells in this table explain policy settings in detail. |
Automatic policy settings |
|
Various policy settings |
|
Various policy settings continued |
|
Optics policy settings |
|
policy_name | This is the name of the policy. The name must be unique to your tenant. |
script_control | The policy settings for script control. script_control must be enabled (set to "1") under policy. activescript_settings
global_settings
|
macro_settings
| |
script_control continued | About disabling script control For Agent versions 1430 and later, you can disable script control for active script, PowerShell, or macros. Disabling script control allows the selected script type to run and does not send an alert to the console. To disable script control for a specific script type, do not include the script type in the create policy API request. For example: script control for macros is disabled.
|
user_id | This is the unique ID for the user creating the policy. Only administrators can create policies. To get the user_id, use Get users. |
Response JSON schema
This table only covers descriptions not covered in the Request JSON Schema Descriptions table (see previous table).
Field Name | Description |
---|---|
policy_id | This is the unique identifier for the policy. |
policy_utctimestamp | This is the date and time (in UTC) when the policy was created. |