Contents
- Appendix 2. Commands for managing the Kaspersky application
Appendix 2. Commands for managing the Kaspersky application
You can manage the Kaspersky application on the command line using management commands.
You can view the help on management commands of the application by running the following command:
kfl-control --help <
command group prefix
>
Where <
command group prefix
>
accepts the following values:
- -B: commands for managing Backup
- -E: commands for managing application events
- -J: commands for managing the collection of system performance metrics
- -L: commands for managing license keys
- -N: commands for managing encrypted connections scan settings
- -S: statistics commands
- -T: commands for managing application tasks and settings
- -U: commands for managing users and roles
- -W: event display commands
Commands for managing application tasks and settings
-T is a prefix indicating that the command belongs to the group of commands for managing application settings and tasks.
-N is a prefix indicating that the command belongs to the group of commands for managing secure connections scan settings.
kfl-control --export-settings
This command outputs all application settings to the console or exports to a configuration file. These settings include encrypted connections scan settings, general application settings, and task settings.
Command syntax
kfl-control [-T] --export-settings [--file <
configuration file path
>] [--json]
Arguments and options
--file <
configuration file path
>
is the full path to the configuration file where the application settings will be saved.
--json
is specified to output the settings in JSON format. If the --json
option is not specified, the settings are output in the INI format.
kfl-control --import-settings
This command imports all application settings from a configuration file, including encrypted connections scan settings, general application settings, and task settings.
Command syntax
kfl-control [-T] --import-settings -
-
file <
configuration file path
> [--json]
Arguments and options
--file <
configuration file path
>
is the full path to the configuration file from which you want to import settings into the application.
--json
is specified to import the settings from the configuration file in JSON format. If the --json
option is not specified, the application attempts to import from an INI file. If the import fails, an error is displayed.
Commands for managing general application settings
kfl-control --get-app-settings
The command outputs the current values of the general application settings to the console or a configuration file.
Command syntax
kfl-control [-T] --get-app-settings [--file <
configuration file path
>] [--json]
Arguments and keys
--file <
configuration file path
>
is the path to the configuration file where the application general settings will be written. If you do not specify the --file
option, settings will be output to the console.
If you specify the name of a file without its path, the file will be created in the current directory. If a file already exists in the specified path, it will be overwritten. If the specified directory does not exist, no configuration file will be generated.
--json
is specified to output the settings in JSON format. If the --json
option is not specified, the settings are output in the INI format.
kfl-control --set-app-settings
This command configures the general application settings via command options or by importing settings from a configuration file.
Command syntax
Define settings via command options:
kfl-control [-T] --set-app-settings <
option name
>=<
option value
> [<
option name
>=<
option value
>]
Define settings via a configuration file:
kfl-control [-T] --set-app-settings --file <
configuration file path
> [--json]
Arguments and options
<
option name
>=<
option value
>
: the name and value of a general application setting.
--file <
configuration file path
>
is the full path to the configuration file from which you want to import settings into the application.
--json
is specified to import the settings from the configuration file into the application in JSON format. If the --json
option is not specified, the application attempts to import from an INI file. If the import fails, an error is displayed.
Commands for managing task settings
kfl-control --get-settings
This command outputs the current settings for a specified task to the console or a configuration file.
Command syntax
kfl-control [-T] --get-settings <
task ID/name
> [--file <
configuration file path
>] [--json]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
--file <
configuration file path
>
is the path to the configuration file into which the task settings will be written. If you do not specify the --file
option, settings will be output to the console.
If you specify the name of a file without its path, the file will be created in the current directory. If a file already exists in the specified path, it will be overwritten. If the specified directory does not exist, no configuration file will be generated.
--json
is specified to output the settings in JSON format. If the --json
option is not specified, the settings are output in the INI format.
kfl-control --set-settings
This command defines the settings for a specified task via command options or by importing settings from a configuration file.
Command syntax
Define settings via command options:
kfl-control [-T] --set-settings
<
task name/ID
> <
setting name
>=<
setting value
> [<
setting name
>=<
setting value
>] [--add-path <
path
>] [--del-path <
path
>] [--add-exclusion <
path
>] [--del-exclusion <
path
>]
Define settings via a configuration file:
kfl-control [-T] --set-settings
<
task ID/name
> --file <
configuration file path
> [--json]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
<
setting name
>=<
setting value
>
is the name and value of one of the task settings.
--add-path <
path
>
adds the path to the directory with the objects to be scanned.
--del-path <
path
>
deletes the path to the directory with the objects to be scanned.
--add-exclusion <
path
>
: add the path to the directory with objects to exclude from scanning.
--del-exclusion <
path
>
deletes the path to the directory with the objects to be excluded.
--file <
configuration file path
>
is the full path to the configuration file from which the task settings will be imported.
--json
is specified to import the settings from the configuration file in JSON format. If the --json
option is not specified, the application attempts to import from an INI file. If the import fails, an error is displayed.
kfl-control --set-to-default
The command restores the default settings for the specified task.
Command syntax
kfl-control [-T] --set-settings
<
task ID/name
> --set-to-default
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
kfl-control --get-schedule
The command outputs the current schedule of the specified task to the console or a configuration file.
Command syntax
kfl-control [-T] --get-schedule <
task ID/name
> [--file <
configuration file path
>] [--json]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
--file <
configuration file path
>
is the path to the configuration file in which the settings for the task run schedule will be written. If you do not specify the --file
option, settings will be output to the console.
If you specify the name of a file without its path, the file will be created in the current directory. If a file already exists in the specified path, it will be overwritten. If the specified directory does not exist, no configuration file will be generated.
--json
is specified to output the settings in JSON format. If the --json
option is not specified, the settings are output in the INI format.
kfl-control --set-schedule
The command defines a schedule for the specified task via command options or by importing settings from a configuration file.
Command syntax
Define settings via command options:
kfl-control [-T] --set-schedule <
task ID/name
> <
setting name
>=<
setting value
> [<
setting name
>=<
setting value
>]
Define settings via a configuration file:
kfl-control [-T] --set-schedule <
task ID/name
> --file <
configuration file path
> [--json]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
<
setting name
>=<
setting value
>
is the name and value of one of the settings for the task schedule.
--file <
configuration file path
>
is the full path to the configuration file from which the task schedule settings will be imported.
--json
is specified to import the settings from the configuration file in JSON format. If the --json
option is not specified, the application attempts to import from an INI file. If the import fails, an error is displayed.
Commands for managing tasks
kfl-control --get-task-list
This command outputs a list of existing tasks.
Command syntax
kfl-control [-T] --get-task-list [--json]
Arguments and options
--json
is specified to output the settings in JSON format.
kfl-control --get-task-state
This command outputs the status of the specified task.
Command syntax
kfl-control [-T] --get-task-state <
task ID/name
> [--json]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
--json
is specified to output the settings in JSON format.
kfl-control --create-task
This command creates a task of the specified type with the default settings or settings specified in a configuration file.
Command syntax
Create a task with the default settings:
kfl-control [-T] --create-task <
task name
> --type <
task type
>
Create a task with the settings from a configuration file:
kfl-control [-T] --create-task <
task name
> --type <
task type
> [--file <
configuration file path
>] [--json]
Arguments and options
<
task name
>
is the name that you specify for the new task.
<
task type
>
is the identifier for the type of the created task.
--file <
configuration file path
>
: the full path to the configuration file to import settings from.
--json
is specified to import the settings from the configuration file in JSON format. If the --json
option is not specified, the application attempts to import from an INI file. If the import fails, an error is displayed.
kfl-control --delete-task
This command deletes a task.
Command syntax
kfl-control [-T] --delete-task <
task ID/name
>
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
kfl-control --start-task
This command starts a task.
Command syntax
kfl-control [-T] --start-task <
task ID/name
> [-W] [--progress]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
[-W]
: enable current events output.
[--progress]
: display task progress.
kfl-control --stop-task
This command stops a task.
Command syntax
kfl-control [-T] --stop-task <
task ID/name
> [-W]
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
[-W]
: enable current events output.
kfl-control --suspend-task
This command pauses a task.
Command syntax
kfl-control [-T] --suspend-task <
task ID/name
>
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
kfl-control --resume-task
This command resumes a task.
Command syntax
kfl-control [-T] --resume-task <
task ID/name
>
Arguments and options
<
task ID/name
>
is the ID assigned to the task at the time of its creation, or the name of the task in the command line.
kfl-control --scan-file
This command creates and runs a custom scan task.
Command syntax
kfl-control [-T] --scan-file <
path
> [--action <
action
>]
Arguments and options
<
path
>
: the path to the file or directory to scan. You can specify multiple paths by separating them with a space.
--action <
action
>
is the action to be performed by the application on the infected objects. If you do not specify the --action
option, the application performs the recommended action.
Commands for managing encrypted connections scan settings
-N is a prefix indicating that the command belongs to the group of commands for managing secure connections scan settings.
kfl-control -N --query
The command outputs lists of exclusions from encrypted connections scanning:
- a list of exclusions added by the user;
- a list of exclusions added by the application;
- list of exclusions received from the application databases.
Command syntax
kfl-control -N --query user
kfl-control -N --query auto
kfl-control -N --query kl
kfl-control --clear-web-auto-excluded
This command clears the list of domains that the application has automatically excluded from scanning.
Command syntax
kfl-control -N --clear-web-auto-excluded
kfl-control --get-net-settings
The command outputs the current encrypted connections scan settings to the console or a configuration file.
Command syntax
kfl-control [-N] --get-net-settings [--file <
configuration file path
>] [--json]
Arguments and options
--file <
configuration file path
>
: the path to the configuration file to output the encrypted connections scan settings to. If you do not specify the --file
option, settings will be output to the console.
If you specify the name of a file without its path, the file will be created in the current directory. If a file already exists in the specified path, it will be overwritten. If the specified directory does not exist, no configuration file will be generated.
--json
is specified to output the settings in JSON format. If the --json
option is not specified, the settings are output in the INI format.
kfl-control --set-net-settings
The command configures the encrypted connections scan settings with command options or by importing settings from a configuration file.
Command syntax
Define settings via command options:
kfl-control [-N] --set-net-settings <
setting name
>=<
setting value
> [<
setting name
>=<
setting value
>]
Define settings via a configuration file:
kfl-control [-N] --set-net-settings --file <
configuration file path
> [--json]
Arguments and options
<
option name
> = <
option value
>
: the name and value of an encrypted connections scan option.
--file <
configuration file path
>
: the full path to the configuration file to import encrypted connections scan settings from.
--json
is specified to import the settings from the configuration file into the application in JSON format. If the --json
option is not specified, the application attempts to import from an INI file. If the import fails, an error is displayed.
kfl-control --list-certificates
This command outputs a list of trusted root certificates.
Command syntax
kfl-control [-N] --list-certificates
kfl-control --add-certificate
This command adds a certificate to the list of trusted root certificates.
Command syntax
kfl-control [-N] --add-certificate <
path to certificate
>
Arguments and options
<
path to certificate
>
is the path to the certificate file that you want to add (PEM or DER format).
kfl-control --remove-certificate
This command removes a certificate from the list of trusted root certificates.
Command syntax
kfl-control [-N] --remove-certificate <
certificate subject
>
Statistics commands
-S is a prefix indicating that the command belongs to the statistics command group.
kfl-control --app-info
This command outputs information about the application.
Command syntax
kfl-control [-S] --app-info [--json]
Arguments and options
--json
is specified to output the settings in JSON format.
kfl-control --omsinfo
This command creates a JSON file for integration with Microsoft Operations Management Suite.
Command syntax
kfl-control [-S] --omsinfo --file <
file path
>
Commands for displaying events
kfl-control -W
This command enables the display of current application events. The command returns the name of the event and additional information about the event. You can use the command to display all current application events or only events associated with a currently running task.
Command syntax
kfl-control -W [--query "<
filter conditions
>"]
Arguments and keys
<
filter conditions
>
: one or several logical expressions in the format <
field
> <
comparison operator
> '<
value
>'
, combined with the logical operator and
to output specific current events.
Commands for managing application events
-E: a prefix indicating that the command belongs to the group of commands used for managing application events.
kfl-control -E
This command outputs information about all events in the application event log. You can use the less
command to navigate through the list of displayed events.
Command syntax
kfl-control -E
kfl-control -E --query
This command outputs information about events from the application event log. You can use the less
command to navigate through the list of displayed events. You can use a filter to output specific events or output a list of events to a file.
Command syntax
kfl-control -E --query "<
filter conditions
>" [--db <
database file
>] [-n <
number
>] [--file <
file path
>] [--json] [--reverse]
Arguments and options
<
database file
>
is the full path to the event log database file to output events from. By default, the application saves information about events to the database in the /var/opt/kaspersky/kfl/private/storage/events.db database. The location of the database is determined by the EventsStoragePath global application setting
.
<
filter conditions
>
: one or several logical expressions in the format <
field
> <
comparison operator
> '<
value
>'
, combined with the help of the logical operator and
to limit the results.
<
number
>
– number of the latest events of the selection (number of records from the end of the selection) to be displayed.
--file <
file path
>
is the full path to the file to output events to. 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, file will not be created.
If you do not specify the --file
option, the list of events will be output to the console.
--json
: output events in JSON format.
--reverse
: display events in reverse order (from the newest event at the top to the oldest at the bottom).
Commands for managing license keys
-L is a prefix indicating that the command belongs to the group of commands used to manage license keys.
kfl-control --add-active-key
This command adds an active license key to the application.
Command syntax
kfl-control [-L] --add-active-key <
activation code
>
Arguments and keys
<
activation code
>
– activation code.
kfl-control --add-reserve-key
This command adds a reserve license key to the application.
If an active key has not yet been added to the application on the device, the command fails.
Command syntax
kfl-control [-L] --add-reserve-key <
activation code
>
Arguments and keys
<
activation code
>
– activation code.
Example: Add a reserve key using the /home/test/00000002.key file:
|
kfl-control --remove-active-key
This command lets you remove an active license key.
Command syntax
kfl-control [-L] --remove-active-key
kfl-control --remove-reserve-key
This command lets you remove a reserve license key.
Command syntax
kfl-control [-L] --remove-reserve-key
kfl-control -L --query
The -L --query
command outputs information about the license that the application is activated with and the license key currently in use.
Command syntax
kfl-control -L --query [--json]
Arguments and options
--json
: output data in JSON format.
Commands for managing Backup
-B is a prefix indicating that the command belongs to the group of commands used to manage the Backup storage.
kfl-control --mass-remove
The command deletes some or all objects from Backup.
Command syntax
Delete all objects:
kfl-control [-B] --mass-remove
Delete objects that match the filter conditions:
kfl-control [-B] --mass-remove --query "<
filter conditions
>"
Arguments and options
<
filter conditions
>
: one or several logical expressions in the format <
field
> <
comparison operator
> '<
value
>'
, combined with the help of the logical operator and
to limit the results.
kfl-control -B --query
This command outputs information about Backup objects.
Command syntax
Output information about all objects in Backup:
kfl-control -B --query [-n <
number
>] [--json] [--reverse]
Output information about Backup objects that match the filter conditions:
kfl-control -B --query ["<
filter conditions
>"] [-n <
number
>] [--json] [--reverse]
Arguments and options
<
filter conditions
>
: one or several logical expressions in the format <
field
> <
comparison operator
> '<
value
>'
, combined with the help of the logical operator and
to limit the results. If you do not specify any filter conditions, the application will display the details of all objects in Backup.
<
number
>
: the number of the most recent objects to display. If you do not specify the -n
switch, the last 30 objects will be displayed. Specify 0 to show all objects.
--json
: output data in JSON format.
--reverse
– output objects in reverse order (from the newest object at the top to the oldest at the bottom).
kfl-control --restore
This command restores an object from Backup.
Command syntax
kfl-control [-B] --restore <
object ID
> [--file <
file path
>]
Arguments and options
<
object ID
>
: the ID of the Backup object.
--file <
file path
>
: the new name of the file and the path to the directory to save it to. If you do not specify the --file
option, the object will be restored with its original name and to its original location.
Commands for managing users and roles
-U is a prefix indicating that the command belongs to the group of commands for managing users and roles.
kfl-control --get-user-list
This command outputs a list of users and roles.
Command syntax
kfl-control [-U] --get-user-list
kfl-control --grant-role
This command assigns a role to a specific user.
Command syntax
kfl-control [-U] --grant-role <
role
> <
user
>
kfl-control --revoke-role
This command revokes a role from a specific user.
Command syntax
kfl-control [-U] --revoke-role <
role
> <
user
>
Commands for managing system performance metrics
kfl-control --export-metrics
This command allows configuring the collection of operating system performance metrics.
Command syntax
kfl-control [-J] --export-metrics [--period <
interval in seconds between exports
>|--interactive]
Arguments and options
--period
enables periodic output of results.
<
interval in seconds between exports
>
(in seconds) sets the output period.
--interactive
enables interactive output (on the Enter key being pressed).