Configuring HTTP destinations

Important:

Before your connections can successfully send data to a destination, your Tanium Cloud instance, network egress allow list, and network allow list must be configured. Note the following:

  • Sign in to your Tanium Account and configure a network egress allow list rule for each destination fully qualified domain name (FQDN) and associated port. For more information about how to configure the network egress allow list, see Configuring network egress for Tanium Cloud.

  • Review cloud egress destinations and ports to ensure that a destination FQDN and associated port are in the network egress allow list.

  • TCP traffic that does not use Server Name Indication (SNI) is limited to one destination per port. For example, SQL traffic and SMTP traffic do not use SNI.

  • TCP traffic is not supported for the following ports: 22, 25, 111, 3128, 3129, 3130, 4000, 5000, 6000, 9100, 9301, 9302, 9901, and 9902.

  • UDP traffic is not supported.

  • Your Tanium Cloud instance has a proxy cluster with 2 public IP addresses. If the destination is in your network, add inbound traffic from these IP addresses to your network allow list.

For more information, see Network egress. For assistance, contact Tanium Support.

You can send data from Connect to a REST API. You can choose to send all the data to the REST API in a single batch or in multiple segments. Form data is not supported.

Configure a receiver

You must have a script on your server that can receive the HTTP request from Tanium.

Note: The following examples use a service that only accepts JSON format.

Node.js example

JAVASCRIPT
'use strict';
const restify = require('restify');
const fs = require('fs');
const server = restify.createServer({ name: 'File Receiver' });

let file = 0;
const dir = 'files';
if (!fs.existsSync(dir)) {
    fs.mkdirSync('files');
}

function postFile(req, res, next) {
    const fileName = `files/testing${file++}.txt`;
    const fileData = JSON.stringify(req.body);
    fs.writeFile(fileName, fileData, err => {
        if (err) {
            console.error('err', err);
            res.send(500, err);
        } else {
            console.log(`wrote to file ${fileName}`);
            res.send(200);
        }
        next();
    });
}

server.post('/post', postFile);
server.listen(17800, '0.0.0.0', () => {
    console.log(`${server.name} listening at ${server.url}`);
});

Python example

PYTHON
from flask import Flask, request, Response
import os
import json
app = Flask(__name__)

file = 0
dir = 'files'
os.makedirs(dir, exist_ok=True)

@app.route("/post", methods=['POST'])
def connection_handle():
    global file
    file_data = json.dumps(request.get_json())
    file_name = f"{dir}/testing{file}.txt"
    file += 1
    try: 
        file_handle = open(file_name, mode="w", encoding="utf-8")
        file_handle.write(file_data)
        file_handle.close()
    except:
        return Response('err', status=500, mimetype='application/json')
    return 'done'

app.run(host = '0.0.0.0', port = 17800)

Ruby example

JSON
require "sinatra"
require "fileutils"

set :port, 17800
set :bind, "0.0.0.0"

file = 0
dir = "files"
FileUtils.mkdir_p dir

post "/post" do
  file_data = JSON.parse request.body.read
  file_name = "#{dir}/testing#{file}.txt"
  file += 1
  begin
    File.write file_name, file_data.to_json
    puts "wrote to file #{file_name}"
    return
  rescue Exception => e
    status 500
    "err #{e}"
  end
end

Specify general connection information

  1. From the Main menu, go to Modules > Connect > Overview. Go to the Connections section and click Create Connection.
  2. Enter a name and description for the connection.
  3. (Optional) In the General Information section, expand Advanced to configure the following settings:
    Log Level

    By default, Log Level is set to Information. To reduce the amount of logging, you can set Log Level to Warning, Error, or Fatal.

    Example Log Level setting
    Override Log Level

    If you are debugging the connection, select Override Log Level to set a Temporary Log Level (such as Trace or Debug) on this connection for a selected Number of Runs (up to 24). A scheduled or manual connection run, once started, counts towards the number of runs, regardless of the connection status. After the number of runs elapses, the logging for this connection returns to the Log Level you selected to prevent finer-grained logging from consuming additional resources for an indefinite number of runs.

    Minimum Pass Percentage

    Minimum percentage of the expected rows that must be processed for the connection to succeed.

    Memory Ceiling (GB)

    Maximum memory for the node process to run the connection. This defaults to 1 GB per connection, and cannot exceed the global maximum sum of memory for all running connections (by default, 8 GB). Increase this setting if a connection frequently exhibits out of memory errors while running.

    Note: If the sum of simultaneously scheduled connection Memory Ceiling values exceed the global Memory Ceiling, connections run until the global Memory Ceiling is reached, then any remaining connections enter a waiting queue if you select the Queue Connections configuration setting, or fail if you clear the Queue Connections configuration setting.

Configure the connection source

The connection source determines what data you are sending to the destination. This data is usually information from Tanium, such as a saved question, question log, client status, or event. The settings vary depending on which source you choose.

Figure 1. Connection source settings
Connection source settings
Note: After you create a connection, you cannot update the connection source type, only the source configuration. If you want to change the source type, create a new connection.

For more information about available connection sources, see Connection sources.

Configure the HTTP destination

Specify the URL, method, and headers for the destination to which you want to send data.

