API Reference Guide

This Kaspersky Security Center OpenAPI reference guide is designed to assist in the following tasks:

You can use the search field in the right part of the screen to locate the information you need in the OpenAPI reference guide.

The Open API icon. OPENAPI REFERENCE GUIDE

Samples of scripts

The OpenAPI reference guide contains samples of the Python scripts listed in the table below. The samples show how you can call OpenAPI methods and automatically accomplish various tasks for protecting your network, for instance, create a "primary/secondary" hierarchy, run tasks in Kaspersky Security Center Linux, or assign distribution points. You can run the samples as is or create your own scripts based on the samples.

To call the OpenAPI methods and run scripts,

Install the KlAkOAPI package from the KlAkOAPI.tar.gz archive on a device where Administration Server is installed.

The KlAkOAPI package includes a set of samples that perform typical operations. You can call the OpenAPI methods, run the samples and your own scripts only on devices where Administration Server and the KlAkOAPI package are installed.The KlAkOAPI.tar.gz archive that contains this package is located in the Kaspersky Security Center Linux installation folder.

Matching between user scenarios and samples of Kaspersky Security Center OpenAPI methods

Sample

Purpose of the sample

Scenario

Log KlAkParams

You can extract and process data by using the KlAkParams data structure. The sample shows how to work with this data structure.

The sample output may be present in different ways. You can get the data to send an HTTP method or to use it in your code.

Monitoring and reporting

Create and delete a "primary/secondary" hierarchy

You can add a secondary Administration Server and establish a "primary/secondary" hierarchy. Alternately, you can disconnect the secondary Administration Server from the hierarchy.

Creating a hierarchy of Administration Servers, adding a secondary Administration Server, and deleting a hierarchy of Administration Servers

Download network list files via connection gateway to the specified host

You can connect to Network Agent on the needed device by using a connection gateway, and then download a file with the network list to your device.

Adjustment of distribution points and connection gateways

Install a license key stored in the primary Administration Server repository onto the secondary Administration Servers

You can connect to the primary Administration Server, download a required license key from it, and transmit this key to all the secondary Administration Servers included in a hierarchy.

Licensing of managed applications

Create a report of effective user rights

You can create different reports. For instance, you can generate the report of effective user rights by using this sample. This report describes the rights that a user has, depending on his or her group and role.

You can download the report in the HTML, PDF, or Excel format.

Generating and viewing a report

Start the device task

You can connect to Network Agent on the needed device by using a connection gateway, and then run the necessary task.

Starting a task manually

Register distribution points for devices in a group

You can assign managed devices as distribution points (previously known as update agents).

Updating Kaspersky databases and applications

Enumerate all groups

 

You can perform various actions with administration groups. The sample shows how to do the following:

  • Get an identifier of the "Managed devices" root group
  • Move through the group hierarchy
  • Retrieve the full, expanded hierarchy of groups, along with their names and nesting

Configuring Administration Server

Enumerate tasks, query task statistics, and run a task

You can find out the following information:

  • Task progress history
  • Current task status
  • Number of tasks in different statuses

You can also run a task. By default, the sample runs a task after it outputs statistics.

Managing tasks

Create and run a task

You can create a task. Specify the following task parameters in the sample:

  • Type
  • Method of run
  • Name
  • Device group for which the task will be used

By default, the sample creates a task with the "Show message" type. You can run this task for all managed devices of Administration Server. If necessary, you can specify your own task parameters.

Creating a task

Enumerate license keys

You can get a list of all the active license keys for Kaspersky applications installed on managed devices of Administration Server. The list contains detailed data about every license key, such as a name, type, or expiration date.

Viewing information about license keys in use

Create and find an internal user

You can create an account for further work.

Adding an account of an internal user

Create a custom category

You can create the application category with the needed parameters.

Creating an application category with content added manually

Enumerate users by using SrvView

You can use the SrvView class to request detailed information from the Administration Server. For instance, you can get a list of users by using this sample.

Managing users and user roles

Applications interacting with Kaspersky Security Center Linux via OpenAPI

Some applications interact with Kaspersky Security Center Linux via OpenAPI. Such applications include, for example, Kaspersky Anti Targeted Attack Platform or Kaspersky Security for Virtualization. This can also be a custom client application developed by you based on OpenAPI.

Applications interacting with Kaspersky Security Center Linux via OpenAPI connect to Administration Server. If you have configured an allowlist of IP addresses for connecting to the Administration Server, add IP addresses of devices where applications using Kaspersky Security Center Linux OpenAPI are installed. To find out whether the application that you use works by OpenAPI, see Help of this application.

Page top