To export the settings included in a security policy, you can use the kics4net-cli security policy export utility. The utility exports the entire security policy to a file in a specified directory. When necessary, you can then import the relevant application settings from the file containing the saved security policy.
The utility is automatically installed at /opt/kaspersky/kics4net-cli/bin/ on the Server computer. You can use built-in operating system tools to configure kics4net-cli to run automatically to create regular security policy backups.
The utility connects to the application Server via a connector added to the application.
To prepare the application for using the security policy export utility, do as follows:
The application generates a new communication data package after the connector is added. The communication data package is an archive.
To prepare the directory:
unzip <
communication data package name
>
The unpacked files will appear in the directory.
sudo openssl pkcs12 -in certificates.pfx -nodes -clcerts -nokeys -out clientcert.crt
When prompted for a password, enter the password to access the connector certificate. This is the password you set when adding the connector or when creating the new communication data package for the connector.
sudo openssl pkcs12 -in certificates.pfx -nocerts -nodes -out clientcert.key
When prompted for a password, enter the password to access the connector certificate.
sudo cp webserver.pem /var/opt/kaspersky/kics4net-cli/certs
To prepare the directory:
sudo chown kics4net:kics4net <
directory path
>
To export the current security policy:
sudo ./kics4net-cli exec exportsecuritypolicy\
--client-cert=<
path to file
clientcert.crt> \
--client-key=<
path to file
clientcert.key> \
--export-path=<
path to directory to save files in
> \
--timeout=<
timeout
>
where:
exec
is the argument for running a command supported by the utility (mandatory parameter)exportsecuritypolicy
is the command for exporting a security policy to a file (mandatory parameter)<
path to file
clientcert.crt>
is the full path and name of the clientcert.crt certificate file in the directory to apply the contents of the communication data package to (mandatory parameter)<
path to file
clientcert.key>
is the full path and name of the clientcert.key file in the directory to apply the contents of the communication data package to (mandatory parameter)<
target directory
>
is the full path to the directory to save the exported file in (mandatory parameter)<
timeout
>
is the command execution result timeout in seconds (default 900 seconds), which can be increased via this parameter if the previous export attempt failed due to a large volume of data in the security policy.Example:
|
After the utility finishes, verify that the files are in the target directory.
sudo chmod o+r <
path to policy file
>