Kaspersky Security Center
Manages endpoints and groups through the Kaspersky Security Center.
Endpoint · Kaspersky Security Center
Details
| ID | Kaspersky Security Center |
|---|---|
| Provider | Kaspersky Lab |
| Category | Endpoint |
| From Version | 5.5.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Supported Modules | Agentix XSIAM |
README
The administration console for controlling all Kaspersky Lab security solutions and system administration tools.
This integration was integrated and tested with version 12 of Kaspersky Security Center.
Note: The integration is in beta because it only covers a subset of the endpoints and API use cases.
Prerequisites
The user should be assigned to a role with the relevant devices in scope, and the following access rights:
- Basic functionality - Read
-
Management of administration groups - Modify

Configure Kaspersky Security Center in Cortex
| Parameter | Required |
|---|---|
| Server URL (e.g., https://kaspersky.domain.com:13299) | True |
| Username | True |
| Password | True |
| Trust any certificate (not secure) | False |
| Use system proxy settings | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
ksc-hosts-list
Returns a list of hosts.
Base Command
ksc-hosts-list
Input
| Argument Name | Description | Required | |
|---|---|---|---|
| filter | Filter which contains a condition over host attributes, e.g., KLHST_WKS_OS_NAME = “Microsoft Windows Server 2016”. See the integration documentation for the search filter syntax. | Optional | |
| limit | The maximum number of hosts to return. Default is 50. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Host.KLHST_WKS_DN | String | Host display name. |
| KasperskySecurityCenter.Host.KLHST_WKS_DNSDOMAIN | String | DNS suffix. |
| KasperskySecurityCenter.Host.KLHST_WKS_DNSNAME | String | DNS name without DNS suffix. |
| KasperskySecurityCenter.Host.KLHST_WKS_FQDN | String | Host FQDN name. |
| KasperskySecurityCenter.Host.KLHST_WKS_GROUPID | String | ID of administration group where host is located. |
| KasperskySecurityCenter.Host.KLHST_WKS_HOSTNAME | String | Host name ID. |
| KasperskySecurityCenter.Host.KLHST_WKS_OS_NAME | String | Operating system name. |
Command Example
!ksc-hosts-list filter=KLHST_WKS_OS_NAME = "Microsoft Windows Server 2016"
Context Example
{
"KasperskySecurityCenter": {
"Host": {
"KLHST_WKS_DN": "EC2AMAZ-U66K3KL",
"KLHST_WKS_DNSDOMAIN": "eu-west-2.compute.internal",
"KLHST_WKS_DNSNAME": "ip-172-32-34-237",
"KLHST_WKS_FQDN": "ip-172-32-34-237.eu-west-2.compute.internal",
"KLHST_WKS_GROUPID": 0,
"KLHST_WKS_HOSTNAME": "4328e16f-bf83-47c3-8d0b-0fdf79f9d673",
"KLHST_WKS_OS_NAME": "Microsoft Windows Server 2016"
}
}
}
Human Readable Output
Hosts List
KLHST_WKS_HOSTNAME KLHST_WKS_DN KLHST_WKS_OS_NAME KLHST_WKS_FQDN 4328e16f-bf83-47c3-8d0b-0fdf79f9d673 EC2AMAZ-U66K3JK Microsoft Windows Server 2016 ip-172-32-34-237.eu-west-2.compute.internal
ksc-host-get
Returns details of a host
Base Command
ksc-host-get
Input
| Argument Name | Description | Required |
|---|---|---|
| hostname | The unique hostname GUID to retrieve the details of. Can be retrieved using the ksc-hosts-list command. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Endpoint.ID | String | The unique ID within the tool retrieving the endpoint. |
| Endpoint.OS | String | Endpoint OS. |
| Endpoint.Hostname | String | The hostname that is mapped to this endpoint. |
| Endpoint.Domain | String | The domain of the endpoint. |
| KasperskySecurityCenter.Host.KLHST_WKS_DN | String | Host display name. |
| KasperskySecurityCenter.Host.KLHST_INSTANCEID | String | Network agent ID. |
| KasperskySecurityCenter.Host.KLHST_WKS_DNSDOMAIN | String | DNS suffix. |
| KasperskySecurityCenter.Host.KLHST_WKS_DNSNAME | String | DNS name without DNS suffix. |
| KasperskySecurityCenter.Host.KLHST_WKS_FQDN | String | Host FQDN name. |
| KasperskySecurityCenter.Host.KLHST_WKS_GROUPID | String | ID of administration group where host is located. |
| KasperskySecurityCenter.Host.KLHST_WKS_HOSTNAME | String | Host name ID. |
| KasperskySecurityCenter.Host.KLHST_WKS_OS_NAME | String | Operating system name. |
| KasperskySecurityCenter.Host.KLHST_WKS_ANTI_SPAM_STATUS | Number | Product component status. |
| KasperskySecurityCenter.Host.KLHST_WKS_COLLAB_SRVS_STATUS | Number | Collaboration servers protection status. |
| KasperskySecurityCenter.Host.KLHST_WKS_CPU_ARCH | Number | CPU architecture from the operating system point of view (since KSC 10 SP1). |
| KasperskySecurityCenter.Host.KLHST_WKS_CREATED.value | Date | Time of host record creation. |
| KasperskySecurityCenter.Host.KLHST_WKS_CTYPE | Number | Computer type. |
| KasperskySecurityCenter.Host.KLHST_WKS_DLP_STATUS | Number | DLP status. |
| KasperskySecurityCenter.Host.KLHST_WKS_EDR_STATUS | Number | EDR component status. |
| KasperskySecurityCenter.Host.KLHST_WKS_LAST_VISIBLE.value | Date | Last host visibility time. |
| KasperskySecurityCenter.Host.KLHST_WKS_NAG_VERSION | String | Network agent build number in format A.B.C[.D]. |
| KasperskySecurityCenter.Host.KLHST_WKS_NAG_VER_ID | Number | Network Agent version ID. |
| KasperskySecurityCenter.Host.KLHST_WKS_OSSP_VER_MAJOR | Number | Service Pack version major part (since KSC 10 SP1). |
| KasperskySecurityCenter.Host.KLHST_WKS_OSSP_VER_MINOR | Number | Service Pack version minor part (since KSC 10 SP1). |
| KasperskySecurityCenter.Host.KLHST_WKS_OS_BUILD_NUMBER | Number | Operating system version build number. |
| KasperskySecurityCenter.Host.KLHST_WKS_OS_RELEASE_ID | Number | Operating system version release ID (for Windows 10). |
| KasperskySecurityCenter.Host.KLHST_WKS_OWNER_IS_CUSTOM | Boolean | If owner was changed via UpdateHostwith KLHST_WKS_CUSTOM_OWNER_ID. |
| KasperskySecurityCenter.Host.KLHST_WKS_PTYPE | Number | Platform type. |
| KasperskySecurityCenter.Host.KLHST_WKS_RBT_REQUEST_REASON | Number | Reboot request reasons mask. |
| KasperskySecurityCenter.Host.KLHST_WKS_RBT_REQUIRED | Boolean | If reboot is required. |
| KasperskySecurityCenter.Host.KLHST_WKS_RTP_AV_BASES_TIME.value | Date | Anti-virus bases time. |
| KasperskySecurityCenter.Host.KLHST_WKS_RTP_AV_VERSION | String | Protection build number in format A.B.C[.D]. |
| KasperskySecurityCenter.Host.KLHST_WKS_STATUS | Number | Host status. |
Command Example
!ksc-host-get hostname="4328e16f-bf83-47c3-8d0b-0fdf79f9d673"
Context Example
{
"Endpoint": {
"ID": "4328e16f-bf83-47c3-8d0b-0fdf79f9d673",
"OS": "Microsoft Windows Server 2016",
"Hostname": "EC2AMAZ-U66K3L",
"Domain": "eu-west-2.compute.internal"
},
"KasperskySecurityCenter": {
"Host": {
"KLHST_INSTANCEID": "025ed285-389b-44c5-a9ef-6e723f7d9466",
"KLHST_WKS_ANTI_SPAM_STATUS": 0,
"KLHST_WKS_COLLAB_SRVS_STATUS": 0,
"KLHST_WKS_CPU_ARCH": 2,
"KLHST_WKS_CREATED": {
"type": "datetime",
"value": "2021-02-23T10:14:33Z"
},
"KLHST_WKS_CTYPE": 36871,
"KLHST_WKS_DLP_STATUS": 0,
"KLHST_WKS_DN": "EC2AMAZ-U66K3L",
"KLHST_WKS_DNSDOMAIN": "eu-west-2.compute.internal",
"KLHST_WKS_DNSNAME": "ip-172-32-34-237",
"KLHST_WKS_EDR_STATUS": 0,
"KLHST_WKS_EMAIL_AV_STATUS": 0,
"KLHST_WKS_FQDN": "ip-172-32-34-237.eu-west-2.compute.internal",
"KLHST_WKS_GROUPID": 0,
"KLHST_WKS_HOSTNAME": "4328e16f-bf83-47c3-8d0b-0fdf79f9d673",
"KLHST_WKS_LAST_VISIBLE": {
"type": "datetime",
"value": "2021-03-23T08:55:52Z"
},
"KLHST_WKS_NAG_VERSION": "12.2.0.4376",
"KLHST_WKS_NAG_VER_ID": 786434,
"KLHST_WKS_OSSP_VER_MAJOR": 0,
"KLHST_WKS_OSSP_VER_MINOR": 0,
"KLHST_WKS_OS_BUILD_NUMBER": 14393,
"KLHST_WKS_OS_NAME": "Microsoft Windows Server 2016",
"KLHST_WKS_OS_RELEASE_ID": 1607,
"KLHST_WKS_OWNER_IS_CUSTOM": false,
"KLHST_WKS_PTYPE": 2,
"KLHST_WKS_RBT_REQUEST_REASON": 0,
"KLHST_WKS_RBT_REQUIRED": false,
"KLHST_WKS_RTP_AV_BASES_TIME": {
"type": "datetime",
"value": "2021-03-23T00:19:00Z"
},
"KLHST_WKS_RTP_AV_VERSION": "11.5.0.590",
"KLHST_WKS_STATUS": 29
}
}
}
Human Readable Output
Host 4328e16f-bf83-47c3-8d0b-0fdf79f9d673
KLHST_WKS_HOSTNAME KLHST_WKS_OS_NAME KLHST_WKS_FQDN KLHST_WKS_DN KLHST_WKS_NAG_VERSION 4328e16f-bf83-47c3-8d0b-0fdf79f9d673 Microsoft Windows Server 2016 ip-172-32-34-237.eu-west-2.compute.internal EC2AMAZ-U66K3L 12.2.0.4376
ksc-groups-list
Returns a list of groups.
Base Command
ksc-groups-list
Input
| Argument Name | Description | Required |
|---|---|---|
| filter | Filter which contains a condition over group attributes, e.g., name = “Managed devices”. See the integration documentation for the search filter syntax. | Optional |
| limit | The maximum number of groups to return. Default is 50. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Group.id | Number | Group ID. |
| KasperskySecurityCenter.Group.name | String | Group name. |
Command Example
!ksc-groups-list filter=name = "Managed devices"
Context Example
{
"KasperskySecurityCenter": {
"Group": {
"id": 0,
"name": "Managed devices"
}
}
}
Human Readable Output
Groups List
id name 0 Managed devices
ksc-group-add
Create new administration group.
Base Command
ksc-group-add
Input
| Argument Name | Description | Required |
|---|---|---|
| name | The name of the group to add. | Required |
| parent_id | ID of group under which to create the group. Can be retrieved using the ksc-groups-list command. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Group.id | Number | Group ID. |
| KasperskySecurityCenter.Group.name | String | Group name. |
Command Example
!ksc-group-add name="Assigned Devices" parent_id=1
Context Example
{
"KasperskySecurityCenter": {
"Group": {
"id": 10,
"name": "Assigned Devices"
}
}
}
Human Readable Output
Group was added successfully
id name 10 Assigned Devices
ksc-group-delete
Deletes an administrative group.
Base Command
ksc-group-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| group_id | ID of group to delete. Can be retrieved using the ksc-groups-list command. | Required |
| flags | 1 = Delete group only if it is empty, 2 = delete group with subgroups, policies and tasks 3 = delete group with subgroups, hosts, policies and tasks. Possible values are: 1, 2, 3. Default is 1. | Optional |
Context Output
There is no context output for this command.
Command Example
!ksc-group-delete group_id=10 flags=1
Human Readable Output
Delete group action was submitted
ksc-software-applications-list
Returns limited attributes for all software applications.
Base Command
ksc-software-applications-list
Input
There are no input arguments for this command.
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Inventory.Software.ARPRegKey | String | Subkey for application under registry key for list of add-remove progamms. |
| KasperskySecurityCenter.Inventory.Software.Comments | String | Software application comments. |
| KasperskySecurityCenter.Inventory.Software.DisplayName | String | Software application display name. |
| KasperskySecurityCenter.Inventory.Software.DisplayVersion | String | Software application display version. |
| KasperskySecurityCenter.Inventory.Software.ProductID | String | Software application product ID. |
| KasperskySecurityCenter.Inventory.Software.Publisher | String | Software application publisher. |
Command Example
#### Context Example
```json
{
"KasperskySecurityCenter": {
"Inventory": {
"Software": [
{
"ARPRegKey": "{E8C99927-8E6E-4B6B-B80C-1B8B23B1767D}",
"CleanerProductName": "",
"Comments": "",
"DisplayName": "Microsoft SQL Server 2014 Transact-SQL ScriptDom ",
"DisplayVersion": "12.2.5000.0",
"HelpLink": "http://search.microsoft.com",
"HelpTelephone": "",
"InstallDate": "",
"InstallDir": "",
"LangId": 1033,
"PackageCode": "",
"ProductID": "03820C7E0D0202C290E1ED29F77E75F0",
"Publisher": "Microsoft Corporation",
"QuietUninstallString": "",
"UninstallString": "",
"VapmBuild": {
"type": "long",
"value": 0
},
"bIsMsi": true
},
{
"ARPRegKey": "{8CCB15BC-2D37-49A3-BF21-6D030D822CEA}",
"CleanerProductName": "",
"Comments": "",
"DisplayName": "Plug-in for Microsoft Exchange ActiveSync",
"DisplayVersion": "12.0.0.7734",
"HelpLink": "",
"HelpTelephone": "",
"InstallDate": "",
"InstallDir": "",
"LangId": 0,
"PackageCode": "",
"ProductID": "1F2C9666BE2192456F484CA31F0371F3",
"Publisher": "Kaspersky",
"QuietUninstallString": "",
"UninstallString": "",
"VapmBuild": {
"type": "long",
"value": 0
},
"bIsMsi": false
}
]
}
}
}
Human Readable Output
Inventory Software Applications
DisplayName Publisher DisplayVersion Microsoft SQL Server 2014 Transact-SQL ScriptDom Microsoft Corporation 12.2.5000.0 Plug-in for Microsoft Exchange ActiveSync Kaspersky 12.0.0.7734
ksc-software-patches-list
Returns limited attributes for all software application updates.
Base Command
ksc-software-patches-list
Input
There are no input arguments for this command.
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Inventory.Patch.Classification | String | Classification of the update. |
| KasperskySecurityCenter.Inventory.Patch.Comments | String | Software application patch comments. |
| KasperskySecurityCenter.Inventory.Patch.DisplayName | String | Software application patch display name. |
| KasperskySecurityCenter.Inventory.Patch.DisplayVersion | String | Software application patch display version. |
| KasperskySecurityCenter.Inventory.Patch.PatchID | String | Software application patch ID. |
| KasperskySecurityCenter.Inventory.Patch.Publisher | String | Software application patch publisher. |
Command Example
#### Context Example
```json
{
"KasperskySecurityCenter": {
"Inventory": {
"Patch": [
{
"Classification": "",
"Comments": "",
"DisplayName": "Service Pack 2 for SQL Server 2014 (KB3171021) (64-bit)",
"DisplayVersion": "12.2.5000.0",
"HelpLink": "http://support.microsoft.com/?kbid=3171021",
"HelpTelephone": "",
"InstallDate": "",
"MoreInfoURL": "",
"ParentID": "",
"PatchID": "63EC6F65A3D1E99FB87FB0B206EED9D1",
"Publisher": "Microsoft Corporation",
"QuietUninstallString": "",
"UninstallString": "",
"bIsMsi": false
},
{
"Classification": "Update",
"Comments": "",
"DisplayName": "Update (KB3176936)",
"DisplayVersion": "",
"HelpLink": "http://support.microsoft.com/?kbid=3176936",
"HelpTelephone": "",
"InstallDate": "",
"MoreInfoURL": "",
"ParentID": "",
"PatchID": "KB3176936",
"Publisher": "Microsoft Windows",
"QuietUninstallString": "",
"UninstallString": "",
"bIsMsi": false
}
]
}
}
}
Human Readable Output
Inventory Software Patches
DisplayName Publisher DisplayVersion Service Pack 2 for SQL Server 2014 (KB3171021) (64-bit) Microsoft Corporation 12.2.5000.0 Update (KB3176936) Microsoft Windows
ksc-host-software-applications-list
Retrieve software applications for a host.
Base Command
ksc-host-software-applications-list
Input
| Argument Name | Description | Required |
|---|---|---|
| hostname | The unique hostname GUID to retrieve the software applications of. Can be retrieved using the ksc-hosts-list command. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Host.Software.ARPRegKey | String | Subkey for application under registry key for list of add-remove progamms. |
| KasperskySecurityCenter.Host.Software.Comments | String | Software application comments. |
| KasperskySecurityCenter.Host.Software.DisplayName | String | Software application display name. |
| KasperskySecurityCenter.Host.Software.DisplayVersion | String | Software application display version. |
| KasperskySecurityCenter.Host.Software.ProductID | String | Software application product ID. |
| KasperskySecurityCenter.Host.Software.Publisher | String | Software application publisher. |
Command Example
!ksc-host-software-applications-list hostname=4328e16f-bf83-47c3-8d0b-0fdf79f9d673
Context Example
{
"KasperskySecurityCenter": {
"Host": {
"Software": [
{
"ARPRegKey": "{E8C99927-8E6E-4B6B-B80C-1B8B23B1767D}",
"CleanerProductName": "",
"Comments": "",
"DisplayName": "Microsoft SQL Server 2014 Transact-SQL ScriptDom ",
"DisplayVersion": "12.2.5000.0",
"HelpLink": "http://search.microsoft.com",
"HelpTelephone": "",
"InstallDate": "20210223",
"InstallDir": "",
"InstanceID": {
"type": "binary",
"value": "AA=="
},
"LangId": 1033,
"PackageCode": "",
"ProductID": "03820C7E0D0202C290E1ED29F77E75F0",
"Publisher": "Microsoft Corporation",
"QuietUninstallString": "msiexec.exe /X {E8C99927-8E6E-4B6B-B80C-1B8B23B1767D} /quiet /norestart",
"UninstallString": "MsiExec.exe /I{E8C99927-8E6E-4B6B-B80C-1B8B23B1767D}",
"VapmBuild": {
"type": "long",
"value": 0
},
"bIsMsi": true
},
{
"ARPRegKey": "{8CCB15BC-2D37-49A3-BF21-6D030D822CEA}",
"CleanerProductName": "",
"Comments": "",
"DisplayName": "Plug-in for Microsoft Exchange ActiveSync",
"DisplayVersion": "12.0.0.7734",
"HelpLink": "",
"HelpTelephone": "",
"InstallDate": "20210223",
"InstallDir": "C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security Center\\Plugins\\",
"InstanceID": {
"type": "binary",
"value": "AA=="
},
"LangId": 0,
"PackageCode": "",
"ProductID": "1F2C9666BE2192456F484CA31F0371F3",
"Publisher": "Kaspersky",
"QuietUninstallString": "msiexec.exe /X {8CCB15BC-2D37-49A3-BF21-6D030D822CEA} /quiet /norestart",
"UninstallString": "MsiExec.exe /X{8CCB15BC-2D37-49A3-BF21-6D030D822CEA}",
"VapmBuild": {
"type": "long",
"value": 0
},
"bIsMsi": false
}
]
}
}
}
Human Readable Output
Host 4328e16f-bf83-47c3-8d0b-0fdf79f9d673 Software Applications
DisplayName Publisher DisplayVersion Microsoft SQL Server 2014 Transact-SQL ScriptDom Microsoft Corporation 12.2.5000.0 Plug-in for Microsoft Exchange ActiveSync Kaspersky 12.0.0.7734
ksc-host-software-patches-list
Retrieves patches for a host.
Base Command
ksc-host-software-patches-list
Input
| Argument Name | Description | Required |
|---|---|---|
| hostname | The unique hostname GUID to retrieve the software patches of. Can be retrieved using the ksc-hosts-list command. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Host.Patch.Classification | String | Classification of the update. |
| KasperskySecurityCenter.Host.Patch.Comments | String | Software application patch comments. |
| KasperskySecurityCenter.Host.Patch.DisplayName | String | Software application patch display name. |
| KasperskySecurityCenter.Host.Patch.DisplayVersion | String | Software application patch display version. |
| KasperskySecurityCenter.Host.Patch.PatchID | String | Software application patch ID. |
| KasperskySecurityCenter.Host.Patch.Publisher | String | Software application patch publisher. |
Command Example
!ksc-host-software-patches-list hostname=4328e16f-bf83-47c3-8d0b-0fdf79f9d673
Context Example
{
"KasperskySecurityCenter": {
"Host": {
"Patch": [
{
"Classification": "",
"Comments": "",
"DisplayName": "Service Pack 2 for SQL Server 2014 (KB3171021) (64-bit)",
"DisplayVersion": "12.2.5000.0",
"HelpLink": "http://support.microsoft.com/?kbid=3171021",
"HelpTelephone": "",
"InstallDate": "",
"MoreInfoURL": "",
"ParentID": "F1ACBE9BCAB229A280C0C7F64FC45600",
"PatchID": "63EC6F65A3D1E99FB87FB0B206EED9D1",
"Publisher": "Microsoft Corporation",
"QuietUninstallString": "",
"UninstallString": "",
"bIsMsi": false
},
{
"Classification": "Update",
"Comments": "",
"DisplayName": "Update (KB3176936)",
"DisplayVersion": "",
"HelpLink": "http://support.microsoft.com/?kbid=3176936",
"HelpTelephone": "",
"InstallDate": "",
"MoreInfoURL": "",
"ParentID": "FDDE89CD0E6BCE9BD4CAAB06897AAF74",
"PatchID": "KB3176936",
"Publisher": "Microsoft Windows",
"QuietUninstallString": "",
"UninstallString": "",
"bIsMsi": false
}
]
}
}
}
Human Readable Output
Host 4328e16f-bf83-47c3-8d0b-0fdf79f9d673 Software Patches
DisplayName Publisher DisplayVersion Service Pack 2 for SQL Server 2014 (KB3171021) (64-bit) Microsoft Corporation 12.2.5000.0 Update (KB3176936) Microsoft Windows
ksc-policies-list
Returns policies located in specified group.
Base Command
ksc-policies-list
Input
| Argument Name | Description | Required |
|---|---|---|
| group_id | ID of group to retrieve the policies of. Can be retrieved using the ksc-groups-list command. Set to -1 to retrieve policies of all groups. Default is -1. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Policy.KLPOL_ACTIVE | Boolean | Whether the policy is active. |
| KasperskySecurityCenter.Policy.KLPOL_CREATED.value | Date | Policy creation date. |
| KasperskySecurityCenter.Policy.KLPOL_MODIFIED.value | Date | Policy modification date. |
| KasperskySecurityCenter.Policy.KLPOL_DN | String | Policy display name. |
| KasperskySecurityCenter.Policy.KLPOL_PRODUCT | String | Policy product name. |
| KasperskySecurityCenter.Policy.KLPOL_VERSION | String | Policy product version. |
| KasperskySecurityCenter.Policy.KLPOL_GROUP_ID | Number | Policy group ID. |
| KasperskySecurityCenter.Policy.KLPOL_ID | Number | Policy ID. |
Command Example
!ksc-policies-list group_id=0
Context Example
{
"KasperskySecurityCenter": {
"Policy": [
{
"KLPOL_ACCEPT_PARENT": true,
"KLPOL_ACTIVE": true,
"KLPOL_CREATED": {
"type": "datetime",
"value": "2021-02-25T08:14:39Z"
},
"KLPOL_DN": "Kaspersky Endpoint Security for Windows (11.5.0)",
"KLPOL_FORCED": false,
"KLPOL_FORCE_DISTRIB2CHILDREN": false,
"KLPOL_GROUP_ID": 0,
"KLPOL_GROUP_NAME": "Managed devices",
"KLPOL_GSYN_ID": 13,
"KLPOL_HIDE_ON_SLAVES": false,
"KLPOL_ID": 1,
"KLPOL_INHERITED": false,
"KLPOL_MODIFIED": {
"type": "datetime",
"value": "2021-02-25T08:14:43Z"
},
"KLPOL_PRODUCT": "KES",
"KLPOL_PROFILES_NUM": 0,
"KLPOL_ROAMING": false,
"KLPOL_VERSION": "11.0.0.0"
},
{
"KLPOL_ACCEPT_PARENT": true,
"KLPOL_ACTIVE": true,
"KLPOL_CREATED": {
"type": "datetime",
"value": "2021-02-25T08:14:44Z"
},
"KLPOL_DN": "Kaspersky Security Center Network Agent",
"KLPOL_FORCED": false,
"KLPOL_FORCE_DISTRIB2CHILDREN": false,
"KLPOL_GROUP_ID": 0,
"KLPOL_GROUP_NAME": "Managed devices",
"KLPOL_GSYN_ID": 14,
"KLPOL_HIDE_ON_SLAVES": false,
"KLPOL_ID": 2,
"KLPOL_INHERITED": false,
"KLPOL_MODIFIED": {
"type": "datetime",
"value": "2021-02-25T08:14:44Z"
},
"KLPOL_PRODUCT": "1103",
"KLPOL_PROFILES_NUM": 0,
"KLPOL_ROAMING": false,
"KLPOL_VERSION": "1.0.0.0"
}
]
}
}
Human Readable Output
Policies List
KLPOL_ID KLPOL_DN KLPOL_PRODUCT KLPOL_VERSION 1 Kaspersky Endpoint Security for Windows (11.5.0) KES 11.0.0.0 2 Kaspersky Security Center Network Agent 1103 1.0.0.0
ksc-policy-get
Retrieves data for specified policy.
Base Command
ksc-policy-get
Input
| Argument Name | Description | Required |
|---|---|---|
| policy_id | ID of policy to retrieve details of. Can be retrieved using the ksc-policies-list command. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| KasperskySecurityCenter.Policy.KLPOL_ACTIVE | Boolean | Whether the policy is active. |
| KasperskySecurityCenter.Policy.KLPOL_CREATED.value | Date | Policy creation date. |
| KasperskySecurityCenter.Policy.KLPOL_MODIFIED.value | Date | Policy modification date. |
| KasperskySecurityCenter.Policy.KLPOL_DN | String | Policy display name. |
| KasperskySecurityCenter.Policy.KLPOL_PRODUCT | String | Policy product name. |
| KasperskySecurityCenter.Policy.KLPOL_VERSION | String | Policy product version. |
| KasperskySecurityCenter.Policy.KLPOL_GROUP_ID | Number | Policy group ID. |
| KasperskySecurityCenter.Policy.KLPOL_ID | Number | Policy ID. |
Command Example
!ksc-policy-get policy_id=1
Context Example
{
"KasperskySecurityCenter": {
"Policy": {
"KLPOL_ACCEPT_PARENT": true,
"KLPOL_ACTIVE": true,
"KLPOL_CREATED": {
"type": "datetime",
"value": "2021-02-25T08:14:39Z"
},
"KLPOL_DN": "Kaspersky Endpoint Security for Windows (11.5.0)",
"KLPOL_FORCED": false,
"KLPOL_FORCE_DISTRIB2CHILDREN": false,
"KLPOL_GROUP_ID": 0,
"KLPOL_GROUP_NAME": "Managed devices",
"KLPOL_GSYN_ID": 13,
"KLPOL_HIDE_ON_SLAVES": false,
"KLPOL_ID": 1,
"KLPOL_INHERITED": false,
"KLPOL_MODIFIED": {
"type": "datetime",
"value": "2021-02-25T08:14:43Z"
},
"KLPOL_PRODUCT": "KES",
"KLPOL_ROAMING": false,
"KLPOL_VERSION": "11.0.0.0"
}
}
}
Human Readable Output
Policy 1
KLPOL_ID KLPOL_DN KLPOL_PRODUCT KLPOL_VERSION 1 Kaspersky Endpoint Security for Windows (11.5.0) KES 11.0.0.0
Search Filter Syntax
A number of commands are using a search filter that has syntax resembling one from RFC 2254.
filter = "(" filtercomp ")"
filtercomp = and / or / not / item
and = "&" filterlist
or = "|" filterlist
not = "!" filter
filterlist = 1*filter
item = simple
simple = attr filtertype value
filtertype = equal / greater / less / notequal
equal = "="
greater = ">"
less = "<"
notequal = "<>"
attr = AttributeDescription
value = Integer / Quoted string / UTC time / Binary
- Integer must be provided as signed decimal.
-
Quoted string may contain following wildcards. If ‘value’ in ‘simple’ has wildcards then ‘filtertype’ must be ‘equal’
Wildcard Description ? Any single character. * Any string of zero or more characters. [ ] Any single character within the specified range ([a-f]) or set ([abcdef]). [^] Any single character not within the specified range ([^a-f]) or set ([^abcdef]). - UTC time can be specified either in absolute or relative format. Absolute format: T”YYYY-MM-DD hh:mm:ss” Example: T”2005-04-27 23:59:01” To specify UTC time in relative format the ‘Pseudovalue’ CURTIME([<signed integer delta>]) may be used as “current time (in UTC) + <signed integer delta>”
- Binary must be provided as hex with ‘0x’ prefix. For example, 0xF41748C0BEF943a6AE2C5D1010F046A.
Configuration parameters
server— Server URL (e.g., https://kaspersky.domain.com:13299) (required)credentials— Username (required)insecure— Trust any certificate (not secure)proxy— Use system proxy settings
Commands (11)
-
ksc-group-addCreate new administration group.
-
ksc-group-deleteDeletes an administrative group.
-
ksc-groups-listReturns a list of groups.
-
ksc-host-getReturns details of a host.
-
ksc-host-software-applications-listRetrieve software applications for a host.
-
ksc-host-software-patches-listRetrieves patches for a host.
-
ksc-hosts-listReturns a list of hosts.
-
ksc-policies-listReturns policies located in specified group.
-
ksc-policy-getRetrieves data for specified policy.
-
ksc-software-applications-listReturns limited attributes for all software applications.
-
ksc-software-patches-listReturns limited attributes for all software application updates.
import demistomock as demisto import urllib3 from CommonServerPython import * from CommonServerUserPython import * urllib3.disable_warnings() HOST_FIELDS = [ "KLHST_WKS_FQDN", "KLHST_WKS_DNSNAME", "KLHST_WKS_HOSTNAME", "KLHST_WKS_OS_NAME", "KLHST_WKS_GROUPID", "KLHST_WKS_DNSDOMAIN", "KLHST_WKS_DN", ] HOST_DETAILED_FIELDS = [ "KLHST_WKS_DN", "KLHST_WKS_GROUPID", "KLHST_WKS_CREATED", "KLHST_WKS_LAST_VISIBLE", "KLHST_WKS_STATUS", "KLHST_WKS_HOSTNAME", "KLHST_INSTANCEID", "KLHST_WKS_DNSDOMAIN", "KLHST_WKS_DNSNAME", "KLHST_WKS_FQDN", "KLHST_WKS_CTYPE", "KLHST_WKS_PTYPE", "KLHST_WKS_OS_NAME", "KLHST_WKS_COMMENT", "KLHST_WKS_NAG_VERSION", "KLHST_WKS_RTP_AV_VERSION", "KLHST_WKS_RTP_AV_BASES_TIME", "KLHST_WKS_RBT_REQUIRED", "KLHST_WKS_RBT_REQUEST_REASON", "KLHST_WKS_OSSP_VER_MAJOR", "KLHST_WKS_OSSP_VER_MINOR", "KLHST_WKS_CPU_ARCH", "KLHST_WKS_OS_BUILD_NUMBER", "KLHST_WKS_OS_RELEASE_ID", "KLHST_WKS_NAG_VER_ID", "KLHST_WKS_OWNER_ID", "KLHST_WKS_OWNER_IS_CUSTOM", "KLHST_WKS_CUSTOM_OWNER_ID", "KLHST_WKS_ANTI_SPAM_STATUS", "KLHST_WKS_DLP_STATUS", "KLHST_WKS_COLLAB_SRVS_STATUS", "KLHST_WKS_EMAIL_AV_STATUS", "KLHST_WKS_EDR_STATUS", ] GROUP_FIELDS = [ "id", "name", ] GROUP_DETAILED_FIELDS = [ "id", "name", "parentId", "autoRemovePeriod", "notifyPeriod", "creationDate", "KLGRP_HlfInherited", "KLGRP_HlfForceChildren", "KLGRP_HlfForced", "lastUpdate", "hostsNum", "childGroupsNum", "grp_full_name", "level", "KLSRV_HSTSTAT_CRITICAL", "KLSRV_HSTSTAT_WARNING", "KLGRP_GRP_GROUPID_GP", "c_grp_autoInstallPackageId", "grp_from_unassigned", "grp_enable_fscan", "KLSRVH_SRV_DN", "KLVSRV_ID", "KLVSRV_DN", "KLGRP_CHLDGRP_CNT", "KLGRP_CHLDHST_CNT", "KLGRP_CHLDHST_CNT_OK", "KLGRP_CHLDHST_CNT_CRT", "KLGRP_CHLDHST_CNT_WRN", ] class Client(BaseClient): def login(self, username: str, password: str) -> None: encoded_username = base64.b64encode(username.encode("utf-8")).decode("utf-8") encoded_password = base64.b64encode(password.encode("utf-8")).decode("utf-8") self._http_request( method="POST", url_suffix="/login", headers={ "Authorization": f'KSCBasic user="{encoded_username}", pass="{encoded_password}"', "Content-Type": "application/json", }, resp_type="response", ) def _raise_for_error(self, res: Dict): if error := res.get("PxgError"): raise RuntimeError(f'{error.get("code")} - {error.get("message")}') def get_results(self, str_accessor: str, limit: Optional[int] = 50) -> Dict: response = self._http_request( method="POST", url_suffix="/ChunkAccessor.GetItemsChunk", json_data={ "strAccessor": str_accessor, "nStart": 0, "nCount": limit, }, ) self._raise_for_error(response) return response def list_hosts_request(self, wstr_filter: Optional[str] = None, fields_to_return: Optional[List[str]] = None) -> Dict: response = self._http_request( method="POST", url_suffix="/HostGroup.FindHosts", json_data={ "wstrFilter": wstr_filter, "lMaxLifeTime": 600, "vecFieldsToReturn": fields_to_return, }, ) self._raise_for_error(response) return response def list_groups_request(self, wstr_filter: Optional[str] = None, fields_to_return: Optional[List[str]] = None) -> Dict: response = self._http_request( method="POST", url_suffix="/HostGroup.FindGroups", json_data={"wstrFilter": wstr_filter, "lMaxLifeTime": 600, "vecFieldsToReturn": fields_to_return}, ) self._raise_for_error(response) return response def add_group_request( self, name: str, parent_id: Optional[int] = None, ) -> Dict: response = self._http_request( method="POST", url_suffix="/HostGroup.AddGroup", json_data={ "pInfo": { "name": name, "parentId": parent_id, } }, ) self._raise_for_error(response) return response def delete_group_request( self, group_id: int, flags: int = 1, ) -> Dict: response = self._http_request( method="POST", url_suffix="/HostGroup.RemoveGroup", json_data={ "nGroup": group_id, "nFlags": flags, }, ) self._raise_for_error(response) return response def list_software_applications_request(self) -> Dict: response = self._http_request( method="POST", url_suffix="/InventoryApi.GetInvProductsList", ) self._raise_for_error(response) return response def list_software_patches_request(self) -> Dict: response = self._http_request( method="POST", url_suffix="/InventoryApi.GetInvPatchesList", ) self._raise_for_error(response) return response def list_host_software_applications_request(self, hostname: str) -> Dict: response = self._http_request( method="POST", url_suffix="/InventoryApi.GetHostInvProducts", json_data={ "szwHostId": hostname, }, ) self._raise_for_error(response) return response def list_host_software_patches_request(self, hostname: str) -> Dict: response = self._http_request( method="POST", url_suffix="/InventoryApi.GetHostInvPatches", json_data={"szwHostId": hostname} ) self._raise_for_error(response) return response def list_policies_request(self, group_id: int) -> Dict: response = self._http_request( method="POST", url_suffix="/Policy.GetPoliciesForGroup", json_data={ "nGroupId": group_id, }, ) self._raise_for_error(response) return response def get_policy_request(self, policy_id: int) -> Dict: response = self._http_request( method="POST", url_suffix="/Policy.GetPolicyData", json_data={ "nPolicy": policy_id, }, ) self._raise_for_error(response) return response def get_action_status_request(self, action_id: str) -> Dict: response = self._http_request( method="POST", url_suffix="/AsyncActionStateChecker.CheckActionState", json_data={ "wstrActionGuid": action_id, }, ) self._raise_for_error(response) return response def test_module(client: Client) -> str: client.list_hosts_request(fields_to_return=HOST_FIELDS) return "ok" def list_hosts(client: Client, args: Dict) -> CommandResults: wstr_filter = args.get("filter") limit = arg_to_number(args.get("limit", 50)) response = client.list_hosts_request(wstr_filter=wstr_filter, fields_to_return=HOST_FIELDS) str_accessor = response.get("strAccessor", "") results = client.get_results(str_accessor, limit) outputs = [host.get("value") for host in results.get("pChunk", {}).get("KLCSP_ITERATOR_ARRAY", [])] if not outputs: command_results_args = {"readable_output": "No hosts found."} else: command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Host", "outputs_key_field": "KLHST_WKS_HOSTNAME", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown( "Hosts List", outputs, ["KLHST_WKS_HOSTNAME", "KLHST_WKS_DN", "KLHST_WKS_OS_NAME", "KLHST_WKS_FQDN"] ), "raw_response": results, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def get_host(client: Client, args: Dict) -> CommandResults: hostname = args.get("hostname") wstr_filter = f'KLHST_WKS_HOSTNAME = "{hostname}"' response = client.list_hosts_request(wstr_filter=wstr_filter, fields_to_return=HOST_DETAILED_FIELDS) str_accessor = response.get("strAccessor", "") results = client.get_results(str_accessor) iter_array = results.get("pChunk", {}).get("KLCSP_ITERATOR_ARRAY") if iter_array and isinstance(iter_array, list) and iter_array[0].get("value"): outputs = iter_array[0]["value"] endpoint = Common.Endpoint( id=outputs.get("KLHST_WKS_HOSTNAME"), hostname=outputs.get("KLHST_WKS_DN"), domain=outputs.get("KLHST_WKS_DNSDOMAIN"), os=outputs.get("KLHST_WKS_OS_NAME"), ) command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Host", "outputs_key_field": "KLHST_WKS_HOSTNAME", "outputs": outputs, "readable_output": tableToMarkdown( f"Host {hostname}", outputs, ["KLHST_WKS_HOSTNAME", "KLHST_WKS_OS_NAME", "KLHST_WKS_FQDN", "KLHST_WKS_DN", "KLHST_WKS_NAG_VERSION"], ), "raw_response": results, "indicator": endpoint, } else: command_results_args = {"readable_output": "No host found."} return CommandResults(**command_results_args) def list_groups(client: Client, args: Dict) -> CommandResults: wstr_filter = args.get("filter", "") limit = arg_to_number(args.get("limit", 50)) response = client.list_groups_request(wstr_filter=wstr_filter, fields_to_return=GROUP_FIELDS) str_accessor = response.get("strAccessor", "") results = client.get_results(str_accessor, limit) outputs = [group.get("value") for group in results.get("pChunk", {}).get("KLCSP_ITERATOR_ARRAY", [])] if not outputs: command_results_args = {"readable_output": "No groups found."} else: command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Group", "outputs_key_field": "id", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown("Groups List", outputs), "raw_response": results, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def add_group(client: Client, args: Dict) -> CommandResults: name = args.get("name", "") parent_id = arg_to_number(args.get("parent_id")) response = client.add_group_request(name, parent_id) outputs = {"id": response.get("PxgRetVal"), "name": name} return CommandResults( outputs_prefix="KasperskySecurityCenter.Group", outputs_key_field="id", outputs=outputs, readable_output=tableToMarkdown("Group was added successfully", outputs), raw_response=response, ) def delete_group(client: Client, args: Dict) -> CommandResults: group_id = arg_to_number(args.get("group_id")) flags = arg_to_number(args.get("flags", 1)) response = client.delete_group_request(group_id, flags) # type: ignore[arg-type] return CommandResults( readable_output="Delete group action was submitted", raw_response=response, ) def list_software_applications(client: Client) -> CommandResults: response = client.list_software_applications_request() outputs = [app.get("value") for app in response.get("PxgRetVal", {}).get("GNRL_EA_PARAM_1", [])] if not outputs: command_results_args = {"readable_output": "No software applications found."} else: command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Inventory.Software", "outputs_key_field": "ProductID", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown( "Inventory Software Applications", outputs, headers=["DisplayName", "Publisher", "DisplayVersion"], ), "raw_response": response, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def list_software_patches(client: Client) -> CommandResults: response = client.list_software_patches_request() outputs = [app.get("value") for app in response.get("PxgRetVal", {}).get("GNRL_EA_PARAM_1", [])] if not outputs: command_results_args = {"readable_output": "No software patches found."} else: command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Inventory.Patch", "outputs_key_field": "PatchID", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown( "Inventory Software Patches", outputs, headers=["DisplayName", "Publisher", "DisplayVersion"], ), "raw_response": response, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def list_host_software_applications(client: Client, args: Dict) -> CommandResults: hostname = args.get("hostname", "") response = client.list_host_software_applications_request(hostname) outputs = [app.get("value") for app in response.get("PxgRetVal", {}).get("GNRL_EA_PARAM_1", [])] if not outputs: command_results_args = {"readable_output": "No software applications found."} else: command_results_args = { "outputs_prefix": f"KasperskySecurityCenter.Host(val.KLHST_WKS_HOSTNAME && val.KLHST_WKS_HOSTNAME == " f"{hostname}).Software", "outputs_key_field": "ProductID", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown( f"Host {hostname} Software Applications", outputs, headers=["DisplayName", "Publisher", "DisplayVersion"], ), "raw_response": response, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def list_host_software_patches(client: Client, args: Dict) -> CommandResults: hostname = args.get("hostname", "") response = client.list_host_software_patches_request(hostname) outputs = [app.get("value") for app in response.get("PxgRetVal", {}).get("GNRL_EA_PARAM_1", [])] if not outputs: command_results_args = {"readable_output": "No software patches found."} else: command_results_args = { "outputs_prefix": f"KasperskySecurityCenter.Host(val.KLHST_WKS_HOSTNAME && val.KLHST_WKS_HOSTNAME == " f"{hostname}).Patch", "outputs_key_field": "PatchID", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown( f"Host {hostname} Software Patches", outputs, headers=["DisplayName", "Publisher", "DisplayVersion"], ), "raw_response": response, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def list_policies(client: Client, args: Dict) -> CommandResults: group_id = arg_to_number(args.get("group_id", -1)) response = client.list_policies_request(group_id) # type: ignore[arg-type] outputs = [policy.get("value") for policy in response.get("PxgRetVal", [])] if not outputs: command_results_args = {"readable_output": "No policies found."} else: command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Policy", "outputs_key_field": "KLPOL_ID", "outputs": outputs, # type: ignore[dict-item] "readable_output": tableToMarkdown( "Policies List", outputs, headers=["KLPOL_ID", "KLPOL_DN", "KLPOL_PRODUCT", "KLPOL_VERSION"], ), "raw_response": response, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def get_policy(client: Client, args: Dict) -> CommandResults: policy_id = arg_to_number(args.get("policy_id")) response = client.get_policy_request(policy_id) # type: ignore[arg-type] outputs = response.get("PxgRetVal", {}) if not outputs: command_results_args = {"readable_output": "No policies found."} else: command_results_args = { "outputs_prefix": "KasperskySecurityCenter.Policy", "outputs_key_field": "KLPOL_ID", "outputs": outputs, "readable_output": tableToMarkdown( f"Policy {policy_id}", outputs, headers=["KLPOL_ID", "KLPOL_DN", "KLPOL_PRODUCT", "KLPOL_VERSION"], ), "raw_response": response, # type: ignore[dict-item] } return CommandResults(**command_results_args) # type: ignore[arg-type] def main(): command = demisto.command() params = demisto.params() try: handle_proxy() client = Client( base_url=urljoin(params.get("server"), "/api/v1.0"), verify=not params.get("insecure"), proxy=params.get("proxy"), ) credentials = params.get("credentials") client.login(credentials.get("identifier"), credentials.get("password")) LOG(f"Command being called is {command}") if command == "test-module": return_results(test_module(client)) elif command == "ksc-hosts-list": return_results(list_hosts(client, demisto.args())) elif command == "ksc-host-get": return_results(get_host(client, demisto.args())) elif command == "ksc-groups-list": return_results(list_groups(client, demisto.args())) elif command == "ksc-group-add": return_results(add_group(client, demisto.args())) elif command == "ksc-group-delete": return_results(delete_group(client, demisto.args())) elif command == "ksc-software-applications-list": return_results(list_software_applications(client)) elif command == "ksc-software-patches-list": return_results(list_software_patches(client)) elif command == "ksc-host-software-applications-list": return_results(list_host_software_applications(client, demisto.args())) elif command == "ksc-host-software-patches-list": return_results(list_host_software_patches(client, demisto.args())) elif command == "ksc-policies-list": return_results(list_policies(client, demisto.args())) elif command == "ksc-policy-get": return_results(get_policy(client, demisto.args())) except Exception as e: return_error(str(e), error=e) if __name__ in ("__main__", "builtin", "builtins"): main()