How to push results to an SFTP server

After running an activation query, you can push the resulting file to an SFTP server.

To do so, you will need to create a connection between InfoSum Platform and the SFTP server. The query results will then be streamed to the destination and then the connection will be removed.

Before starting, you will need the following information to hand:

  • Host

  • Port

  • Username

  • One of:

    • Password

    • Private Key Pem (Password-less connection). 

  • Path (push directory needs to have a relative path - i.e. must not begin with a '/')

  • Filename

  • Host public key in one of the format:
    • OpenSSH authorised_keys - "Authorised Keys"
    • OpenSSH known_hosts - "Known Hosts"
    • PEM - "Public Key PEM"
  • GPG Public Key (to export an encrypted file)

You activate the results in two ways.

1) Using Segment Builder

  • Define your audiences by creating an audience using the Audience tab. 
  • Go to Segments, click new Segment, and select the previously created AUDIENCE from the drop-down under the Audience.
  • Once you defined your targeted audience, click on New Activation button on  top right
  • Select the Activation partner from the Activation Dataset dropdown and output column
  • Give a name to the campaign
    Screenshot 2020-07-30 at 14.37.18

2) Using the Query Tool

Write the activation query and select Create Campaign.

For information on how to write IQL queries, please see the language documentation.

Screenshot 2020-07-30 at 14.39.01
You will then be taken to the Activation tab, where you will see some information about the campaign and its status. The total rows gives you an insight into the size of the dataset, before pushing it to the destination.

Screenshot 2020-07-30 at 14.40.18 

At the bottom of the page, you will see a box providing more details on the campaign, such as the query used and the name of the output column. There are three menu tabs within this box - Details, Pushes, and Push Connectors. Once you've pushed the results, the details and status will be viewable under the Pushes tab.

For now, switch to Push Connectors and use the slider to enable SFTP. The form below will now appear. Once you've filled in and saved the connection details, press Save and switch to Host Verification.

Screenshot 2020-07-30 at 14.41.27

The above form contains four different things:

  1. Connection - Fields: Host, Port, Path
  2. Authentication - Fields: Username, Password or Private Key Pem
  3. Host Verification - Fields: Authorized Keys or Known Hosts or Public Key Pem
  4. GPG Encryption -  GPG Public to encrypt the file

You may need to enter three different keys for different purposes. Here are the keys.

User's SSH private key:

You can ignore this field if you are establishing a connection using a password.

This is a user authorisation key (User's SSH private key) replacing the password and will be in the form of a public/private key pair. 

If you are establishing a connection using SSH key/password-less, you will need to add the public ssh key into the authorized keys file on your server and put the private SSH key in the Private Key Pem field in UI.

Host Verification Key:

You will need to enter a host public key in one of the below format (You need to enter only one)

  • Host Public Keys (OpenSSH authorized_keys format) - "Authorised Keys" in Bunker UI
  • Host Public Keys (OpenSSH known_hosts format) - "Known Hosts" in Bunker UI
  • Host Public Keys (PEM Format)  - "Public Key PEM" in Bunker UI

Please note this key is NOT the same as the public part of the user SSH key, this is a public key associated with your server, not with your user.

You can find this key in one of two ways.
1) Your IT team can look it up on the server (probably in the /etc/ssh directory) and there will be a number of files e.g.
     - ssh_host_ecdsa_key.pub
     - ssh_host_ed25519_key.pub
The contents of one of these files can just be put straight into the "Authorised Keys" field on the bunker UI. An example format for the ecdsa file:

ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdH..........<redacted>........LB9u5V+o

2) Alternatively, you can SSH into your server then generate a key pair using the following command "ssh-keygen -F <hostname>" then look up in your local known_hosts file for the public key for that host.

GPG Key:

You can ignore this field if you are not exporting an encrypted file.

You will need to generate a public/private key pair. You need to provide GPG public key to encrypt your file.

When you entered all required fields, click Save. When you select Save, the Activate button will become clickable. Selecting this button will begin the file stream.

Screenshot 2020-07-30 at 14.47.46

Switch to the Pushes tab to see the status and check for any errors. Once the status has a green tick, the file has been successfully pushed to the SFTP server.