Note: After you create a connection, you cannot update the connection destination type, only the destination configuration. If you want to change the destination, create a new connection.
  1. Select HTTP for the destination and then provide a name for the destination.
    • Create a new destination: Specify a unique name to save the configuration information as a new destination. Select New and then enter a Destination Name

    • Copy an existing destination: Select New, and then click Copy Settings. Select a destination, click Apply, and update the Destination Name.

    • Reuse an existing destination: Select Existing, and then select a Destination Name.

      Note: Configure a unique destination per connection. If you edit the settings for a shared destination for one connection, any other connections that use the shared destination are affected, and connection runs might fail.
    Example Connect configuration for an HTTP destination
  2. Specify an HTTPS URL for the REST API to which you want to send the data and the HTTP method that you want to use for the request. The connection validates the Transport Layer Security (TLS) certificate. You can select Trust on First Use to accept the certificate presented from the server and trust only that certificate for future connection runs.
    Important: The destination URL must be an encrypted HTTPS URL.
    Tip: When you change certificates, you can edit the connection to remove the previous trusted certificate. This option is available after the connection runs and trusts the certificate.
    Note: If a connection or connection setting shows Warning state-warning, configure a network egress allow list rule to match the configured destination FQDN or IP address and associated port. For more information about how to configure the network egress allow list, see Tanium Cloud User Guide: Configuring network egress for Tanium Cloud.
  3. Add any required headers. To specify multiple headers, click + Add Header.
    Note: Google is deprecating the legacy Backstory Ingestion API key authentication method for Google Security Operations (SecOps), formerly named Chronicle. Google requires OAuth2 or a Service Account JSON file for the direct Ingestion API. Connect does not support that authentication format. To send data to SecOps, set the destination URL to the endpoint URL from the SecOps Webhook Feed and add two headers to the destination: X-goog-api-key with an API key restricted to Chronicle and X-Webhook-Access-Key with the Webhook Feed secret. For the current deprecation timeline, see Google Cloud: Chronicle deprecations.
  4. Select an authentication method from Use Authentication. Configure one of the following:
    • None - Do not authenticate against the HTTP destination.

    • Basic Authentication - Authenticate against the HTTP destination with a User Name and Password.

    • Header Authentication - Authenticate against the HTTP destination using an HTTP Authorization request header containing the Auth Header Name and Secret value.

      Note: For connections to Splunk instances that use the HTTP destination, enter Authorization for Auth Header Name and use the format Splunk <token-string> for the Secret value. Replace <token-string> with the token string from Splunk.
    • IBM Cloud IAM - API Key - Authenticate against an IBM Cloud HTTP destination with an IAM token generated from the Secret API key you enter.

    Note: Click Test Authentication for the IBM Cloud IAM - API Key authentication method to confirm that you entered the proper authentication information.
    Note: If you edit a saved connection, enter the Secret again before you click Test Authentication. The test does not use the saved secret.
  5. If you need to configure the batch size or the timeout, expand Advanced.
    Example advanced configuration for an HTTP destination
    • Select Restrict data sent by batch size to configure a Batch Size Unit in number of Bytes or number of Records. Configuring a batch size creates multiple POST requests when data is sent to the destination. Each request contains up to the configured number of records, or up to the configured number of bytes, until all data is sent. If the Batch Size is 0, all records are sent in one POST request to the destination.

      Note: If you configure a Batch Size in number of Bytes, a POST request can exceed this if a single record is larger than the configured number of bytes.
    • Configure a connection Timeout in number of seconds.

Configure filters

(Optional) In the Configure Output > Filters section, you can specify filters to modify the data that you are getting from your connection source before it is sent to the destination.

For more information about the types of filters you can configure, see Reference: Filtering options.

Format data for HTTP

You can choose to save your file in all of the available formats, as listed in Reference: Format types. The default format is JSON. Each format has slightly different configuration options, but all allow you to choose which column data to save.

Note: If the data format supports row delimiter characters, update the characters to ensure that individual rows are sent in a format that the destination can parse. You can define one or more of \n (new line), \r (carriage return), and \t (tab).

In the Configure Output > Columns section, you can change the Destination Label of each column and Value Type to force the column to be a String, Numeric, or Date/Time value.

Figure 2. Columns section with Destination Label and Value Type fields
Columns section with Destination Label and Value Type fields

If you choose Numeric for the value, you can specify a default value that is used if the data cannot be coerced into a numeric value. You can specify any negative or positive number.

If you choose Date/Time for the value, specify the format that you want to use for the column. For more information about how to use a variable, see Time stamp variables.

For more information about column customizations, see Reference: Column customizations.

Schedule the connection

Connections can run at a highly configurable time interval, such as multiple times per hour, day, week, or month.

Important: Connections scheduled to run during a Tanium Cloud maintenance window might be interrupted or fail. Schedule your connections to run outside of the Tanium Cloud maintenance window.
Note: If you do not enable the schedule, the connection only runs when you manually run it, unless you configure an Event source. Connections with Event sources only run when a configured event is detected, and cannot be scheduled or manually run.

Use the Schedule section to update the schedule:

  • Select Enable schedule.

  • In the Schedule Type, select Basic to build a schedule with the provided controls.

  • To view or edit the cron expression directly, select Advanced - Define as a Cron Expression, and use the Advanced field to edit the cron expression.

Note: If a user that owns a scheduled connection is deleted, future scheduled instances of that connection do not run. For more information, see Issue: Scheduled connection owned by a deleted user no longer runs.

For more information about cron syntax, see Reference: Cron syntax for Connect.

Enable listening for an event

Connections with Event sources only run when a configured event is detected, and cannot be scheduled or manually run.

Use the Enablement section to send data when a configured event is detected:

  • Select Listen for this Event.

Save and verify connection

  1. After you enter the details for the connection, click Save.
    Tip: To save the connection and immediately run the connection, click Run and Save.

    If needed, resolve any errors or missing information. After the connection creates successfully, the connection details appear.

  2. To view details when the connection runs, click the Logs tab.
  3. To view an individual run log, expand the row table. For more information about how to resolve errors, see Troubleshooting.