Kaspersky Embedded Systems Security for Linux

Managing application tasks using the command line

You can manage the application operation using tasks locally on the device (using the command line or configuration files), as well as using Administration Console or Kaspersky Security Center Web Console.

There are two types of tasks for working with the application:

  • Predefined task — a task created during installation of the application. Predefined tasks cannot be created or deleted, but you can modify the settings of these tasks.
  • A user task that you can create or delete on your own. You can create the following types of user tasks: ODS, Update, Rollback, ODFIM, ContainerScan, and InventoryScan.

Task ID is an identifier that the application assigns to the task at creation. IDs for user tasks are starting from 100. All tasks (including deleted tasks) have unique IDs. The application does not reuse the identifiers of the deleted tasks. The identifier of a new task is the next successive number to the identifier of the latest created task.

Task names are not case-sensitive.

The application's predefined tasks are listed in the table.

Application tasks

Task

Task name in the command line

Task ID

Task type

File Threat Protection

File_Threat_Protection

1

OAS

Malware Scan

Scan_My_Computer

2

ODS

Custom Scan

Scan_File

3

ODS

Critical Areas Scan

Critical_Areas_Scan

4

ODS

Update

Update

6

Update

Rollback

Rollback

7

Rollback

Licensing

License

9

License

Storage management

Backup

10

Backup

System Integrity Monitoring

System_Integrity_Monitoring

11

OAFIM

Firewall Management

Firewall_Management

12

Firewall

Anti-Cryptor

Anti_Cryptor

13

AntiCryptor

Web Threat Protection

Web_Threat_Protection

14

WTP

Device Control

Device_Control

15

DeviceControl

Removable Drives Scan

Removable_Drives_Scan

16

RDS

Network Threat Protection

Network_Threat_Protection

17

NTP

Container Scan

Container_Scan

18

ContainerScan

Custom Container Scan

Custom_Container_Scan

19

ContainerScan

Behavior Detection

Behavior_Detection

20

BehaviorDetection

Application Сontrol

Application_Control

21

AppControl

Inventory

Inventory_Scan

22

InventoryScan

You can perform the following actions with tasks:

In this section

View the list of tasks

Creating a new task

Editing task settings using a configuration file

Editing task settings using the command line

Resetting task settings to their default values

Starting and stopping a task

Viewing a task state

Scheduling a task

Managing scan scopes from the command line

Managing exclusion scopes from the command line

Deleting a task

Page top
[Topic 245737]

View the list of tasks

To view the list of application tasks, execute the following command:

kess-control [-T] --get-task-list [--json]

where:

--json – output format for the list of application tasks. If a file format is not specified, the output will be an INI file.

The list of Kaspersky Embedded Systems Security tasks will be displayed.

The following information will be displayed for each task:

If Kaspersky Security Center policy prohibits users from viewing and editing tasks locally, information will only be displayed about the Scan_File, Backup, License, File_Threat_Protection, System_Integrity_Monitoring, and Anti_Cryptor tasks. Information about other tasks is not available.

Page top

[Topic 236014]

Creating a new task

You can create tasks with default settings or with settings specified in a configuration file.

You can create only the following types of user tasks: ODS, Update, Rollback, ODFIM, ContainerScan, and InventoryScan.

To create a task with default settings, execute the following command:

kess-control [-T] --create-task <task name> --type <task type>

where:

  • <task name> is the name you assign to the new task;
  • <task type> is the type of task.

A task of the specified type is created with default settings.

To create a task with the settings specified in the configuration file, execute the following command:

kess-control [-T] --create-task <task name> --type <task type> --file <file path> [--json]

where:

A task of the specified type is created with settings specified in a configuration file.

Page top

[Topic 197949]

Editing task settings using a configuration file

To edit task settings by changing a configuration file:

  1. Save task settings to the configuration file:

    kess-control --get-settings <task ID>|<task name> --file <full path to the file> [--json]

  2. Open the created configuration file for editing.
  3. Edit the required settings in the configuration file.
  4. Save the changes in the configuration file.
  5. Import the settings from the configuration file into the task:

    kess-control --set-settings <task ID>|<task name> --file <full path to the file> [--json]

Task settings will be updated.

If you change the allowlist, or prohibit launch of all applications or applications that affect the operation of Kaspersky Embedded Systems Security in the Application Control task settings, run the --set-settings command with the --accept flag.

Page top
[Topic 197950]

Editing task settings using command line

