Configuring SQL Server destinations
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 use SQL Server destinations to store historical results for analysis and integration with third-party systems. You can forward the results from saved questions and other data sources to a database table.
System requirements
-
Microsoft SQL Server 2008 or later, Microsoft SQL Server 2008 Express or later
-
Database application server must be accessible from the Tanium Module Server
-
User credentials with db_ddladmin and db_datawriter role membership to an account on the Microsoft SQL Server that can insert data, create tables (optional), and run stored procedures (optional)
Set up the database
Decide whether to use an existing database or create a new database.
Sample SQL Script for creating stored procedures
GO
/****** Object: Table [dbo].[connection_log] Script Date: 4/25/2017 8:02:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[connection_log](
[connectionRunId] [bigint] NOT NULL,
[connectionId] [bigint] NOT NULL,
[connectionName] [nvarchar](200) NOT NULL,
[source] [nvarchar](200) NOT NULL,
[databaseTable] [nvarchar](100) NULL,
[startTime] [datetime] NOT NULL,
[endTime] [datetime] NULL,
[runStatus] [nvarchar](20) NOT NULL,
[expectedRowCount] [bigint] NOT NULL,
[sourceRowCount] [bigint] NOT NULL,
[destinationRowCount] [bigint] NOT NULL,
PRIMARY KEY CLUSTERED
(
[connectionRunId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: StoredProcedure [dbo].[sp_onConnectionFinish] Script Date: 4/25/2017 8:02:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[sp_onConnectionFinish]
@connectionRunId bigint,
@runStatus nvarchar(20),
@sourceRowCount bigint,
@destinationRowCount bigint,
@finishTime datetime
as
BEGIN
update connection_log set runStatus = @runStatus, sourceRowCount = @sourceRowCount,
destinationRowCount = @destinationRowCount, endTime = @finishTime
where connectionRunId = @connectionRunId
END
GO
/****** Object: StoredProcedure [dbo].[sp_onConnectionStart] Script Date: 4/25/2017 8:02:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_onConnectionStart]
@connectionName nvarchar(200),
@connectionId bigint,
@connectionRunId bigint,
@source nvarchar(200),
@databaseTable nvarchar(100),
@startTime datetime,
@expectedRowCount bigint
AS
BEGIN
if exists (select * from connection_log where ConnectionRunId = @connectionRunId) BEGIN
delete connection_log where ConnectionRunId = @connectionRunId
END
insert into connection_log (connectionRunId, connectionId, connectionName, source, databaseTable,
startTime, endTime, runStatus, expectedRowCount, sourceRowCount, destinationRowCount)
values (@connectionRunId, @connectionId, @connectionName, @source, @databaseTable, @startTime, null,
'Running', isnull(@expectedRowCount, 0), 0, 0)
END
GO
You can use the following parameters for pre-run stored procedures:
-
Connection Name: @connectionName
-
Connection ID: @connectionId
-
Connection Run ID: @connectionRunId
-
Source Name: @source
-
Database Table: @databaseTable
-
Start Time: @startTime
-
Expected Row Count: @expectedRowCount
You can use the following parameters for post-run stored procedures:
-
Connection Name: @connectionName
-
Connection ID: @connectionId
-
Connection Run ID: @connectionRunId
-
Source Name: @source
-
Database Table: @databaseTable
-
Start Time: @startTime
-
Expected Row Count: @expectedRowCount
-
Run Status: @runStatus
-
Source Row Count: @sourceRowCount
-
Destination Row Count: @destinationRowCount
-
Finish Time: @endTime
Configure sending data to an on-premises destination that is not accessible from the external internet
Certain destinations support using a configured satellite to send data to an on-premises server that is not accessible from the external internet. Make sure that your environment meets the following requirements:
-
Tanium Client: 7.7.3.8176 or later
-
Tanium Direct Connect
-
Configure at least one satellite that can establish communications with the on-premises destination. For the best results, use a satellite with at least four processor cores and 16 GB of memory. Satellites with less memory might be sufficient for small data volumes. Satellite configuration requires the Direct Connect Satellite write permission. For more information, see Managing satellites.
-
-
Tanium Endpoint Configuration
-
Tanium Endpoint Configuration installs Client Extensions and other tools for Direct Connect on endpoints. Sending Tanium Cloud data using a configured satellite requires Core CX 2.15.1306 or later and DEC CX 2.10.1745 or later. For more information, see Client extensions.
-
-
To configure the connection destination, configure a custom role that includes the Direct Connect Satellite read and Client Stream write Direct Connect permissions. For more information, see Configure a custom role.
Note: Assign the Sensor read permission for the Endpoint Configuration content set to users who need to configure satellites.-
If a user has the Sensor read permission for the Endpoint Configuration content set, satellites that do not have the required versions of core-cx or dec-cx endpoint tools do not appear as options.
-
If a user does not have the Sensor read permission for the Endpoint Configuration content set, satellites that do not have the required versions of core-cx or dec-cx endpoint tools can still appear as options. If you select a satellite that does not have the required versions of the endpoint tools, an error appears when you try to save the connection.
The Connect Operator system role contains the required permissions in addition to the Sensor read permission.
-
-
Ensure that each user is assigned the custom role, and has access to the computer group containing the satellite intended for sending data to an on-premises destination. For more information, see Manage computer group assignments for a user.
Note the following:
-
You can configure a bandwidth throttle to limit the bandwidth and the number of concurrent connections used to send data to satellites. For more information, see Managing bandwidth throttles.
-
You cannot configure a connection using a satellite until the satellite status updates to online. Satellites might take several minutes or more to update to online after configuration.
-
Connection sources that gather information from endpoints, such as the Saved Question source, must finish gathering information before the satellite connection is established.
-
The Retrieve Properties and Retrieve Columns buttons use the configured Connect Timeout advanced setting value. Because on-premises destinations might require more time to establish a connection, increase Connect Timeout to 60 seconds.
Specify general connection information
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.
For more information about available connection sources, see Connection sources.
Configure SQL Server destination
Specify information about how to connect to your database application server, test the database application server connection, and configure which data is added to the database tables and rows.
Configure filters
(Optional) In the 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.
Map database table columns
(Optional) You can view and change the mapping of the data from your source to the columns in your database table.
If the source is a saved question, the following columns are also available for writing to the SQL Server destination:
-
Band Number: The source row number. When flattened, this number is in each row that is associated with a row number that is received from Tanium.
-
Row Number: The destination row number. This value is a counter for the rows that are output per connection run. The value is unique for each connection run.
In the 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.
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.
Your connection is listed on the Connect Overview page and data is sent to the Microsoft SQL Server at the interval you specified. You might want to check your database table to verify that the data is being exported correctly.
Schedule the connection
Connections can run at a highly configurable time interval, such as multiple times per hour, day, week, or month.
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.
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.