The SFTP Listener tool is a custom message listener extension for Parasoft Virtualize. It stands up a temporary SFTP V3 server that can notify Virtualize on a per-command or session basis. This allows you to perform validations and post-processing on the events that occur. This listener does not support virtualizing SFTP command responses. The commands are processed by the underlying SFTP server, then converted into a format that Virtualize can interpret to perform validations and post-processing.

In this section:

Installation

This tool can be installed from the UI or the command line.

UI Installation

  1. Choose Parasoft> Preferences.
  2. In the System Properties preferences, click Add JARs.
  3. Browse to the com.parasoft.virtualize.listener.sftp-<version>.jar file and click OK.
  4. Restart Virtualize.

Command Line Installation

Add the com.parasoft.virtualize.listener.sftp-<version>.jar file to the system.properties.classpath property in your localsettings properties file. For example:

system.properties.classpath=<path to jar>/com.parasoft.virtualize.listener.sftp-1.1.0.jar

Usage

You can select and configure the listener in the Virtual Asset configuration panel.

  1. In the Virtualize Server view, choose the virtual asset you want to configure to use with the custom message listener.
  2. Choose Transports> Custom in the Virtual Asset Deployment Settings. If multiple listeners are installed, use the Select Implementation drop-down menu to select SFTP Listener.
  3. Configure the connection and security settings (see Configuration).

Configuration

You can configure the following settings.

Listener Settings

SFTP Server PortDefines the port for the SFTP server. If empty, the listener will not start.
Authorization TypeDefines how users authenticate with the SFTP server. Options are Password, PublicKey, or none. If empty, the listener will not start.
User Properties File

Specifies the absolute path to a properties file used to define user home directories and plain text passwords (used with password authentication).

There is no limit to the number of users that can be added. The properties file should be configured using the following format:

<user name>.home=<absolute path to home directory>/<user name>.password=<plain text password>

You must use a forward slash (/) as the file separator on all operating systems, including Windows.

If this field is empty, the listener will not start.

Host Key LocationDefines the absolute path to a PEM-formatted private key file, which will be used as the SFTP server's host key. If empty, the listener will not start.
Authorized Keys

Defines the absolute path to an authorized keys file, which should contain PEM-formatted public keys. Because keys are not tied a specific username, the same private key can be used by multiple users.

If PublicKey authentication is specified, this field must be defined. If another authorization type is defined, this field will be ignored.

Listener Type

Defines the type of listener to stand up with the SFTP server.

A Command listener notifies Virtualize after each command that is performed.

A Session listener notifies Virtualize after a user completes a FTP session, passing all the commands performed in a single message.

If empty, the listener will not start.

Debugging

Log Level

Set the log level for the listener. The following values are accepted:
1 - error
2 - warn
3 - info
4 - debug
Default is 2.




  • No labels