To edit task settings using the command line:

  1. Specify the required setting value:

    kess-control --set-settings <task ID>|<task name> <setting=value> [<setting=value>]

    The application changes the specified setting.

    If you change the allowlist, or prohibit launch of all applications or applications that affect the operation of Kaspersky Embedded Systems Security in the Application Control task settings, run the --set-settings command with the --accept flag.

  2. Make sure the setting value is changed in the task configuration file:

    kess-control --get-settings <task ID>|<task name>

If you add a new scan scope or exclusion scope not specifying all settings, a scope with default settings is added to the configuration file.

Example:

To specify a new scan scope, execute the following command:

kess-control --set-settings 100 ScanScope.item_0001.UseScanArea=Yes ScanScope.item_0001.Path=/home

A new section describing the scan scope is added to the task configuration file with ID=100:

[ScanScope.item_0001]

AreaDesc=

UseScanArea=Yes

Path=/home

AreaMask.item_0000=*

Page top

[Topic 246838]

Resetting task settings to their default values

Kaspersky Embedded Systems Security allows you to reset task settings to default values from command line.

Restoring default settings is not available for the License and Rollback tasks.

To reset task settings to their default values from the command line:

  1. Execute the following command:

    kess-control --set-settings <task ID>|<task name> --set-to-default

    The application changes the setting values to their defaults.

  2. Make sure the settings' values are changed in the task configuration file:

    kess-control --get-settings <task ID>|<task name> --file <configuration file name>

    The task configuration file contains default values for all settings.

Page top

[Topic 197952]

Starting and stopping a task

By default, the following tasks are automatically started when the application starts: File Threat Protection, Device Control, and Behavior Detection. The remaining tasks are stopped (their status is Stopped).

You can start a task at any time.

The Backup and License tasks cannot be started or stopped.

To start a task, execute the following command:

kess-control --start-task <task ID>|<task name>

To stop a task, execute the following command:

kess-control --stop-task <task ID>|<task name>

Page top
[Topic 197953]

Viewing a task state

To view a task state, execute the following command:

kess-control --get-task-state <task ID>|<task name>

where:

  • <task ID> is the task ID that the application assigned to the task when it was created.

The application tasks can have one of the following states:

  • Started—Task is running.
  • Starting—Task is being launched.
  • Stopped—Task has been stopped.
  • Stopping—Task is stopping.

The ODS, ODFIM, and InventoryScan tasks can also have one of the following states:

  • Pausing — Task is pausing.
  • Suspended — Task is suspended.
  • Resuming — Task is resuming.

The Backup and License tasks cannot be started, suspended, or stopped. They can have only the Started state.

Page top
[Topic 246851]

Scheduling a task

You can view and configure the schedule settings for the following task types: ODS, Update, Rollback, ODFIM, ContainerScan and InventoryScan.

Editing task schedule settings

To configure task schedule settings:

  1. Save task schedule settings to a configuration file by executing the following command:

    kess-control --get-schedule <task ID>|<task name> --file <configuration file name> [--json]

  2. Open the configuration file for editing.
  3. Specify the schedule settings.
  4. Save the changes in the configuration file.
  5. Import the schedule settings from the configuration file to the task using the following command:

    kess-control --set-schedule <task ID>|<task name> --file <configuration file name> [--json]

The application will apply the new values of the schedule settings immediately.

Task schedule settings

The application provides the following settings for configuring the task launch schedule:

RuleType=Once|Monthly|Weekly|Daily|Hourly|Minutely|Manual|PS|BR

where:

Manual – start the task manually.

PS – start the task after starting the application.

BR – start the task after the application databases have been updated.

StartTime=[<year>/<month>/<day of the month>] [hh]:[mm]:[ss]; [<day of the month>|<day of the week>]; [<start periodicity>] – task start time. The StartTime setting is required if RuleType=Once|Monthly|Weekly|Daily|Hourly|Minutely.

RandomInterval=<minutes> – a time interval from 0 to the specified value (in minutes), which will be added to the task start time to avoid starting tasks at the same time.

RunMissedStartRules – enables launch of the missed task after the application starts.

Examples:

To schedule the task to start every ten hours, specify the following settings:

RuleType=Hourly

RunMissedStartRules=No

StartTime=2021/May/30 23:05:00;10

RandomInterval=0

To schedule the task to start every ten minutes, specify the following settings:

RuleType=Minutely

RunMissedStartRules=No

StartTime=23:10:00;10

RandomInterval=0

To schedule the task to start on the 15th of every month, specify the following settings:

