Skip to main content
Version: Cloud

Monitor AWS Secure Shell File Transfer Protocol

Overview

The Secure Shell (SSH) File Transfer Protocol (SFTP) Plugin of SnappyFlow collects SFTP metrics and logs from CloudWatch and visualize them within SnappyFlow dashboard. This integration is designed to give you comprehensive insights about SFTP.

Prerequisite

To collect metrics from SFTP, it is necessary to have an IAM Role with CloudWatch access and sfPoller set up within your AWS environment. Click here to learn more about setting up sfPoller in your AWS environment.

Create CloudWatch Access for IAM Role

  1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.

  2. Follow the below steps to create a policy in the IAM console.

    • Navigate to Access Management > Policies

    • In the Create policy window, go to the JSON tab

    • Copy and paste the below-mentioned JSON code into the policy editor

      {
      "Version": "2012-10-17",
      "Statement": [
      {
      "Effect": "Allow",
      "Principal": {
      "Service": "transfer.amazonaws.com"
      },
      "Action": "sts:AssumeRole",
      },
      ],
      }
    • Click the Next: Tags > Next: Review button

    • In the Review policy window, give the Name and Description (Optional) for the policy and review the list of permissions

    • Click the Create policy button

    • Attach the policy to a dedicated IAM Role for read-only access

Configure sfPoller to Collect Metrics

Follow the below step to add endpoints and plugins in sfPoller.

  1. Go to the Application tab of sfPoller and navigate to your Project > Application.

  2. Select the Application, it will take you to the Endpoint page.

  3. In the Endpoint page, select the Add Endpoint button, add the following data, and save.

    • Service Type: Select AWS Service
    • Account Name: aws
    • Endpoint Type: SFTP
    • Name: Give a meaningful name to the endpoint
    • Instance Name: Give the server id as instance name

  1. In the Plugins window, select the +Add button.

  2. In the Add Plugin window, select the below details.

    • Plugin Type: Metric
    • Plugin: cloudwatch-sftp
    • Interval: Choose an interval value. The minimum value for the interval is 300
    • Status: By default, the status is Enabled

  1. Select the Save button.

  2. Again select the +Add button and in the Add Plugin window, add below details to collect logs of SFTP.

    • Plugin Type: Logger

    • Plugin: cloudwatch-sftp-logs

    • Log Group: Give the name of cloudwatch log group to which the stream events are being sent

    • Interval: Choose an interval value. The minimum value for the interval is 300

    • Status: By default, the status is Enabled


  3. Select the Save button.

  4. Click the global Save button in the window's top right corner to save all the changes made so far.

View SFTP Metrics and Logs

Follow the below steps to view the metrics collected from AWS SFTP.

  1. Go to the Application tab in SnappyFlow and navigate to your Project > Application > Dashboard.

  2. You can view the SFTP metrics in the Metrics section and logs in the Log Management section.

    note

    Once plugin is added to sfPoller, they will be automatically detected within the Metrics and log management section. However, if the plugins are not detected, you can import template to view the corresponding metrics and logs.



  3. To access the unprocessed data gathered from the plugins, navigate to the Browse data section and choose the Index: Metric, Instance: Endpoint, Plugin, and Document Type.

Template Details

TemplatePluginDocument TypeDescription
SFTPcloudwatch-sftpserverDesription, serverMetrics, userDescriptionCollects metrics from SFTP
-cloudwatch-sftp-logseventStreamsCollects logs from SFTP

Metric List

Server Description
MetricDescription
SFTPUserCountNumber of active SFTP users connected to the server.
serverArnARN of the server.
SFTPStateCondition of the server that was described.
SFTPDescribes whether the protocol is present in the server.
ProtocolsProtocols configured in the server.
SFTPPreAuthenticationFailuresNumber of failed pre-authentication attempts by SFTP users.
SFTPAuthenticationFailuresNumber of failed authentication attempts by SFTP users.
Server Metrics
MetricDescription
sumFilesOutNumber of file transferred out of server.
sumFilesInNumber of file transferred into server.
sumBytesOutNumber of bytes transferred out of server.
sumBytesInNumber of bytes transferred into server.
sumOnUploadExecutionsStartedNumber of uploads started in the server.
sumOnUploadExecutionsSuccessNumber of uploads successfully happened in the server.
sumOnUploadExecutionsFailedNumber of uploads failed in the server.
User Description
MetricDescription
UserNameName of SFTP user.
HomeDirectoryHome Directory of the SFTP user.
HomeDirectoryTypeHome Directory Type of SFTP user.
SshPublicKeyCountSSH Public Key Count of the SFTP user.
RoleRole of the SFTP user.
UserArnARN of the SFTP user.
Event Streams
MetricDescription
SFTPTransferCountNumber of file transfers initiated by SFTP users.
SFTPPreAuthenticationFailuresNumber of failed pre-authentication attempts by SFTP users.
SFTPAuthenticationFailuresNumber of failed authentication attempts by SFTP users.