RuleType=Monthly

RunMissedStartRules=No

StartTime=23:25:00;15

RandomInterval=0

To schedule the task to start on every Tuesday, specify the following settings:

RuleType=Weekly

StartTime=18:01:30;Tue

RandomInterval=99

RunMissedStartRules=No

To schedule the task to start every 11 days, specify the following settings:

RuleType=Daily

RunMissedStartRules=No

StartTime=23:15:00;11

RandomInterval=0

The kess-control --get-schedule command

The kess-control --get-schedule command displays the task schedule settings or saves them to the specified configuration file.

Command syntax

kess-control [-T] --get-schedule <task ID>|<task name> [--file <configuration file name>] [--json]

Arguments and keys

<task ID> is the task identification number in the application.

<task name> is a name of a task.

--file <configuration file name> is the name of the configuration file where the schedule settings will be saved. If you specify the name of a file without specifying its path, the file will be created in the current directory. If a file with the specified name already exists in the specified path, it will be overwritten. If the specified directory cannot be found on the disk, the configuration file will not be created.

Examples:

Save the update task settings to a file named update_schedule.ini and save the created file in the current directory:

kess-control --get-schedule 6 --file update_schedule.ini

Display the Update task schedule:

kess-control --get-schedule 6

The kess-control --set-schedule command

The kess-control --set-schedule command sets the task schedule settings using the command keys or imports the task schedule settings from the specified configuration file.

Command syntax

kess-control --set-schedule <task ID>|<task name> --file <configuration file name> [--json]

kess-control --set-schedule <task ID>|<task name> <setting name>=<setting value> <setting name>=<setting value>

Arguments and keys

<task ID> is the task identification number in the application.

<task name> is a name of a task.

--file <configuration file name> is the name of the configuration file; the schedule settings from this file will be imported into the task; includes the full path to the file.

Example:

Import the schedule settings from the configuration file named /home/test/on_demand_schedule.ini into the task with ID=2:

kess-control --set-schedule 2 --file /home/test/on_demand_schedule.ini

Page top

[Topic 236381]

Managing scan scopes from the command line

You can add or delete a scan scope with a specified Path for OAS, ODS, OAFIM, ODFIM, and AntiCryptor tasks from the command line.

To add a new scan scope, execute the following command:

kess-control --set-settings <task ID>|<task name> --add-path <path>

A new [ScanScope.item_#] section will be added to the configuration file. The application scans the objects in the directory specified by the Path setting.

If a [ScanScope.item_#] section already exists for the specified Path setting, a duplicate section will not be added to the configuration file. If the UseScanArea setting is set to No its value will change to Yes after this command is executed and the objects located in this directory will be scanned.

To delete a scan scope, execute the following command:

kess-control --set-settings <task ID>|<task name> --del-path <path>

The [ScanScope.item_#] section that contains the specified path will be deleted from the task configuration file. The application will not scan the objects in the directory specified by the Path setting.

Page top
[Topic 197954]

Managing exclusion scopes from the command line

You can add or delete an exclusion scope with a specified Path for OAS, ODS, OAFIM, ODFIM, and AntiCryptor tasks from the command line.

To add a new exclusion scope, execute the following command:

kess-control --set-settings <task ID>|<task name> --add-exclusion <path>

In order to optimize the operation of scan tasks, it is recommended to add the path with snapshots mounted by the system in the read-only mode to the exclusions for the systems with the btrfs file system and enabled active snapshots. For example, for the systems based on SUSE/OpenSUSE, you can add the following exclusion for the path: /.snapshots/*/snapshot/.

A new [ExcludedFromScanScope.item_#] section will be added to the configuration file. The application will exclude objects in the directory specified by the Path setting from scans.

If an [ExcludedFromScanScope.item_#] section already exists for the specified Path setting, a duplicate section will not be added to the configuration file. If the UseScanArea setting is set to No its value will change to Yes after this command is executed and the objects located in this directory will be excluded from scans.

To delete an exclusion scope, execute the following command:

kess-control --set-settings <task ID>|<task name> --del-exclusion <path>

The [ExcludedFromScanScope.item_#] section that contains the specified path is deleted from the task configuration file. The application will not exclude objects in the directory specified by the Path setting from scans.

Page top
[Topic 197955]

Deleting a task

You can only delete tasks that you have created. You cannot delete predefined tasks.

To delete a task, execute the following command:

kess-control --delete-task <task ID>|<task name>

Page top
[Topic 197960]