Tanium Threat Response
Use the Tanium Threat Response integration to manage endpoints processes, evidence, alerts, files, snapshots, and connections. This Integration works with Tanium Threat Response version below 3.0.159. In order to use Tanium Threat Response version 3.0.159 and above, use Tanium Threat Response V2 Integration.
Endpoint · Tanium Threat Response
Details
| ID | Tanium Threat Response |
|---|---|
| Provider | Tanium |
| Category | Endpoint |
| From Version | 5.0.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Supported Modules | Agentix XSIAM |
README
Tanium Threat Response - This Integration works with Tanium Threat Response version below 3.0.159. In order to use Tanium Threat Response version 3.0.159 and above, use Tanium Threat Response V2 Integration.
Configure Tanium Threat Response in Cortex
| Parameter | Description | Required |
|---|---|---|
| isFetch | Fetch incidents | False |
| incidentType | Incident type | False |
| url | Hostname, IP address, or server URL | True |
| credentials | Username | True |
| insecure | Trust any certificate (not secure) | False |
| proxy | Use system proxy settings | False |
| fetch_time | First fetch timestamp ({number} {time unit}, e.g., 12 hours, 7 days) | False |
| filter_alerts_by_state | A comma-separated list of alert states to filter by in fetch incidents command. Possible options are: unresolved, in progress, resolved or suppressed. Empty list won’t filter the incidents by state. | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
tanium-tr-get-intel-doc-by-id
Returns an intel document object based on ID.
Base Command
tanium-tr-get-intel-doc-by-id
Input
| Argument Name | Description | Required |
|---|---|---|
| intel-doc-id | The intel document ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.IntelDoc.AlertCount | Number | The number of alerts that currently exist for this intel. |
| Tanium.IntelDoc.CreatedAt | Date | The date at which this intel was first added to the system. |
| Tanium.IntelDoc.Description | String | The description of the intel, as declared in the document or as updated by a user. |
| Tanium.IntelDoc.ID | Number | The unique identifier for this intel in this instance of the system. |
| Tanium.IntelDoc.LabelIds | Number | The IDs of all labels applied to this intel. |
| Tanium.IntelDoc.Name | String | The name of the intel, as declared in the document or as updated by a user. |
| Tanium.IntelDoc.UnresolvedAlertCount | Number | The number of unresolved alerts that currently exist for this intel. |
| Tanium.IntelDoc.UpdatedAt | Date | The date when this intel was last updated. |
Command Example
!tanium-tr-get-intel-doc-by-id intel-doc-id=2
Context Example
{
"Tanium": {
"IntelDoc": {
"AlertCount": 0,
"CreatedAt": "2019-07-31T18:46:28.814Z",
"Description": "Detects usage of the NET.EXE utility to enumerate members of the local Administrators or Domain Administrators groups. Often used during post-compromise reconnaissance.",
"ID": 2,
"LabelIds": [
2,
3,
9,
16
],
"Name": "Administrator Account Enumeration",
"UnresolvedAlertCount": 0,
"UpdatedAt": "2020-01-14T21:37:30.934Z"
}
}
}
Human Readable Output
Intel Doc information
| ID | Name | Description | Type | Alert Count | Unresolved Alert Count | Created At | Updated At | Label Ids |
|---|---|---|---|---|---|---|---|---|
| 2 | Administrator Account Enumeration | Detects usage of the NET.EXE utility to enumerate members of the local Administrators or Domain Administrators groups. Often used during post-compromise reconnaissance. | 0 | 0 | 2019-07-31T18:46:28.814Z | 2020-01-14T21:37:30.934Z | 2, 3, 9, 16 |
tanium-tr-list-intel-docs
Returns a list of all intel documents.
Base Command
tanium-tr-list-intel-docs
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of intel documents to return. | Optional |
| offset | The offset number to begin listing intel documents. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.IntelDoc.AlertCount | Number | The number of alerts that currently exist for this intel. |
| Tanium.IntelDoc.CreatedAt | Date | The date at which this intel was first added to the system. |
| Tanium.IntelDoc.Description | String | The description of the intel, as declared in the document or as updated by a user. |
| Tanium.IntelDoc.ID | Number | The unique identifier for this intel in this instance of the system. |
| Tanium.IntelDoc.LabelIds | Number | The IDs of all labels applied to this intel. |
| Tanium.IntelDoc.Name | String | The name of the intel, as declared in the document or as updated by a user. |
| Tanium.IntelDoc.UnresolvedAlertCount | Number | The number of unresolved alerts that currently exist for this intel. |
| Tanium.IntelDoc.UpdatedAt | Date | The date when this intel was last updated. |
Command Example
!tanium-tr-list-intel-docs limit=2
Context Example
{
"Tanium": {
"IntelDoc": [
{
"AlertCount": 0,
"CreatedAt": "2020-01-14T21:37:32.263Z",
"ID": 99,
"LabelIds": [
2,
7,
11,
16
],
"Name": "Spooler Service Creating or Spawning Executables",
"UnresolvedAlertCount": 0,
"UpdatedAt": "2020-01-14T21:37:32.263Z"
},
{
"AlertCount": 0,
"CreatedAt": "2020-01-14T21:37:32.075Z",
"ID": 98,
"LabelIds": [
2,
8,
16
],
"Name": "RunDll Creating MiniDump",
"UnresolvedAlertCount": 0,
"UpdatedAt": "2020-01-14T21:37:32.075Z"
}
]
}
}
Human Readable Output
Intel docs
| ID | Name | Alert Count | Unresolved Alert Count | Created At | Updated At | Label Ids |
|---|---|---|---|---|---|---|
| 99 | Spooler Service Creating or Spawning Executables | 0 | 0 | 2020-01-14T21:37:32.263Z | 2020-01-14T21:37:32.263Z | 2, 7, 11, 16 |
| 98 | RunDll Creating MiniDump | 0 | 0 | 2020-01-14T21:37:32.075Z | 2020-01-14T21:37:32.075Z | 2, 8, 16 |
tanium-tr-list-alerts
Returns a list of all alerts.
Base Command
tanium-tr-list-alerts
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of alerts to return. The default value is 5. | Optional |
| offset | The offset number to begin listing alerts. | Optional |
| computer-ip-address | Filter alerts by the specified computer IP addresses. | Optional |
| computer-name | Filter alerts by the specified computer name. | Optional |
| scan-config-id | Filter alerts by the specified scan config ID. | Optional |
| intel-doc-id | Filter alerts by the specified intel document ID. | Optional |
| severity | Filter alerts by the specified severity. | Optional |
| priority | Filter alerts by the specified priority. | Optional |
| type | Filter alerts by the specified type. | Optional |
| state | Filter alerts by the specified state. Can be “Unresolved”, “In Progress”, “Ignored”, or “Resolved”. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Alert.Priority | String | The priority of the alert. |
| Tanium.Alert.ComputerName | String | The hostname of the computer that generated the alert. |
| Tanium.Alert.GUID | String | A globally unique identifier for this alert in the customer environment. |
| Tanium.Alert.AlertedAt | Date | The moment that the alert was generated. |
| Tanium.Alert.UpdatedAt | Date | The last time the alert state was updated. |
| Tanium.Alert.State | String | The current state of the alert. For example, “unresolved”, “inprogress”, and so on. |
| Tanium.Alert.ComputerIpAddress | String | The IP address of the computer that generated the alert. |
| Tanium.Alert.Type | String | The name of the alert type. For example, “detect.endpoint.match”. |
| Tanium.Alert.ID | Number | The ID of the alert. For example, “123”. |
| Tanium.Alert.CreatedAt | Date | The date when the alert was received by the Detect product. |
| Tanium.Alert.IntelDocId | Number | The intel document revision, if intelDocId is present. |
| Tanium.Alert.Severity | String | The severity of the alert. |
Command Example
!tanium-tr-list-alerts limit=1
Context Example
{
"Tanium": {
"Alert": {
"AlertedAt": "2019-09-22T14:01:31.000Z",
"ComputerIpAddress": "172.0.0.0",
"ComputerName": "HOST_NAME",
"CreatedAt": "2019-09-22T14:01:59.768Z",
"GUID": "a33e3482-556e-4e9d-bbbd-2fdbe330d492",
"ID": 1,
"IntelDocId": 64,
"Priority": "high",
"Severity": "info",
"State": "Unresolved",
"Type": "detect.match",
"UpdatedAt": "2020-02-05T14:55:41.440Z"
}
}
}
Human Readable Output
Alerts
| ID | Type | Severity | Priority | Alerted At | Created At | Updated At | Computer Ip Address | Computer Name | GUID | State | Intel Doc Id |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | detect.match | info | high | 2019-09-22T14:01:31.000Z | 2019-09-22T14:01:59.768Z | 2020-02-05T14:55:41.440Z | 172.0.0.0 | HOST_NAME | a33e3482-556e-4e9d-bbbd-2fdbe330d492 | Unresolved | 64 |
tanium-tr-get-alert-by-id
Returns an alert object based on alert ID.
Base Command
tanium-tr-get-alert-by-id
Input
| Argument Name | Description | Required |
|---|---|---|
| alert-id | The alert ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Alert.Priority | String | The priority of the alert. |
| Tanium.Alert.ComputerName | String | The hostname of the computer that generated the alert. |
| Tanium.Alert.GUID | String | A globally unique identifier for this alert in the customer environment. |
| Tanium.Alert.AlertedAt | Date | The date when the alert was generated. |
| Tanium.Alert.UpdatedAt | Date | The date when the alert state was last updated. |
| Tanium.Alert.State | String | The current state of the alert. For example, “unresolved”, “inprogress”. |
| Tanium.Alert.ComputerIpAddress | String | The IP address of the computer that generated the alert. |
| Tanium.Alert.Type | String | The name of the alert type. For example, “detect.endpoint.match”. |
| Tanium.Alert.ID | Number | The ID of the alert. For example, “123”. |
| Tanium.Alert.CreatedAt | Date | The date when the alert was received by the Detect product. |
| Tanium.Alert.IntelDocId | Number | The intel document revision, if intelDocId is present. |
| Tanium.Alert.Severity | String | The severity of the alert. |
Command Example
!tanium-tr-get-alert-by-id alert-id=1
Context Example
{
"Tanium": {
"Alert": {
"AlertedAt": "2019-09-22T14:01:31.000Z",
"ComputerIpAddress": "172.0.0.0",
"ComputerName": "HOST_NAME",
"CreatedAt": "2019-09-22T14:01:59.768Z",
"GUID": "a33e3482-556e-4e9d-bbbd-2fdbe330d492",
"ID": 1,
"IntelDocId": 64,
"Priority": "high",
"Severity": "info",
"State": "Unresolved",
"Type": "detect.match",
"UpdatedAt": "2020-02-05T14:55:41.440Z"
}
}
}
Human Readable Output
Alert information
| ID | Type | Severity | Priority | Alerted At | Created At | Updated At | Computer Ip Address | Computer Name | GUID | State | Intel Doc Id |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | detect.match | info | high | 2019-09-22T14:01:31.000Z | 2019-09-22T14:01:59.768Z | 2020-02-05T14:55:41.440Z | 172.0.0.0 | HOST_NAME | a33e3482-556e-4e9d-bbbd-2fdbe330d492 | Unresolved | 64 |
tanium-tr-alert-update-state
Updates the state of a single alert.
Base Command
tanium-tr-alert-update-state
Input
| Argument Name | Description | Required |
|---|---|---|
| alert-id | The ID of the alert to update. | Required |
| state | The new state for the alert. Can be “Unresolved”, “In Progress”, “Ignored”, or “Resolved”. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Alert.Priority | String | The priority of the alert. |
| Tanium.Alert.ComputerName | String | The hostname of the computer that generated the alert. |
| Tanium.Alert.GUID | String | A globally unique identifier for this alert in the customer environment. |
| Tanium.Alert.AlertedAt | Date | The date when the alert was generated. |
| Tanium.Alert.UpdatedAt | Date | The date when the alert state was last updated. |
| Tanium.Alert.State | String | The current state of the alert. For example, “unresolved”, “inprogress”. |
| Tanium.Alert.ComputerIpAddress | String | The IP address of the computer that generated the alert. |
| Tanium.Alert.Type | String | The name of the alert type. For example, “detect.endpoint.match”. |
| Tanium.Alert.ID | Number | The ID of the alert. For example, “123”. |
| Tanium.Alert.CreatedAt | Date | The date when the alert was received by the Detect product. |
| Tanium.Alert.IntelDocId | Number | The intel document revision, if intelDocId is present. |
| Tanium.Alert.Severity | String | The severity of the alert. |
Command Example
!tanium-tr-alert-update-state alert-id=1 state=Unresolved
Context Example
{
"Tanium": {
"Alert": {
"AlertedAt": "2019-09-22T14:01:31.000Z",
"ComputerIpAddress": "172.0.0.0",
"ComputerName": "HOST_NAME",
"CreatedAt": "2019-09-22T14:01:59.768Z",
"GUID": "a33e3482-556e-4e9d-bbbd-2fdbe330d492",
"ID": 1,
"IntelDocId": 64,
"Priority": "high",
"Severity": "info",
"State": "Unresolved",
"Type": "detect.match",
"UpdatedAt": "2020-02-05T14:55:41.440Z"
}
}
}
Human Readable Output
Alert state updated to Unresolved
| ID | Type | Severity | Priority | Alerted At | Created At | Updated At | Computer Ip Address | Computer Name | GUID | State | Intel Doc Id |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | detect.match | info | high | 2019-09-22T14:01:31.000Z | 2019-09-22T14:01:59.768Z | 2020-02-05T14:55:41.440Z | 172.0.0.0 | HOST_NAME | a33e3482-556e-4e9d-bbbd-2fdbe330d492 | Unresolved | 64 |
tanium-tr-list-snapshots-by-connection
Returns all snapshots of a single connection.
Base Command
tanium-tr-list-snapshots-by-connection
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of snapshots to return. | Optional |
| offset | The offset number to begin listing snapshots. | Optional |
| connection-name | The connection name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Snapshot.ConnectionName | String | The snapshot connection name. |
| Tanium.Snapshot.Error | String | The snapshot error message. |
| Tanium.Snapshot.ID | String | The snapshot id. |
| Tanium.Snapshot.Started | Date | The date when the snapshot was created. |
| Tanium.Snapshot.State | String | The current state of the snapshot. |
Command Example
!tanium-tr-list-snapshots-by-connection connection-name=HOST_NAME limit=2
Context Example
{
"Tanium": {
"Snapshot": [
{
"ConnectionName": "HOST_NAME",
"FileName": "2020_02_06T15.54.43.600Z.db",
"Started": "2020-02-06T15:54:43.600Z",
"State": "complete"
},
{
"ConnectionName": "HOST_NAME",
"Error": "Error checkpointing remote database",
"FileName": "2020_02_06T15.54.46.795Z.db",
"Started": "2020-02-06T15:54:46.795Z",
"State": "error"
}
]
}
}
Human Readable Output
Snapshots
| File Name | Connection Name | State | Started | Error |
|---|---|---|---|---|
| 2020_02_06T15.54.43.600Z.db | HOST_NAME | complete | 2020-02-06T15:54:43.600Z | |
| 2020_02_06T15.54.46.795Z.db | HOST_NAME | error | 2020-02-06T15:54:46.795Z | Error checkpointing remote database |
tanium-tr-create-snapshot
Captures a new snapshot by connection name.
Base Command
tanium-tr-create-snapshot
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
Context Output
There is no context output for this command.
Command Example
!tanium-tr-create-snapshot connection-name=HOST_NAME
Human Readable Output
Initiated snapshot creation request for HOST_NAME.
tanium-tr-delete-snapshot
Deletes a snapshot by connection name and snapshot ID.
Base Command
tanium-tr-delete-snapshot
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| snapshot-id | The snapshot ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Snapshot.ID | String | The snapshot ID. |
| Tanium.Snapshot.ConnectionName | String | The connection name. |
| Tanium.Snapshot.Deleted | Boolean | Whether the snapshot has been deleted. |
Command Example
!tanium-tr-delete-snapshot connection-name=HOST_NAME snapshot-id=2020_02_06T15.54.43.600Z.db
Context Example
{
"Tanium": {
"LocalSnapshot": {
"ConnectionName": "HOST_NAME",
"Deleted": True,
"FileName": "2020_02_06T15.54.43.600Z.db"
}
}
}
Human Readable Output
Snapshot 2020_02_06T15.54.43.600Z.db deleted successfully.
tanium-tr-list-local-snapshots-by-connection
Returns all local snapshots of a single connection.
Base Command
tanium-tr-list-local-snapshots-by-connection
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of local snapshots to return. The default value is 50. | Optional |
| offset | The offset number to begin listing local snapshots. | Optional |
| connection-name | The connection name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.LocalSnapshot.ConnectionName | String | The snapshot connection name. |
| Tanium.LocalSnapshot.FileName | String | The snapshot file name. |
Command Example
!tanium-tr-list-local-snapshots-by-connection connection-name=HOST_NAME limit=2
Context Example
{
"Tanium": {
"LocalSnapshot": [
{
"ConnectionName": "HOST_NAME",
"Deleted": false,
"FileName": "2020_02_06T15.54.43.600Z.db"
},
{
"ConnectionName": "HOST_NAME",
"Deleted": false,
"FileName": "2020_01_09T15.25.13.535Z.db"
}
]
}
}
Human Readable Output
Local snapshots
| File Name | Connection Name |
|---|---|
| 2020_02_06T15.54.43.600Z.db | HOST_NAME |
| 2020_01_09T15.25.13.535Z.db | HOST_NAME |
tanium-tr-delete-local-snapshot
Deletes a local snapshot by directory name and file name.
Base Command
tanium-tr-delete-local-snapshot
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| file-name | The file name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.LocalSnapshot.FileName | String | The snapshot file name. |
| Tanium.LocalSnapshot.Deleted | Boolean | Whether the local snapshot has been deleted. |
Command Example
!tanium-tr-delete-local-snapshot connection-name=HOST_NAME file-name=2020_02_06T15.54.43.600Z.db
Context Example
{
"Tanium": {
"LocalSnapshot": {
"ConnectionName": "HOST_NAME",
"Deleted": true,
"FileName": "2020_02_06T15.54.43.600Z.db"
}
}
}
Human Readable Output
Local snapshot from Directory HOST_NAME and File 2020_02_06T15.54.43.600Z.db is deleted successfully.
tanium-tr-list-connections
Returns all connections.
Base Command
tanium-tr-list-connections
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of connections to return. | Optional |
| offset | The offset number to begin listing connections. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Connection.CreateTime | Date | Time when the connection was first created. |
| Tanium.Connection.Name | String | The connection name. |
| Tanium.Connection.Remote | Boolean | Whether it is a remote connection. |
| Tanium.Connection.State | String | Current connection state. Can be “closed”, “pending”, “active”, “timeout”, or “migrating”. |
| Tanium.Connection.Deleted | Boolean | Whether the connection has been deleted. |
| Tanium.Connection.DestionationType | String | The destionation type (computer_name or ip_address). |
| Tanium.Connection.DST | String | The connection’s DST. |
| Tanium.Connection.OSName | String | The connection’s operating system. |
Command Example
!tanium-tr-list-connections limit=2
Context Example
{
"Tanium": {
"Connection": [
{
"DST": "HOST_NAME",
"Name": "HOST_NAME",
"State": "timeout",
"Deleted": false,
"DestionationType": "computer-name",
"OSName": "Linux"
},
{
"DST": "HOST_NAME-2020_01_09T15.25.13.535Z.db",
"Name": "HOST_NAME-2020_01_09T15.25.13.535Z.db",
"State": "timeout",
"Deleted": false,
"DestionationType": "computer-name"
"OSName": "Linux"
}
]
}
}
Human Readable Output
Connections
| Name | State | DST | OS Name |
|---|---|---|---|
| HOST_NAME | timeout | HOST_NAME | Linux |
| HOST_NAME-2020_01_09T15.25.13.535Z.db | timeout | HOST_NAME-2020_01_09T15.25.13.535Z.db | Linux |
tanium-tr-get-connection-by-name
Returns a connection object based on connection name.
Base Command
tanium-tr-get-connection-by-name
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Connection.CreateTime | Date | Time when the connection was first created. |
| Tanium.Connection.Name | String | The connection name. |
| Tanium.Connection.Remote | Boolean | Whether it is a remote connection. |
| Tanium.Connection.State | String | Current connection state. Can be “closed”, “pending”, “active”, “timeout”, or “migrating”. |
| Tanium.Connection.Deleted | Boolean | Whether the connection has been deleted. |
| Tanium.Connection.DestionationType | String | The destionation type (computer_name or ip_address). |
| Tanium.Connection.DST | String | The connection’s DST. |
| Tanium.Connection.OSName | String | The connection’s operating system. |
Command Example
!tanium-tr-get-connection-by-name connection-name=HOST_NAME
Context Example
{
"Tanium": {
"Connection": {
"CreateTime": "2020-02-06T15:54:40.830Z",
"Name": "HOST_NAME",
"Deleted": false,
"OSName": "Windows",
"Remote": true,
"State": "active"
}
}
}
Human Readable Output
Connection information
| Name | State | Remote | Create Time | OS Name |
|---|---|---|---|---|
| HOST_NAME | active | true | 2020-02-06T15:54:40.830Z | Windows |
tanium-tr-create-connection
Creates a local or remote connection.
Base Command
tanium-tr-create-connection
Input
| Argument Name | Description | Required |
|---|---|---|
| remote | Whether it is a remote connection. Can be “True” or “False”. | Required |
| destination-type | Type of destination. Can be “ip_address” or “computer_name”. | Required |
| destination | Computer name or IP address. | Required |
| connection-timeout | connection timeout, in milliseconds. | Optional |
Context Output
There is no context output for this command.
Command Example
!tanium-tr-create-connection destination=HOST_NAME destination-type=computer_name remote=False
Human Readable Output
Initiated connection request to HOST_NAME.
tanium-tr-delete-connection
Deletes a connection by connection name.
Base Command
tanium-tr-delete-connection
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The name of the connection. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Connection.Name | String | The connection name. |
| Tanium.Connection.Deleted | Boolean | Whether the connection has been deleted. |
Command Example
!tanium-tr-delete-connection connection-name=HOST_NAME
Context Example
{
"Tanium": {
"Connection": {
"Name": "HOST_NAME",
"Deleted": true
}
}
}
Human Readable Output
Connection HOST_NAME deleted successfully.
tanium-tr-list-labels
Returns all available labels in the system.
Base Command
tanium-tr-list-labels
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of labels to return. | Optional |
| offset | The offset number to begin listing labels. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Label.CreatedAt | Date | The date when this label was created. |
| Tanium.Label.Description | String | An extended description of the label. |
| Tanium.Label.ID | Number | The unique identifier for this label. |
| Tanium.Label.IndicatorCount | Number | The number of indicator-based intel documents associated with this label, not including Tanium Signals. |
| Tanium.Label.Name | String | The display name of the label. |
| Tanium.Label.SignalCount | Number | The number of Tanium Signal documents associated with this label. |
| Tanium.Label.UpdatedAt | Date | The date when this label was last updated, not including the intel and signal counts. |
Command Example
!tanium-tr-list-labels limit=2
Context Example
{
"Tanium": {
"Label": [
{
"CreatedAt": "2019-07-31T18:46:28.629Z",
"Description": "These signals have been tested and reviewed internally for syntax. Little or no testing of expected alert generation has been conducted. These signals are not included on the external feed.",
"ID": 1,
"IndicatorCount": 0,
"Name": "Alpha",
"SignalCount": 0,
"UpdatedAt": "2019-07-31T18:46:28.629Z"
},
{
"CreatedAt": "2019-07-31T18:46:28.629Z",
"Description": "These signals have been tested and reviewed internally for syntax. Internal testing of expected alert generation has been verified. Testing on internal systems for false positives has been conducted and tuned if necessary. These signals are included on the external feed.",
"ID": 2,
"IndicatorCount": 0,
"Name": "Beta",
"SignalCount": 97,
"UpdatedAt": "2019-07-31T18:46:28.629Z"
}
]
}
}
Human Readable Output
Labels
| Name | Description | ID | Indicator Count | Signal Count | Created At | Updated At |
|---|---|---|---|---|---|---|
| Alpha | These signals have been tested and reviewed internally for syntax. Little or no testing of expected alert generation has been conducted. These signals are not included on the external feed. | 1 | 0 | 0 | 2019-07-31T18:46:28.629Z | 2019-07-31T18:46:28.629Z |
| Beta | These signals have been tested and reviewed internally for syntax. Internal testing of expected alert generation has been verified. Testing on internal systems for false positives has been conducted and tuned if necessary. These signals are included on the external feed. | 2 | 0 | 97 | 2019-07-31T18:46:28.629Z | 2019-07-31T18:46:28.629Z |
tanium-tr-get-label-by-id
Returns a label object based on label ID.
Base Command
tanium-tr-get-label-by-id
Input
| Argument Name | Description | Required |
|---|---|---|
| label-id | The label ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Label.CreatedAt | Date | The date when this label was created. |
| Tanium.Label.Description | String | An extended description of the label. |
| Tanium.Label.ID | Number | The unique identifier for this label. |
| Tanium.Label.IndicatorCount | Number | The number of indicator-based intel documents associated with this label, not including Tanium Signals. |
| Tanium.Label.Name | String | The display name of the label. |
| Tanium.Label.SignalCount | Number | The number of Tanium Signal documents associated with this label. |
| Tanium.Label.UpdatedAt | Date | The date this label was last updated, not including the intel and signal counts. |
Command Example
!tanium-tr-get-label-by-id label-id=1
Context Example
{
"Tanium": {
"Label": {
"CreatedAt": "2019-07-31T18:46:28.629Z",
"Description": "These signals have been tested and reviewed internally for syntax. Little or no testing of expected alert generation has been conducted. These signals are not included on the external feed.",
"ID": 1,
"IndicatorCount": 0,
"Name": "Alpha",
"SignalCount": 0,
"UpdatedAt": "2019-07-31T18:46:28.629Z"
}
}
}
Human Readable Output
Label information
| Name | Description | ID | Indicator Count | Signal Count | Created At | Updated At |
|---|---|---|---|---|---|---|
| Alpha | These signals have been tested and reviewed internally for syntax. Little or no testing of expected alert generation has been conducted. These signals are not included on the external feed. | 1 | 0 | 0 | 2019-07-31T18:46:28.629Z | 2019-07-31T18:46:28.629Z |
tanium-tr-list-file-downloads
Returns all downloaded files in the system.
Base Command
tanium-tr-list-file-downloads
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of files to return. The default value is 50. | Optional |
| offset | Offset to start getting file downloads. The default is 0. | Optional |
| host | Filter downloaded files by host. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.FileDownload.Size | Number | The size of the file, in bytes. |
| Tanium.FileDownload.Path | String | The path of the file. |
| Tanium.FileDownload.Downloaded | Date | The date when this file was downloaded. |
| Tanium.FileDownload.Host | String | The hostname of the downloaded file. |
| Tanium.FileDownload.Created | Date | The date when the file was created. |
| Tanium.FileDownload.Hash | String | The file hash. |
| Tanium.FileDownload.SPath | String | The file SPath. |
| Tanium.FileDownload.ID | Number | The downloaded file ID. |
| Tanium.FileDownload.LastModified | Date | The date when the file was last modified. |
| Tanium.FileDownload.CreatedBy | String | The user that created this file. |
| Tanium.FileDownload.CreatedByProc | String | The process path that created this file. |
| Tanium.FileDownload.LastModifiedBy | String | The user that last modified this file. |
| Tanium.FileDownload.LastModifiedByProc | String | The process path that modified this file. |
| Tanium.FileDownload.Comments | String | Additional comments for the downloaded file. |
| Tanium.FileDownload.Tags | String | The downloaded file tags. |
| Tanium.FileDownload.Deleted | Boolean | Whether the file download has been deleted. |
Command Example
!tanium-tr-list-file-downloads host=HOST_NAME limit=2 offset=1
Context Example
{
"Tanium": {
"FileDownload": [
{
"Created": "2020-01-02 15:39:57.289",
"CreatedBy": "NT AUTHORITY\\LOCAL SERVICE",
"CreatedByProc": "C:\\Windows\\System32\\svchost.exe",
"Downloaded": "2020-01-02 15:40:29.003",
"Hash": "2ae2da9237309b13b9a9d52d1358c826",
"Host": "HOST_NAME",
"ID": 4,
"LastModified": "2020-01-02 15:39:57.289",
"LastModifiedBy": "NT AUTHORITY\\LOCAL SERVICE",
"LastModifiedByProc": "C:\\Windows\\System32\\svchost.exe",
"Path": "C:\\Windows\\ServiceProfiles\\LocalService\\AppData\\Local\\lastalive1.dat",
"SPath": "6ae86937-611f-45e9-900c-3ba57298f264.zip",
"Size": 2048,
"Deleted": false
},
{
"Created": "Tue, 03 Sep 2019 17:51:40 GMT",
"Downloaded": "2020-01-15 13:04:02.827",
"Hash": "99297a0e626ca092ff1884ad28f54453",
"Host": "HOST_NAME",
"ID": 6,
"LastModified": "Wed, 15 Jan 2020 08:57:19 GMT",
"Path": "C:\\Program Files (x86)\\Tanium\\Tanium Client\\Logs\\log1.txt",
"SPath": "c0531415-87a6-4d28-a226-b485784b1881.zip",
"Size": 10485904,
"Deleted": true
}
]
}
}
Human Readable Output
File downloads
| ID | Host | Path | Hash | Downloaded | Size | Created | Created By | Created By Proc | Last Modified | Last Modified By | Last Modified By Proc | S Path |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | HOST_NAME | C:\Windows\ServiceProfiles\LocalService\AppData\Local\lastalive1.dat | 2ae2da9237309b13b9a9d52d1358c826 | 2020-01-02 15:40:29.003 | 2048 | 2020-01-02 15:39:57.289 | NT AUTHORITY\LOCAL SERVICE | C:\Windows\System32\svchost.exe | 2020-01-02 15:39:57.289 | NT AUTHORITY\LOCAL SERVICE | C:\Windows\System32\svchost.exe | 6ae86937-611f-45e9-900c-3ba57298f264.zip |
| 6 | HOST_NAME | C:\Program Files (x86)\Tanium\Tanium Client\Logs\log1.txt | 99297a0e626ca092ff1884ad28f54453 | 2020-01-15 13:04:02.827 | 10485904 | Tue, 03 Sep 2019 17:51:40 GMT | Wed, 15 Jan 2020 08:57:19 GMT | c0531415-87a6-4d28-a226-b485784b1881.zip |
tanium-tr-get-downloaded-file
Gets the actual content of a downloaded file by file ID.
Base Command
tanium-tr-get-downloaded-file
Input
| Argument Name | Description | Required |
|---|---|---|
| file-id | The file ID. | Required |
Context Output
There is no context output for this command.
Command Example
!tanium-tr-get-downloaded-file file-id=4
Context Example
{
"File": {
"EntryID": "8389@b32fdf18-1c65-43af-8918-7f85a1fab951",
"Extension": "zip",
"Info": "application/zip",
"MD5": "216923cc567afe1009e7c90c105450f5",
"Name": "lastalive1.dat.zip",
"SHA1": "f7d257dc94ea0b650f62cc87264861b593a341c8",
"SHA256": "5d0051b4c596e06217bdb3e48196b0515a7983f18a8ea7477bc33c837e0202e5",
"SHA512": "269669cda90658e1bfea8ff85f27f8f68320ccd3b54c64a00037204fa3b5422634d9107806ddad585fa0d5c7fe7aa7fa240afb4142c6ff02537b039d176bd482",
"SSDeep": "6:5jPRX/CSkILyratwQte+zetPYwCRXgLrCDh/+loUn:5jtCCPtTzep33vCDJaoUn",
"Size": 253,
"Type": "Zip archive data, at least v2.0 to extract"
}
}
Human Readable Output
tanium-tr-list-events-by-connection
Queries events for a connection.
Base Command
tanium-tr-list-events-by-connection
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| event-type | The type of event. Can be “File”, “Network”, “Registry”, “Process”, “Driver”, “Security”, “Combined”, “DNS”, or “Image”. The default is “Combined”. | Required |
| limit | The maximum number of events to return. The default value is 50. | Optional |
| offset | Offset to start getting the result set. The default is 0. | Optional |
| filter | Advanced search that filters according to event fields. For example: [[‘process_id’, ‘gt’, ‘30’], [‘username’, ‘ne’, ‘administrator’]]. Optional fields: process_id, process_name, process_hash, process_command_line, username, process_name, create_time (UTC). Optional operators: eq (equals), ne (does not equal); for integers/date: gt (greater than), gte (greater than or equals), ls (less than), lse (less than or equals); for strings: co (contains), nc (does not contain). | Optional |
| match | Whether the results should fit all filters or at least one filter. | Optional |
| sort | A comma-separated list of fields to sort on prefixed by +/- for ascending or descending and ordered by priority left to right. Optional fields: process_id, process_name, process_hash, process_command_line, username, process_name, create_time (UTC). | Optional |
| fields | A comma-separated list of fields on which to search. Optional fields: process_id, process_name, process_hash, process_command_line, username, process_name, create_time. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| TaniumEvent.Domain | String | The domain of the event. |
| TaniumEvent.File | String | The path of the file in the event. |
| TaniumEvent.Operation | String | The event operation. |
| TaniumEvent.ProcessID | Number | The ID of the process. |
| TaniumEvent.ProcessName | String | The name of the process. |
| TaniumEvent.ProcessTableID | Number | The ID of the process table. |
| TaniumEvent.Timestamp | Date | The date when the event was created. |
| TaniumEvent.Username | String | The username associated with the event. |
| TaniumEvent.DestinationAddress | String | The network event destination address. |
| TaniumEvent.DestinationPort | Number | The network event destination port. |
| TaniumEvent.SourceAddress | String | The network event source address. |
| TaniumEvent.SourcePort | Number | The network event source port. |
| TaniumEvent.KeyPath | String | The registry key path. |
| TaniumEvent.ValueName | String | The registry value name. |
| TaniumEvent.ExitCode | Number | The process exit code. |
| TaniumEvent.ProcessCommandLine | String | The process command line. |
| TaniumEvent.ProcessHash | String | The hash value of the process. |
| TaniumEvent.SID | Number | The process SID. |
| TaniumEvent.Hashes | String | The hashes of the driver. |
| TaniumEvent.ImageLoaded | String | The image loaded path of the driver. |
| TaniumEvent.Signature | String | The signature of the driver. |
| TaniumEvent.Signed | Boolean | Whether the driver is signed. |
| TaniumEvent.EventID | Number | The ID of the event. |
| TaniumEvent.EventOpcode | Number | The event opcode. |
| TaniumEvent.EventRecordID | Number | The ID of the event record. |
| TaniumEvent.EventTaskID | Number | The ID of the event task. |
| TaniumEvent.Query | String | The query of the DNS. |
| TaniumEvent.Response | String | The response of the DNS. |
| TaniumEvent.ImagePath | String | The image path. |
| TaniumEvent.CreationTime | Date | The process creation time |
| TaniumEvent.EndTime | Date | The process end time. |
| TaniumEvent.EventTaskName | String | The name of the event task. |
| TaniumEvent.Property.Name | String | The name of the event’s property |
| TaniumEvent.Property.Value | String | The value of the event’s property |
Command Example
!tanium-tr-list-events-by-connection connection-name=HOST_NAME event-type=Process limit=2
Context Example
{
"Tanium": {
"Event": [
{
"Domain": "root",
"Type": "Process",
"CreationTime": "2020-03-02 16:05:37.574",
"EndTime": "2020-03-03 11:28:28.413",
"ExitCode": 0,
"ProcessCommandLine": "sleep 0.1",
"ProcessID": 13136,
"ProcessName": "/usr/bin/sleep",
"ProcessTableID": 17191168,
"SID": 5,
"Username": "root"
},
{
"Domain": "root",
"Type": "Process",
"CreationTime": "2020-03-02 23:09:33.153",
"EndTime": "2020-03-03 08:48:05.624",
"ExitCode": 0,
"ProcessCommandLine": "sleep 0.1",
"ProcessHash": "BEA3A5351BBE28622A560FF5F18C805E",
"ProcessID": 4229,
"ProcessName": "/usr/bin/sleep",
"ProcessTableID": 17232881,
"SID": 5,
"Username": "root"
}
]
}
}
Human Readable Output
Events for HOST_NAME
| Domain | Type | Process Table ID | Process Command Line | Process ID | Process Name | Exit Code | SID | Username | Creation Time | End Time |
|---|---|---|---|---|---|---|---|---|---|---|
| root | Process | 17191168 | sleep 0.1 | 13136 | /usr/bin/sleep | 0 | 5 | root | 2020-03-02 16:05:37.574 | 2020-03-03 11:28:28.413 |
| root | Process | 17232881 | sleep 0.1 | 4229 | /usr/bin/sleep | 0 | 5 | root | 2020-03-02 23:09:33.153 | 2020-03-03 08:48:05.624 |
tanium-tr-get-file-download-info
Gets the metadata of a file download. You must supply either the path or id agument for the command to run successfully.
Base Command
tanium-tr-get-file-download-info
Input
| Argument Name | Description | Required |
|---|---|---|
| host | The hostname of the downloaded file. | Required |
| path | The path of the file. | Optional |
| id | File download ID. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.FileDownload.Size | Number | The size of the file, in bytes. |
| Tanium.FileDownload.Path | String | The path of the file. |
| Tanium.FileDownload.Downloaded | Date | The date when this file was downloaded. |
| Tanium.FileDownload.Host | String | The hostname of the downloaded file. |
| Tanium.FileDownload.Created | Date | The date when the file was created. |
| Tanium.FileDownload.Hash | String | The file hash. |
| Tanium.FileDownload.SPath | String | The file SPath. |
| Tanium.FileDownload.ID | Number | The downloaded file ID. |
| Tanium.FileDownload.LastModified | Date | The date when the file was last modified. |
| Tanium.FileDownload.CreatedBy | String | The user that created this file. |
| Tanium.FileDownload.CreatedByProc | String | The process path that created this file. |
| Tanium.FileDownload.LastModifiedBy | String | The user that last modified this file. |
| Tanium.FileDownload.LastModifiedByProc | String | The process path that modified this file. |
| Tanium.FileDownload.Comments | String | The downloaded file comments. |
| Tanium.FileDownload.Tags | String | The downloaded file tags. |
| Tanium.FileDownload.Deleted | Boolean | Whether the file download has been deleted. |
Command Example
!tanium-tr-get-file-download-info host=HOST_NAME id=4
Context Example
{
"Tanium": {
"FileDownload": {
"Created": "2020-01-02 15:39:57.289",
"CreatedBy": "NT AUTHORITY\\LOCAL SERVICE",
"CreatedByProc": "C:\\Windows\\System32\\svchost.exe",
"Downloaded": "2020-01-02 15:40:29.003",
"Hash": "2ae2da9237309b13b9a9d52d1358c826",
"Host": "HOST_NAME",
"ID": 4,
"LastModified": "2020-01-02 15:39:57.289",
"LastModifiedBy": "NT AUTHORITY\\LOCAL SERVICE",
"LastModifiedByProc": "C:\\Windows\\System32\\svchost.exe",
"Path": "C:\\Windows\\ServiceProfiles\\LocalService\\AppData\\Local\\lastalive1.dat",
"SPath": "6ae86937-611f-45e9-900c-3ba57298f264.zip",
"Size": 2048,
"Deleted": false
}
}
}
Human Readable Output
File download metadata for file C:\Windows\ServiceProfiles\LocalService\AppData\Local\lastalive1.dat
| ID | Host | Path | Hash | Downloaded | Size | Created | Created By | Created By Proc | Last Modified | Last Modified By | Last Modified By Proc | S Path |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | HOST_NAME | C:\Windows\ServiceProfiles\LocalService\AppData\Local\lastalive1.dat | 2ae2da9237309b13b9a9d52d1358c826 | 2020-01-02 15:40:29.003 | 2048 | 2020-01-02 15:39:57.289 | NT AUTHORITY\LOCAL SERVICE | C:\Windows\System32\svchost.exe | 2020-01-02 15:39:57.289 | NT AUTHORITY\LOCAL SERVICE | C:\Windows\System32\svchost.exe | 6ae86937-611f-45e9-900c-3ba57298f264.zip |
tanium-tr-get-process-info
Get information for a process.
Base Command
tanium-tr-get-process-info
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| ptid | The process instance ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Process.CreateTime | Date | Time when the process was created. |
| Tanium.Process.Domain | String | The domain of the process. |
| Tanium.Process.ExitCode | Number | The process exit code. |
| Tanium.Process.ProcessCommandLine | String | The process command line. |
| Tanium.Process.ProcessID | Number | The ID of the process. |
| Tanium.Process.ProcessName | String | File of the process. |
| Tanium.Process.ProcessTableId | Number | The ID of the process table. |
| Tanium.Process.SID | String | The security ID of the process. |
| Tanium.Process.Username | String | The username who created the process. |
Command Example
!tanium-tr-get-process-info ptid=667680 connection-name=HOST_NAME limit=5
Context Example
{
"Tanium": {
"Process": {
"CreateTime": "2020-01-22 16:16:07.553",
"Domain": "NT AUTHORITY",
"ExitCode": 0,
"ProcessCommandLine": "System",
"ProcessID": 4,
"ProcessName": "System",
"ProcessTableId": 667680,
"SID": "S-1-5-18",
"Username": "SYSTEM"
}
}
}
Human Readable Output
Process information for process with PTID 667680
| Process ID | Process Name | Process Command Line | Process Table Id | SID | Username | Domain | Exit Code | Create Time |
|---|---|---|---|---|---|---|---|---|
| 4 | System | System | 667680 | S-1-5-18 | SYSTEM | NT AUTHORITY | 0 | 2020-01-22 16:16:07.553 |
tanium-tr-get-events-by-process
Gets the events for a process.
Base Command
tanium-tr-get-events-by-process
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| ptid | The process instance ID. | Required |
| limit | The maximum number of events to return. | Optional |
| offset | The offset number to begin listing events. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.ProcessEvent.ID | Number | The ID of the event. |
| Tanium.ProcessEvent.Detail | Unknown | The event details. |
| Tanium.ProcessEvent.Operation | String | The event operation. |
| Tanium.ProcessEvent.Timestamp | Date | Time when the event was created. |
| Tanium.ProcessEvent.Type | String | The event type. |
Command Example
!tanium-tr-get-events-by-process ptid=667680 connection-name=HOST_NAME limit=1
Context Example
{
"Tanium": {
"ProcessEvent": {
"Detail": "4: System",
"ID": 667680,
"Operation": "CreateProcess",
"Timestamp": "2020-01-22 16:16:07.553",
"Type": "Process"
}
}
}
Human Readable Output
Events for process 667680
| ID | Detail | Type | Timestamp | Operation |
|---|---|---|---|---|
| 667680 | 4: System | Process | 2020-01-22 16:16:07.553 | CreateProcess |
tanium-tr-get-process-children
Gets the children of this process instance.
Base Command
tanium-tr-get-process-children
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| ptid | The process instance ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.ProcessChildren.ID | Number | The ID of the process. |
| Tanium.ProcessChildren.Name | String | File of the process. |
| Tanium.ProcessChildren.PID | Number | The PID of the process. |
| Tanium.ProcessChildren.PTID | Number | The process instance ID. |
| Tanium.ProcessChildren.Parent | String | The parent process name. |
Command Example
!tanium-tr-get-process-children ptid=667680 connection-name=HOST_NAME
Context Example
{
"Tanium": {
"ProcessChildren": [
{
"ID": 667681,
"Name": "0: Unknown Process",
"PID": 0,
"PTID": 667681,
"Parent": "4: System"
},
{
"ID": 667682,
"Name": "1: Pruned Process",
"PID": 1,
"PTID": 667682,
"Parent": "4: System"
},
{
"ID": 667683,
"Name": "392: smss.exe",
"PID": 392,
"PTID": 667683,
"Parent": "4: System"
}
]
}
}
Human Readable Output
Children for process with PTID 667680
| ID | Name | PID | PTID | Parent | Children Count |
|---|---|---|---|---|---|
| 667681 | 0: Unknown Process | 0 | 667681 | 4: System | 0 |
| 667682 | 1: Pruned Process | 1 | 667682 | 4: System | 0 |
| 667683 | 392: smss.exe | 392 | 667683 | 4: System | 0 |
tanium-tr-get-parent-process
Gets information for the parent process.
Base Command
tanium-tr-get-parent-process
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| ptid | The process instance ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Process.CreateTime | Date | Time when the process was created. |
| Tanium.Process.Domain | String | The domain of the process. |
| Tanium.Process.ExitCode | Number | The process exit code. |
| Tanium.Process.ProcessCommandLine | String | The process command line. |
| Tanium.Process.ProcessID | Number | The ID of the process. |
| Tanium.Process.ProcessName | String | File of the process. |
| Tanium.Process.ProcessTableId | Number | The ID of the process table. |
| Tanium.Process.SID | String | The security ID of the process. |
| Tanium.Process.Username | String | The username who created the process. |
Command Example
!tanium-tr-get-parent-process ptid=667681 connection-name=HOST_NAME
Context Example
{
"Tanium": {
"ParentProcess": {
"CreateTime": "2020-01-22 16:16:07.553",
"Domain": "NT AUTHORITY",
"ExitCode": 0,
"ProcessCommandLine": "System",
"ProcessID": 4,
"ProcessName": "System",
"ProcessTableId": 667680,
"SID": "S-1-5-18",
"Username": "SYSTEM"
}
}
}
Human Readable Output
Process information for process with PTID 667681
| Process ID | Process Name | Process Command Line | Process Table Id | SID | Username | Domain | Exit Code | Create Time |
|---|---|---|---|---|---|---|---|---|
| 4 | System | System | 667680 | S-1-5-18 | SYSTEM | NT AUTHORITY | 0 | 2020-01-22 16:16:07.553 |
tanium-tr-get-parent-process-tree
Gets the parent process tree for the process instance.
Base Command
tanium-tr-get-parent-process-tree
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| ptid | The process instance ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.ParentProcessTree.ID | Number | The parent process ID. |
| Tanium.ParentProcessTree.Name | String | File of the parent process. |
| Tanium.ParentProcessTree.PID | Number | The parent process PID. |
| Tanium.ParentProcessTree.PTID | Number | The parent process instance ID. |
| Tanium.ParentProcessTree.Parent | String | The parent process name. |
| Tanium.ParentProcessTree.Children | Unknown | The parent process children. |
Command Example
!tanium-tr-get-parent-process-tree ptid=667681 connection-name=HOST_NAME
Context Example
{
"Tanium": {
"ParentProcessTree": {
"Children": [
{
"Children": [],
"ID": 667681,
"Name": "0: Unknown Process",
"PID": 0,
"PTID": 667681,
"Parent": "4: System"
},
{
"Children": [],
"ID": 667682,
"Name": "1: Pruned Process",
"PID": 1,
"PTID": 667682,
"Parent": "4: System"
},
{
"Children": [],
"ID": 667683,
"Name": "392: smss.exe",
"PID": 392,
"PTID": 667683,
"Parent": "4: System"
}
],
"ID": 667680,
"Name": "4: System",
"PID": 4,
"PTID": 667680
}
}
}
Human Readable Output
Parent process for process with PTID 667681
| ID | Name | PID | PTID |
|---|---|---|---|
| 667680 | 4: System | 4 | 667680 |
Processes with the same parent
| ID | Name | PID | PTID | Parent | Children Count |
|---|---|---|---|---|---|
| 667681 | 0: Unknown Process | 0 | 667681 | 4: System | 0 |
| 667682 | 1: Pruned Process | 1 | 667682 | 4: System | 0 |
| 667683 | 392: smss.exe | 392 | 667683 | 4: System | 0 |
tanium-tr-get-process-tree
Gets the process tree for the process instance.
Base Command
tanium-tr-get-process-tree
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The connection name. | Required |
| ptid | The process instance ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.ProcessTree.ID | Number | The process ID. |
| Tanium.ProcessTree.Name | String | File of the process. |
| Tanium.ProcessTree.PID | Number | The process PID. |
| Tanium.ProcessTree.PTID | Number | The process instance ID. |
| Tanium.ProcessTree.Parent | String | The parent process name. |
| Tanium.ProcessTree.Children | Unknown | The process children. |
Command Example
!tanium-tr-get-process-tree ptid=667680 connection-name=HOST_NAME
Context Example
{
"Tanium": {
"ProcessTree": {
"Children": [
{
"Children": [],
"ID": 667681,
"Name": "0: Unknown Process",
"PID": 0,
"PTID": 667681,
"Parent": "4: System"
},
{
"Children": [],
"ID": 667682,
"Name": "1: Pruned Process",
"PID": 1,
"PTID": 667682,
"Parent": "4: System"
},
{
"Children": [],
"ID": 667683,
"Name": "392: smss.exe",
"PID": 392,
"PTID": 667683,
"Parent": "4: System"
}
],
"ID": 667680,
"Name": "4: System",
"PID": 4,
"PTID": 667680
}
}
}
Human Readable Output
Process information for process with PTID 667680
| ID | Name | PID | PTID |
|---|---|---|---|
| 667680 | 4: System | 4 | 667680 |
Children for process with PTID 667680
| ID | Name | PID | PTID | Parent | Children Count |
|---|---|---|---|---|---|
| 667681 | 0: Unknown Process | 0 | 667681 | 4: System | 0 |
| 667682 | 1: Pruned Process | 1 | 667682 | 4: System | 0 |
| 667683 | 392: smss.exe | 392 | 667683 | 4: System | 0 |
tanium-tr-list-evidence
Returns a list of all available evidence in the system.
Base Command
tanium-tr-list-evidence
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of evidences to return. The default value is 50. | Optional |
| offset | Offset to start getting the events result set. The default is 0. | Optional |
| sort | A comma-separated list of fields by which to sort, using +/- prefixes for ascending/descending, in order of priority (left to right). | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Evidence.ID | Number | The evidence ID. |
| Tanium.Evidence.CreatedAt | Date | Time when the process was created. |
| Tanium.Evidence.LastModified | Date | The date that the file was last modified. |
| Tanium.Evidence.User | String | The user of the evidence. |
| Tanium.Evidence.ConnectionName | String | The evidence connection name. |
| Tanium.Evidence.Type | Number | The evidence type. |
| Tanium.Evidence.ProcessTableId | Number | The evidence process table ID. |
| Tanium.Evidence.Timestamp | Date | The evidence timestamp. |
| Tanium.Evidence.Summary | String | The evidence summary. |
| Tanium.Evidence.Comments | String | The evidence comments. |
| Tanium.Evidence.Tags | String | The evidence tags. |
| Tanium.Evidence.Deleted | Boolean | Whether the evident has been deleted. |
Command Example
!tanium-tr-list-evidence limit=2 offset=1 sort=+id
Context Example
{
"Tanium": {
"Evidence": [
{
"ConnectionName": "HOST_NAME",
"CreatedAt": "2020-01-02 15:40:03",
"ID": 2,
"ProcessTableId": 45632561,
"Summary": "CreateProcess: C:\\Windows\\SysWOW64\\cmd.exe",
"Timestamp": "2020-01-02 15:39:28.809",
"Type": 2,
"UpdatedAt": "2020-01-02 15:40:03",
"User": "actionapprover",
"Deleted": false
},
{
"ConnectionName": "HOST_NAME",
"CreatedAt": "2020-01-13 18:02:01",
"ID": 13,
"ProcessTableId": 4563722,
"Summary": "CreateProcess: C:\\Windows\\System32\\wsqmcons.exe",
"Timestamp": "2020-01-13 18:00:01.010",
"Type": 2,
"UpdatedAt": "2020-01-13 18:02:01",
"User": "HOST_NAME\\administrator",
"Deleted": false
}
]
}
}
Human Readable Output
Evidence List
| ID | Timestamp | Conntection Name | User | Summary | Type | Created At | Updated At | Process Table Id |
|---|---|---|---|---|---|---|---|---|
| 2 | 2020-01-02 15:39:28.809 | HOST_NAME | actionapprover | CreateProcess: C:\Windows\SysWOW64\cmd.exe | 2 | 2020-01-02 15:40:03 | 2020-01-02 15:40:03 | 45632561 |
| 13 | 2020-01-13 18:00:01.010 | HOST_NAME | HOST_NAME\administrator | CreateProcess: C:\Windows\System32\wsqmcons.exe | 2 | 2020-01-13 18:02:01 | 2020-01-13 18:02:01 | 4563722 |
tanium-tr-get-evidence-by-id
Gets evidence by evidence ID.
Base Command
tanium-tr-get-evidence-by-id
Input
| Argument Name | Description | Required |
|---|---|---|
| evidence-id | The ID of the evidence. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Evidence.ID | Number | The evidence ID. |
| Tanium.Evidence.CreatedAt | Date | Time when the process was created. |
| Tanium.Evidence.LastModified | Date | The date that the file was last modified. |
| Tanium.Evidence.User | String | The user of the evidence. |
| Tanium.Evidence.ConnectionName | String | The evidence connection name. |
| Tanium.Evidence.Type | Number | The evidence type. |
| Tanium.Evidence.ProcessTableId | Number | The evidence process table ID. |
| Tanium.Evidence.Timestamp | Date | The evidence timestamp. |
| Tanium.Evidence.Summary | String | The evidence summary. |
| Tanium.Evidence.Comments | String | The evidence comments. |
| Tanium.Evidence.Tags | String | The evidence tags. |
| Tanium.Evidence.Deleted | Boolean | Whether the evident has been deleted. |
Command Example
!tanium-tr-get-evidence-by-id evidence-id=2
Context Example
{
"Tanium": {
"Evidence": {
"CreatedAt": "2020-01-02 15:40:03",
"ConnectionName": "HOST_NAME",
"ProcessTableId": 45632561,
"ID": 2,
"Summary": "CreateProcess: C:\\Windows\\SysWOW64\\cmd.exe",
"Timestamp": "2020-01-02 15:39:28.809",
"Type": 2,
"UpdatedAt": "2020-01-02 15:40:03",
"User": "actionapprover",
"Deleted": false
}
}
}
Human Readable Output
Label information
| ID | Timestamp | Connection Name | User | Summary | Type | Created At | Updated At | Process Table Id |
|---|---|---|---|---|---|---|---|---|
| 2 | 2020-01-02 15:39:28.809 | HOST_NAME | actionapprover | CreateProcess: C:\Windows\SysWOW64\cmd.exe | 2 | 2020-01-02 15:40:03 | 2020-01-02 15:40:03 | 45632561 |
tanium-tr-create-evidence
Creates an evidence.
Base Command
tanium-tr-create-evidence
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The name of the connection. | Required |
| ptid | The process instance ID. | Required |
Context Output
There is no context output for this command.
Command Example
!tanium-tr-create-evidence connection-name=HOST_NAME connection-name=HOST_NAME ptid=13538572
Human Readable Output
Evidence have been created.
tanium-tr-delete-evidence
Deletes an evidence.
Base Command
tanium-tr-delete-evidence
Input
| Argument Name | Description | Required |
|---|---|---|
| evidence-id | The ID of the evidence. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.Evidence.ID | String | The evidence ID. |
| Tanium.Evidence.Deleted | Boolean | Whether the evidence has been deleted. |
Command Example
!tanium-tr-delete-evidence evidence-id=1
Context Example
{
"Tanium": {
"Evidence": {
"ID": 2,
"Deleted": true
}
}
}
Human Readable Output
Evidence 1 has been deleted successfully.
tanium-tr-request-file-download
Requests a new file download.
Base Command
tanium-tr-request-file-download
Input
| Argument Name | Description | Required |
|---|---|---|
| path | Path to file. | Required |
| connection-name | Connection name. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.FileDownload.Path | String | The file download path. |
| Tanium.FileDownload.ConnectionName | String | The file download connection name. |
| Tanium.FileDownload.Downloaded | Date | Date of the download request. |
| Tanium.FileDownload.Status | String | Status of the file download request. |
| Tanium.FileDownload.ID | Number | ID of the file download. |
Command Example
!tanium-tr-request-file-download connection-name=HOST_NAME path=dev/autofs
Context Example
{
"Tanium": {
"FileDownload": {
"Downloaded": "2020-02-06 16:05:40.227674",
"ConnectionName": "HOST_NAME",
"Path": "dev/autofs"
}
}
}
Human Readable Output
Download request of file autofs has been sent successfully.
tanium-tr-delete-file-download
Deletes a file download.
Base Command
tanium-tr-delete-file-download
Input
| Argument Name | Description | Required |
|---|---|---|
| file-id | File download ID. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.FileDownload.ID | String | The file download ID. |
| Tanium.FileDownload.Deleted | Boolean | Whether the file download has been deleted. |
Command Example
!tanium-tr-delete-file-download file-id=3
Context Example
{
"Tanium": {
"FileDownload": {
"ID": 3,
"Deleted": true
}
}
}
Human Readable Output
Delete request of file with ID 3 has been sent successfully.
tanium-tr-list-files-in-directory
Gets a list of files in the given directory.
Base Command
tanium-tr-list-files-in-directory
Input
| Argument Name | Description | Required |
|---|---|---|
| path | Path to the directory. | Required |
| connection-name | Connection name. | Required |
| limit | The maximum number of files to return. The default value is 50. | Optional |
| offset | Offset to start getting files. The default is 0. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.File.Created | Date | Time the file was created. |
| Tanium.File.Size | Number | The file size. |
| Tanium.File.IsDirectory | Boolean | Whether or not the file is a directory. |
| Tanium.File.LastModified | Date | The date that the file was last modified. |
| Tanium.File.Path | Boolean | The file path. |
| Tanium.File.Permissions | Date | The file permissions. |
| Tanium.File.ConnectionName | String | The host of the file. |
| Tanium.File.Deleted | Boolean | Whether the file has been deleted. |
Command Example
!tanium-tr-list-files-in-directory path=`C:\Program Files (x86)\Tanium\Tanium Client\` connection-name=HOST_NAME limit=2
Context Example
{
"Tanium": {
"File": [
{
"Created": "1970-01-19 03:25:44",
"IsDirectory": false,
"LastModified": "1970-01-19 03:25:44",
"Path": ".detect-engine.lock",
"Permissions": "rw-rw-rw-",
"Size": 0,
"Deleted": false
},
{
"Created": "1970-01-18 21:02:12",
"IsDirectory": true,
"LastModified": "1970-01-19 07:10:05",
"Path": "Downloads",
"Permissions": "rw-rw-rw-",
"Size": 393216,
"Deleted": false
}
]
}
}
Human Readable Output
Files in directory C:\Program Files (x86)\Tanium\Tanium Client\
| Path | Size | Created | Last Modified | Permissions | Is Directory |
|---|---|---|---|---|---|
| .detect-engine.lock | 0 | 1970-01-19 03:25:44 | 1970-01-19 03:25:44 | rw-rw-rw- | false |
| Downloads | 393216 | 1970-01-18 21:02:12 | 1970-01-19 07:10:05 | rw-rw-rw- | true |
tanium-tr-get-file-info
Gets information about a file from a remote connection.
Base Command
tanium-tr-get-file-info
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | The name of the connection. | Required |
| path | The path to the file. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.File.Created | Date | The file creation timestamp. |
| Tanium.File.Size | Number | The file size. |
| Tanium.File.IsDirectory | Boolean | Whether or not the file is a directory. |
| Tanium.File.LastModified | Date | The date that the file was last modified. |
| Tanium.File.Path | String | The file path. |
| Tanium.File.ConnectionName | String | The host of the file. |
| Tanium.File.Deleted | Boolean | Whether the file has been deleted. |
Command Example
!tanium-tr-get-file-info connection-name=HOST_NAME path=`C:\Program Files (x86)\Tanium\Tanium Client\TaniumClient.exe`
Context Example
{
"Tanium": {
"File": {
"Created": "1970-01-18 20:01:58",
"IsDirectory": false,
"LastModified": "1970-01-18 20:01:58",
"Size": 4938736
"Path": "C:\Program Files (x86)\Tanium\Tanium Client\TaniumClient.exe",
"ConnectionName": "HOST_NAME",
"Deleted": false
}
}
}
Human Readable Output
Information for file C:\Program Files (x86)\Tanium\Tanium Client\TaniumClient.exe
| Path | Size | Created | Last Modified | Is Directory | Connection Name |
|---|---|---|---|---|---|
| C:\Program Files (x86)\Tanium\Tanium Client\TaniumClient.exe | 4938736 | 1970-01-18 20:01:58 | 1970-01-18 20:01:58 | false | HOST_NAME |
tanium-tr-delete-file-from-endpoint
Deletes a file from the given endpoint.
Base Command
tanium-tr-delete-file-from-endpoint
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | Connection name. | Required |
| path | Path to file. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.File.Path | String | The file path. |
| Tanium.File.ConnectionName | String | The host of the file. |
| Tanium.File.Deleted | Boolean | Whether the file has been deleted. |
Command Example
!tanium-tr-delete-file-from-endpoint path=`C:\Program Files (x86)\Tanium\Tanium Client\Logs\log0.txt` connection-name=HOST_NAME
Context Example
{
"Tanium": {
"File": {
"Path": "C:\Program Files (x86)\Tanium\Tanium Client\Logs\log0.txt",
"ConnectionName": "HOST_NAME",
"Deleted": true
}
}
}
Human Readable Output
Delete request of file C:\Program Files (x86)\Tanium\Tanium Client\Logs\log0.txt from endpoint HOST_NAME has been sent successfully.
tanium-tr-get-process-timeline
Gets the process timeline.
Base Command
tanium-tr-get-process-timeline
Input
| Argument Name | Description | Required |
|---|---|---|
| connection-name | Connection name. | Required |
| ptid | Process table ID. | Required |
| category | The event categories to retrieve. Can be “File”, “DNS”, “Registry”, “Network”, “Image”, or “Process”. | Required |
| limit | The maximum number of events to return. The default value is 50. | Optional |
| offset | Offset to start getting the events. The default is 0. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.ProcessTimeline.ProcessTableID | Number | The process instance ID. |
| Tanium.ProcessTimeline.ConnectionName | String | The connection name of the process. |
| Tanium.ProcessTimeline.Date | Date | Events date of the process. |
| Tanium.ProcessTimeline.Event | String | Event of the process. |
| Tanium.ProcessTimeline.Category | String | The event category of the process. |
Command Example
!tanium-tr-get-process-timeline ptid=13530396 connection-name=HOST_NAME category=Process limit=2
Context Example
{
"Tanium": {
"ProcessTimeline": [
{
"Category": "Process",
"Date": "2020-02-05 10:16:02.319000",
"Event": [
"Process started by root\\root"
]
},
{
"Category": "Process",
"Date": "2020-02-05 10:17:00.000000",
"Event": [
"Process ended"
]
}
]
}
}
Human Readable Output
Timeline data for process with PTID 13530396
| Date | Event | Category |
|---|---|---|
| 2020-02-05 10:16:02.319000 | Process started by root\root | Process |
| 2020-02-05 10:17:00.000000 | Process ended | Process |
tanium-tr-get-download-file-request-status
Gets the status of the download file request.
Base Command
tanium-tr-get-download-file-request-status
Input
| Argument Name | Description | Required |
|---|---|---|
| request-date | Date of the download file request, or example: 2019-09-23T12:55:08.622 | Required |
| connection-name | The connection to which the request was made. | Optional |
| path | The file path. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.DownloadFile.ID | Number | ID of the file download. |
| Tanium.DownloadFile.ConnectionName | String | Host of the file. |
| Tanium.DownloadFile.Path | String | Path of the file. |
| Tanium.DownloadFile.Status | String | Status of the file download request. |
| Tanium.DownloadFile.Downloaded | Date | The date of the download request. |
Command Example
!tanium-tr-get-download-file-request-status request-date=2019-09-23T12:55:08.622
Context Example
{
"Tanium": {
"FileDownload": {
"Downloaded": "2020-01-02 15:40:18.052",
"ID": 3,
"Status": "Completed",
"Path": "C:\Program Files (x86)\Tanium\Tanium Client\Logs\log1.txt",
"ConnectionName": "HOST_NAME"
}
}
}
Human Readable Output
File download request status
| ID | Connection Name | Status | Path | Downloaded |
|---|---|---|---|---|
| 3 | HOST_NAME | Completed | C:\Program Files (x86)\Tanium\Tanium Client\Logs\log1.txt | 2020-01-02 15:40:18.052 |
tanium-tr-intel-doc-create
Add a new intel document to the system by providing its document contents.
Base Command
tanium-tr-intel-doc-create
Input
| Argument Name | Description | Required |
|---|---|---|
| entry-id | The file entry ID. | Required |
| file_extension | The suffix at the end of a filename. (Available file types - yara, stix, ioc) | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.IntelDoc.AlertCount | Number | The number of alerts that currently exist for this intel. |
| Tanium.IntelDoc.CreatedAt | Date | The date at which this intel was first added to the system. |
| Tanium.IntelDoc.Description | String | The description of the intel, as declared in the document or as updated by a user. |
| Tanium.IntelDoc.ID | Number | The unique identifier for this intel in this instance of the system. |
| Tanium.IntelDoc.LabelIds | Number | The IDs of all labels applied to this intel. |
| Tanium.IntelDoc.Name | String | The name of the intel, as declared in the document or as updated by a user. |
| Tanium.IntelDoc.Type | String | The shortened type name of the intel. For example, “openioc”, “stix”, “yara”. |
| Tanium.IntelDoc.UnresolvedAlertCount | Number | The number of unresolved alerts that currently exist for this intel. |
| Tanium.IntelDoc.UpdatedAt | Date | The date when this intel was last updated. |
Command Example
!tanium-tr-intel-doc-create entry-id=7173@e99f97d1-7225-4c75-896c-3c960febbe8c file_extension=ioc
Context Example
{
"Tanium": {
"IntelDoc": {
"AlertCount": 0,
"CreatedAt": "2019-07-31T18:46:28.814Z",
"Description": "Detects usage of the NET.EXE utility to enumerate members of the local Administrators or Domain Administrators groups. Often used during post-compromise reconnaissance.",
"ID": 2,
"LabelIds": [
2,
3,
9,
16
],
"Name": "Administrator Account Enumeration",
"Type": "openioc",
"UnresolvedAlertCount": 0,
"UpdatedAt": "2020-01-14T21:37:30.934Z"
}
}
}
Human Readable Output
Intel Doc uploaded
| ID | Name | Description | Type | Alert Count | Unresolved Alert Count | Created At | Updated At | Label Ids |
|---|---|---|---|---|---|---|---|---|
| 2 | Administrator Account Enumeration | Detects usage of the NET.EXE utility to enumerate members of the local Administrators or Domain Administrators groups. Often used during post-compromise reconnaissance. | openioc | 0 | 0 | 2019-07-31T18:46:28.814Z | 2020-01-14T21:37:30.934Z | 2, 3, 9, 16 |
tanium-tr-start-quick-scan
Scan a computer group for hashes in intel document. Computer groups can be viewed by navigating to Administration -> Computer Groups in the UI. Computer group names and IDs can also be retrieved by using the tn-list-groups command in the Tanium integration.
Base Command
tanium-tr-start-quick-scan
Input
| Argument Name | Description | Required |
|---|---|---|
| intel-doc-id | The intel document ID. | Required |
| computer-group-name | The name of a Tanium computer group. See command description for possible ways to retrieve this value. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Tanium.QuickScan.AlertCount | Number | The number of alerts returned from the quick scan. |
| Tanium.QuickScan.ComputerGroupId | Number | The ID of a Tanium computer group. |
| Tanium.QuickScan.CreatedAt | Date | The date the quick scan was created. |
| Tanium.QuickScan.ID | Number | The ID of the quick scan. |
| Tanium.QuickScan.IntelDocId | Number | The unique identifier for this intel in the instance of the system. |
| Tanium.QuickScan.QuestionID | Number | The ID of the quick scan question. |
| Tanium.QuickScan.UserID | Number | The user ID which initiated the quick scan. |
Command Example
!tanium-tr-start-quick-scan intel-doc-id=2 computer-group-name="All Computers"
Context Example
{
"Tanium": {
"QuickScan": {
"AlertCount": 0,
"ComputerGroupId": 1
"CreatedAt": "2019-07-31T18:46:28.814Z",
"ID": 5,
"IntelDocId": 2
"QuestionID": 4,
"UserID": 3
}
}
}
Human Readable Output
Quick Scan started
| Alert Count | ComputerGroupId | CreatedAt | ID | IntelDocId | QuestionID | UserID | |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 2019-07-31T18:46:28.814Z | 5 | 2 | 4 | 3 |
Configuration parameters
isFetch— Fetch incidentsincidentType— Incident typeincidentFetchInterval— Incidents Fetch Intervalurl— Hostname, IP address, or server URL (required)credentials— Username (required)insecure— Trust any certificate (not secure)proxy— Use system proxy settingsfetch_time— First fetch timestamp (<number> <time unit>, e.g., 12 hours, 7 days)filter_alerts_by_state— A comma-separated list of alert states to filter by in fetch incidents command. Possible options are: unresolved, in progress, resolved or suppressed. Empty list won't filter the incidents by state.
Commands (39)
-
tanium-tr-alert-update-stateUpdates the state of a single alert.
-
tanium-tr-create-connectionCreates a local or remote connection.
-
tanium-tr-create-evidenceCreates an evidence.
-
tanium-tr-create-snapshotCaptures a new snapshot by connection name.
-
tanium-tr-delete-connectionDeletes a connection by connection name.
-
tanium-tr-delete-evidenceDeletes an evidence.
-
tanium-tr-delete-file-downloadDeletes a file download.
-
tanium-tr-delete-file-from-endpointDeletes a file from the given endpoint.
-
tanium-tr-delete-local-snapshotDeletes a local snapshot by connection name and file name.
-
tanium-tr-delete-snapshotDeletes a snapshot by connection name and snapshot ID.
-
tanium-tr-get-alert-by-idReturns an alert object based on alert ID.
-
tanium-tr-get-connection-by-nameReturns a connection object based on connection name.
-
tanium-tr-get-download-file-request-statusGets the status of the download file request.
-
tanium-tr-get-downloaded-fileGets the actual content of a downloaded file by file ID.
-
tanium-tr-get-events-by-processGets the events for a process.
-
tanium-tr-get-evidence-by-idGets evidence by evidence ID.
-
tanium-tr-get-file-download-infoGets the metadata of a file download. You must supply either the `path` or `id` argument for the command to run successfully.
-
tanium-tr-get-file-infoGets information about a file from a remote connection.
-
tanium-tr-get-intel-doc-by-idReturns an intel document object based on ID.
-
tanium-tr-get-label-by-idReturns a label object based on label ID.
-
tanium-tr-get-parent-processGets information for the parent process.
-
tanium-tr-get-parent-process-treeGets the parent process tree for the process instance.
-
tanium-tr-get-process-childrenGets the children of this process instance.
-
tanium-tr-get-process-infoGet information for a process.
-
tanium-tr-get-process-timelineGets the process timeline.
-
tanium-tr-get-process-treeGets the process tree for the process instance.
-
tanium-tr-intel-doc-createAdd a new intel document to the system by providing its document contents.
-
tanium-tr-list-alertsReturns a list of all alerts.
-
tanium-tr-list-connectionsReturns all connections.
-
tanium-tr-list-events-by-connectionQueries events for a connection.
-
tanium-tr-list-evidenceReturns a list of all available evidence in the system.
-
tanium-tr-list-file-downloadsReturns all downloaded files in the system.
-
tanium-tr-list-files-in-directoryGets a list of files in the given directory.
-
tanium-tr-list-intel-docsReturns a list of all intel documents.
-
tanium-tr-list-labelsReturns all available labels in the system.
-
tanium-tr-list-local-snapshots-by-connectionReturns all local snapshots of a single connection.
-
tanium-tr-list-snapshots-by-connectionReturns all snapshots of a single connection.
-
tanium-tr-request-file-downloadRequests a new file download.
-
tanium-tr-start-quick-scanScan a computer group for hashes in intel document. Computer groups can be viewed by navigating to `Administration -> Computer Groups` in the Threat-Response product console. Computer group names and IDs can also be retrieved by using the `tn-list-groups` command in the `Tanium` integration.
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 """ IMPORTS """ import ast import json import os import urllib.parse from typing import Any import urllib3 from dateutil.parser import parse urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) """ GLOBALS/PARAMS """ FETCH_TIME = demisto.params().get("fetch_time") DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" PROCESS_TEXT = "Process information for process with PTID" PARENT_PROCESS_TEXT = "Parent process for process with PTID" PROCESS_CHILDREN_TEXT = "Children for process with PTID" # The commands below won't work unless the connection passed in `connection_name` argument is active. COMMANDS_DEPEND_ON_CONNECTIVITY = [ "tanium-tr-list-snapshots-by-connection", "tanium-tr-create-snapshot", "tanium-tr-list-events-by-connection", "tanium-tr-get-process-info", "tanium-tr-get-events-by-process", "tanium-tr-get-process-children", "tanium-tr-get-parent-process", "tanium-tr-get-parent-process-tree", "tanium-tr-get-process-tree", "tanium-tr-create-evidence", "tanium-tr-request-file-download", "tanium-tr-list-files-in-directory", "tanium-tr-get-file-info", "tanium-tr-delete-file-from-endpoint", "tanium-tr-get-process-timeline", ] DEPENDENT_COMMANDS_ERROR_MSG = "\nPlease verify that the connection you have specified is active." class Client(BaseClient): def __init__(self, base_url, username, password, **kwargs): self.username = username self.password = password self.session = "" super().__init__(base_url, **kwargs) def do_request(self, method, url_suffix, json_data=None, params=None, data=None, resp_type="json", headers=None): if not self.session: self.update_session() if headers: headers["session"] = self.session else: headers = {"session": self.session} res = self._http_request( method, url_suffix, headers=headers, json_data=json_data, params=params, data=data, resp_type="response", ok_codes=(200, 201, 202, 204, 400, 403, 404), ) # if session expired if res.status_code == 403: self.update_session() res = self._http_request( method, url_suffix, headers=headers, json_data=json_data, params=params, data=data, ok_codes=(200, 400, 404) ) return res if res.status_code == 404 or res.status_code == 400: if res.content: raise requests.HTTPError(str(res.content)) if res.reason: raise requests.HTTPError(str(res.reason)) raise requests.HTTPError(res.json().get("text")) if resp_type == "json": try: return res.json() except json.JSONDecodeError: return res.content if resp_type == "text": return res.text, res.headers.get("Content-Disposition") if resp_type == "content": return res.content, res.headers.get("Content-Disposition") return res def update_session(self): body = {"username": self.username, "password": self.password} res = self._http_request("POST", "/api/v2/session/login", json_data=body, ok_codes=(200,)) self.session = res.get("data").get("session") return self.session def login(self): return self.update_session() """ COMMANDS + REQUESTS FUNCTIONS """ def get_process_timeline_item(raw_item, category_name, limit, offset): timeline_item = [] for category in raw_item: if category["name"].lower() == category_name.lower(): sorted_timeline_dates = sorted(category["details"].keys()) from_idx = min(offset, len(sorted_timeline_dates)) to_idx = min(offset + limit, len(sorted_timeline_dates)) for i in range(from_idx, to_idx): current_date = sorted_timeline_dates[i] events_in_current_date = category["details"][current_date] timeline_item.append( { "Date": timestamp_to_datestring(sorted_timeline_dates[i], date_format="%Y-%m-%d %H:%M:%S.%f"), "Category": category_name, "Event": events_in_current_date, } ) return timeline_item def try_parse_integer(int_to_parse: Any) -> int: """ Tries to parse an integer. """ try: res = int(int_to_parse) except (TypeError, ValueError): res = 10000 return res def path_join(base, file_name): if "\\" in base: if not base.endswith("\\"): return base + "\\" + file_name return base + file_name elif "/" in base: if not base.endswith("/"): return base + "/" + file_name return base + file_name return file_name def evidence_type_number_to_name(num: int) -> str: """ Transforms evidence type number to it's corresponding name :param num: The evidence type number :return: The string name of the evidence type """ name: str = "" supported_types = ["Network", "Process", "File", "Registry", "Security", "Image", "DNS"] try: name = supported_types[num - 1] except IndexError: name = "Unknown" finally: return name def get_evidence_item(raw_item): evidence_item = { "ID": raw_item.get("id"), "CreatedAt": raw_item.get("created"), "UpdatedAt": raw_item.get("lastModified"), "User": raw_item.get("user"), "ConnectionName": raw_item.get("host"), "Type": evidence_type_number_to_name(try_parse_integer(raw_item.get("type"))), "ProcessTableId": raw_item.get("sId"), "Timestamp": raw_item.get("sTimestamp"), "Summary": raw_item.get("summary"), "Comments": raw_item.get("comments"), "Tags": raw_item.get("tags"), "Deleted": False, } return {key: val for key, val in evidence_item.items() if val is not None} def get_process_tree_item(raw_item, level): tree_item = { "ID": raw_item.get("id"), "PTID": raw_item.get("ptid"), "PID": raw_item.get("pid"), "Name": raw_item.get("name"), "Parent": raw_item.get("parent"), "Children": raw_item.get("children"), } human_readable = tree_item.copy() del human_readable["Children"] children = tree_item.get("Children") if children and level == 1: human_readable["ChildrenCount"] = len(children) if not children and level == 1: human_readable["ChildrenCount"] = 0 elif children and level == 0: human_readable_arr = [] output_arr = [] for item in children: tree_output, human_readable_res = get_process_tree_item(item, level + 1) human_readable_arr.append(human_readable_res) output_arr.append(tree_output) human_readable["Children"] = human_readable_arr tree_item["Children"] = output_arr return tree_item, human_readable def get_process_event_item(raw_event): return { "ID": raw_event.get("id"), "Detail": raw_event.get("detail"), "Operation": raw_event.get("operation"), "Timestamp": raw_event.get("timestamp"), "Type": raw_event.get("type"), } def get_process_item(raw_process): return { "CreateTime": raw_process.get("create_time"), "Domain": raw_process.get("domain"), "ExitCode": raw_process.get("exit_code"), "ProcessCommandLine": raw_process.get("process_command_line"), "ProcessID": raw_process.get("process_id"), "ProcessName": raw_process.get("process_name"), "ProcessTableId": raw_process.get("process_table_id"), "SID": raw_process.get("sid"), "Username": raw_process.get("username"), } def get_event_header(event_type): if event_type == "combined": headers = ["ID", "Type", "ProcessName", "Detail", "Timestamp", "Operation"] elif event_type == "file": headers = ["ID", "Type", "File", "Timestamp", "Domain", "ProcessTableID", "ProcessID", "ProcessName", "Username"] elif event_type == "network": headers = [ "ID", "Type", "Timestamp", "Domain", "ProcessTableID", "ProcessID", "ProcessName", "Username", "Operation", "DestinationAddress", "DestinationPort", "SourceAddress", "SourcePort", ] elif event_type == "registry": headers = [ "ID", "Type", "Timestamp", "Domain", "ProcessTableID", "ProcessID", "ProcessName", "Username", "KeyPath", "ValueName", ] elif event_type == "process": headers = [ "Domain", "Type", "ProcessTableID", "ProcessCommandLine", "ProcessID", "ProcessName", "ExitCode", "SID", "Username", "CreationTime", "EndTime", ] elif event_type == "driver": headers = [ "ID", "Type", "Timestamp", "ProcessTableID", "SID", "Hashes", "ImageLoaded", "Signature", "Signed", "EventID", "EventOpcode", "EventRecordID", "EventTaskID", ] elif event_type == "security": headers = ["ID", "Type", "Timestamp", "EventID", "EventTaskName", "ProcessTableID"] elif event_type == "dns": headers = [ "ID", "Type", "Timestamp", "Domain", "ProcessTableID", "ProcessID", "ProcessName", "Username", "Operation", "Query", "Response", ] else: # if event_type == "image" headers = [ "ID", "Type", "Timestamp", "ImagePath", "ProcessTableID", "ProcessID", "ProcessName", "Username", "Hash", "Signature", ] return headers def get_event_item(raw_event, event_type): event = { "ID": raw_event.get("id"), "Domain": raw_event.get("domain"), "File": raw_event.get("file"), "Operation": raw_event.get("operation"), "ProcessID": raw_event.get("process_id"), "ProcessName": raw_event.get("process_name"), "ProcessTableID": raw_event.get("process_table_id"), "Timestamp": raw_event.get("timestamp"), "Username": raw_event.get("username"), "DestinationAddress": raw_event.get("destination_addr"), "DestinationPort": raw_event.get("destination_port"), "SourceAddress": raw_event.get("source_addr"), "SourcePort": raw_event.get("source_port"), "KeyPath": raw_event.get("key_path"), "ValueName": raw_event.get("value_name"), "CreationTime": raw_event.get("create_time"), "EndTime": raw_event.get("end_time"), "ExitCode": raw_event.get("exit_code"), "ProcessCommandLine": raw_event.get("process_command_line"), "ProcessHash": raw_event.get("process_hash"), "SID": raw_event.get("sid"), "Hashes": raw_event.get("Hashes"), "ImageLoaded": raw_event.get("ImageLoaded"), "Signature": raw_event.get("Signature"), "Signed": raw_event.get("Signed"), "EventID": raw_event.get("event_id"), "EventOpcode": raw_event.get("event_opcode"), "EventRecordID": raw_event.get("event_record_id"), "EventTaskID": raw_event.get("event_task_id"), "EventTaskName": raw_event.get("event_task_name"), "Query": raw_event.get("query"), "Response": raw_event.get("response"), } if event_type == "security": event["Property"] = [{k.title(): v for k, v in prop.items()} for prop in raw_event.get("properties")] if event_type == "combined": event["Type"] = raw_event.get("type") else: event["Type"] = event_type.upper() if event_type in ["dns", "sid"] else event_type.title() # remove empty values from the event item return {k: v for k, v in event.items() if v is not None} def get_file_item(file, con_name, dir_path="", full_path=""): file_item = { "ConnectionName": con_name, "Created": timestamp_to_datestring(file.get("created"), "%Y-%m-%d %H:%M:%S"), "Path": file.get("file-path"), "IsDirectory": file.get("is-directory"), "LastModified": timestamp_to_datestring(file.get("last-modified"), "%Y-%m-%d %H:%M:%S"), "Permissions": file.get("permissions"), "Size": file.get("size"), "Deleted": False, } if not file_item["Path"]: file_item["Path"] = full_path else: file_item["Path"] = path_join(dir_path, file_item["Path"]) return {key: val for key, val in file_item.items() if val is not None} def get_file_download_item(file): return { "ID": file.get("id"), "Host": file.get("host"), "Path": file.get("path"), "SPath": file.get("spath"), "Hash": file.get("hash"), "Size": file.get("size"), "Created": file.get("created"), "CreatedBy": file.get("created_by"), "CreatedByProc": file.get("created_by_proc"), "LastModified": file.get("last_modified"), "LastModifiedBy": file.get("last_modified_by"), "LastModifiedByProc": file.get("last_modified_by_proc"), "Downloaded": file.get("downloaded"), "Comments": file.get("comments"), "Tags": file.get("tags"), "Deleted": False, } def get_label_item(label): return { "ID": label.get("id"), "Name": label.get("name"), "Description": label.get("description"), "IndicatorCount": label.get("indicatorCount"), "SignalCount": label.get("signalCount"), "CreatedAt": label.get("createdAt"), "UpdatedAt": label.get("updatedAt"), } def get_connection_item(connection): info = connection.get("info") return { "Name": connection.get("name"), "State": info.get("state"), "CreateTime": info.get("createTime"), "DST": info.get("dst"), "DestinationType": info.get("dstType"), "Remote": info.get("remote"), "OSName": connection.get("osName"), "Deleted": False, } def get_local_snapshot_items(raw_snapshots, limit, offset, conn_name): snapshots = [] host_snapshots = raw_snapshots.get(conn_name, {}) snapshot_keys = sorted(host_snapshots) from_idx = min(offset, len(snapshot_keys)) to_idx = min(offset + limit, len(snapshot_keys)) for key in snapshot_keys[from_idx:to_idx]: snapshots.append({"ConnectionName": conn_name, "FileName": key, "Deleted": False}) return snapshots def get_snapshot_items(raw_snapshots, limit, offset, conn_name): snapshots = [] host_snapshots = raw_snapshots.get(conn_name, {}) snapshot_keys = sorted(host_snapshots) from_idx = min(offset, len(snapshot_keys)) to_idx = min(offset + limit, len(snapshot_keys)) for key in snapshot_keys[from_idx:to_idx]: snapshots.append( { "ConnectionName": conn_name, "ID": key, "Started": host_snapshots[key].get("started", ""), "State": host_snapshots[key].get("state", ""), "Error": host_snapshots[key].get("error", ""), "Deleted": False, } ) return snapshots def get_intel_doc_item(intel_doc): return { "ID": intel_doc.get("id"), "Name": intel_doc.get("name"), "Type": intel_doc.get("type"), "Description": intel_doc.get("description"), "AlertCount": intel_doc.get("alertCount"), "UnresolvedAlertCount": intel_doc.get("unresolvedAlertCount"), "CreatedAt": intel_doc.get("createdAt"), "UpdatedAt": intel_doc.get("updatedAt"), "LabelIds": intel_doc.get("labelIds"), } def get_alert_item(alert): return { "ID": alert.get("id"), "AlertedAt": alert.get("alertedAt"), "ComputerIpAddress": alert.get("computerIpAddress"), "ComputerName": alert.get("computerName"), "CreatedAt": alert.get("createdAt"), "GUID": alert.get("guid"), "IntelDocId": alert.get("intelDocId"), "Priority": alert.get("priority"), "Severity": alert.get("severity"), "State": alert.get("state").title(), "Type": alert.get("type"), "UpdatedAt": alert.get("updatedAt"), } def get_quick_scan_item(quick_scan): return { "IntelDocId": quick_scan.get("intelDocId"), "ComputerGroupId": quick_scan.get("computerGroupId"), "ID": quick_scan.get("id"), "AlertCount": quick_scan.get("alertCount"), "CreatedAt": quick_scan.get("createdAt"), "UserId": quick_scan.get("userId"), "QuestionId": quick_scan.get("questionId"), } def alarm_to_incident(client, alarm): intel_doc_id = alarm.get("intelDocId", "") host = alarm.get("computerName", "") details = alarm.get("details") if details: details = json.loads(alarm["details"]) alarm["details"] = details intel_doc = "" if intel_doc_id: raw_response = client.do_request("GET", f"/plugin/products/detect3/api/v1/intels/{intel_doc_id}") intel_doc = raw_response.get("name") return {"name": f"{host} found {intel_doc}", "occurred": alarm.get("alertedAt"), "rawJSON": json.dumps(alarm)} def state_params_suffix(alerts_states_to_retrieve): valid_alert_states = ["unresolved", "inprogress", "resolved", "suppressed"] for state in alerts_states_to_retrieve: if state.lower() not in valid_alert_states: raise ValueError( f"Invalid state '{state}' in filter_alerts_by_state parameter." f"Possible values are 'unresolved', 'inprogress', 'resolved' or 'suppressed'." ) return "&".join(["state=" + state.lower() for state in alerts_states_to_retrieve]) def validate_connection_name(client, arg_input): """Tanium API's connection-name parameter is case sensitive - this function queries for the user input and returns the precise string to use in the API, or raises a ValueError if doesn't exist. Args: client: (Client) the client class object. arg_input: (str) the user input for a command's connection name argument. Returns: (str) The precise connection name. """ if arg_input.startswith("local-"): # don't check snapshots return arg_input if is_ip_valid(arg_input): # if input is IP, try with the format a-b-c-d first because it will replace the IP with the real connection name # and prevents the user from using the IP - which we prefer because that way the connections list won't contain # the IP with "timeout" state (it doesn't happen in Tanium UI). ip_input = arg_input.replace(".", "-") results = client.do_request("GET", f"/plugin/products/trace/computers?name={ip_input}") if results and len(results) == 1: return results[0] results = client.do_request("GET", f"/plugin/products/trace/computers?name={arg_input}") if results and len(results) == 1 and results[0].lower() == arg_input.lower(): return results[0] raise ValueError("The specified connection name does not exist.") def test_module(client, data_args): if client.login(): return demisto.results("ok") raise ValueError("Test Tanium integration failed - please check your username and password") def get_intel_doc(client, data_args): id_ = data_args.get("intel-doc-id") raw_response = client.do_request("GET", f"/plugin/products/detect3/api/v1/intels/{id_}") intel_doc = get_intel_doc_item(raw_response) context = createContext(intel_doc, removeNull=True) outputs = {"Tanium.IntelDoc(val.ID && val.ID === obj.ID)": context} intel_doc["LabelIds"] = str(intel_doc["LabelIds"]).strip("[]") headers = ["ID", "Name", "Description", "Type", "AlertCount", "UnresolvedAlertCount", "CreatedAt", "UpdatedAt", "LabelIds"] human_readable = tableToMarkdown( "Intel Doc information", intel_doc, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_intel_docs(client, data_args): limit = int(data_args.get("limit")) raw_response = client.do_request("GET", "/plugin/products/detect3/api/v1/intels/", params={"limit": limit}) intel_docs = [] for item in raw_response: intel_doc = get_intel_doc_item(item) intel_docs.append(intel_doc) context = createContext(intel_docs, removeNull=True) outputs = {"Tanium.IntelDoc(val.ID && val.ID === obj.ID)": context} for item in intel_docs: item["LabelIds"] = str(item["LabelIds"]).strip("[]") headers = ["ID", "Name", "Description", "Type", "AlertCount", "UnresolvedAlertCount", "CreatedAt", "UpdatedAt", "LabelIds"] human_readable = tableToMarkdown("Intel docs", intel_docs, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_alerts(client, data_args): limit = int(data_args.get("limit")) offset = data_args.get("offset") ip_address = data_args.get("computer-ip-address") computer_name = data_args.get("computer-name") scan_config_id = data_args.get("scan-config-id") intel_doc_id = data_args.get("intel-doc-id") severity = data_args.get("severity") priority = data_args.get("priority") type_ = data_args.get("type") state = data_args.get("state") params = { "type": type_, "priority": priority, "severity": severity, "intelDocId": intel_doc_id, "scanConfigId": scan_config_id, "computerName": computer_name, "computerIpAddress": ip_address, "limit": limit, "offset": offset, } if state: params["state"] = state.lower() raw_response = client.do_request("GET", "/plugin/products/detect3/api/v1/alerts/", params=params) alerts = [] for item in raw_response: alert = get_alert_item(item) alerts.append(alert) context = createContext(alerts, removeNull=True) headers = [ "ID", "Type", "Severity", "Priority", "AlertedAt", "CreatedAt", "UpdatedAt", "ComputerIpAddress", "ComputerName", "GUID", "State", "IntelDocId", ] outputs = {"Tanium.Alert(val.ID && val.ID === obj.ID)": context} human_readable = tableToMarkdown("Alerts", alerts, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_alert(client, data_args): alert_id = data_args.get("alert-id") raw_response = client.do_request("GET", f"/plugin/products/detect3/api/v1/alerts/{alert_id}") alert = get_alert_item(raw_response) context = createContext(alert, removeNull=True) outputs = {"Tanium.Alert(val.ID && val.ID === obj.ID)": context} headers = [ "ID", "Name", "Type", "Severity", "Priority", "AlertedAt", "CreatedAt", "UpdatedAt", "ComputerIpAddress", "ComputerName", "GUID", "State", "IntelDocId", ] human_readable = tableToMarkdown("Alert information", alert, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def alert_update_state(client, data_args): alert_id = data_args.get("alert-id") state = data_args.get("state") body = {"state": state.lower()} raw_response = client.do_request("PUT", f"/plugin/products/detect3/api/v1/alerts/{alert_id}", json_data=body) alert = get_alert_item(raw_response) context = createContext(alert, removeNull=True) outputs = {"Tanium.Alert(val.ID && val.ID === obj.ID)": context} headers = [ "ID", "Name", "Type", "Severity", "Priority", "AlertedAt", "CreatedAt", "UpdatedAt", "ComputerIpAddress", "ComputerName", "GUID", "State", "IntelDocId", ] human_readable = tableToMarkdown( f"Alert state updated to {state}", alert, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_snapshots(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) conn_name = data_args.get("connection-name") raw_response = client.do_request("GET", "/plugin/products/trace/snapshots/") snapshots = get_snapshot_items(raw_response, limit, offset, conn_name) context = createContext(snapshots, removeNull=True) headers = ["ID", "ConnectionName", "State", "Started", "Error"] outputs = {"Tanium.Snapshot(val.ID === obj.ID && val.ConnectionName === obj.ConnectionName)": context} human_readable = tableToMarkdown( f"Snapshots for connection {conn_name}", snapshots, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def create_snapshot(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) client.do_request("POST", f"/plugin/products/trace/conns/{con_name}/snapshots", resp_type="content") return f"Initiated snapshot creation request for {con_name}.", {}, {} def delete_snapshot(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) snapshot_id = data_args.get("snapshot-id") client.do_request("DELETE", f"/plugin/products/trace/conns/{con_name}/snapshots/{snapshot_id}", resp_type="content") context = {"ConnectionName": con_name, "ID": snapshot_id, "Deleted": True} outputs = {"Tanium.Snapshot(val.ID === obj.ID && val.ConnectionName === obj.ConnectionName)": context} return f"Snapshot {snapshot_id} deleted successfully.", outputs, {} def get_local_snapshots(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) conn_name = data_args.get("connection-name") raw_response = client.do_request("GET", "/plugin/products/trace/locals/") snapshots = get_local_snapshot_items(raw_response, limit, offset, conn_name) context = createContext(snapshots, removeNull=True) outputs = {"Tanium.LocalSnapshot(val.FileName === obj.FileName && val.ConnectionName === obj.ConnectionName)": context} headers = ["FileName", "ConnectionName"] human_readable = tableToMarkdown( f"Local snapshots for connection {conn_name}", snapshots, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def delete_local_snapshot(client, data_args): connection_name = data_args.get("connection-name") file_name = data_args.get("file-name") client.do_request("DELETE", f"/plugin/products/trace/locals/{connection_name}/{file_name}", resp_type="content") context = {"FileName": file_name, "Deleted": True} outputs = {"Tanium.LocalSnapshot(val.FileName === obj.FileName)": context} return f"Local snapshot {file_name} of connection {connection_name} was deleted successfully.", outputs, {} def get_connections(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) raw_response = client.do_request("GET", "/plugin/products/trace/conns") connections = [] from_idx = min(offset, len(raw_response)) to_idx = min(offset + limit, len(raw_response)) for conn in raw_response[from_idx:to_idx]: connections.append(get_connection_item(conn)) context = createContext(connections, removeNull=True) outputs = {"Tanium.Connection(val.Name && val.Name === obj.Name)": context} headers = ["Name", "State", "Remote", "CreateTime", "DST", "DestinationType", "OSName"] human_readable = tableToMarkdown("Connections", connections, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_connection(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) raw_response = client.do_request("GET", "/plugin/products/trace/conns") connection_raw_response: dict = {} found = False for conn in raw_response: if conn.get("name") and conn["name"] == conn_name: connection_raw_response = conn found = True break if not found: # Should not get here return "Connection not found.", {}, {} connection = get_connection_item(connection_raw_response) context = createContext(connection, removeNull=True) outputs = {"Tanium.Connection(val.Name && val.Name === obj.Name)": context} headers = ["Name", "State", "Remote", "CreateTime", "DST", "DestinationType", "OSName"] human_readable = tableToMarkdown( "Connection information", connection, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, connection_raw_response def create_connection(client, data_args): remote = bool(data_args.get("remote")) dst_type = data_args.get("destination-type") dst = validate_connection_name(client, data_args.get("destination")) conn_timeout = data_args.get("connection-timeout") body = {"remote": remote, "dst": dst, "dstType": dst_type, "connTimeout": conn_timeout} if conn_timeout: body["connTimeout"] = int(data_args.get("connection-timeout")) client.do_request("POST", "/plugin/products/trace/conns/", json_data=body, resp_type="content") return f"Initiated connection request to {dst}.", {}, {} def delete_connection(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) client.do_request("DELETE", "/plugin/products/trace/conns/{conn_name}", resp_type="text") context = {"Name": conn_name, "Deleted": True} outputs = {"Tanium.Connection(val.Name && val.Name === obj.Name)": context} return f"Connection {conn_name} deleted successfully.", outputs, {} def get_labels(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) raw_response = client.do_request("GET", "/plugin/products/detect3/api/v1/labels/") from_idx = min(offset, len(raw_response)) to_idx = min(offset + limit, len(raw_response)) labels = [] for item in raw_response[from_idx:to_idx]: label = get_label_item(item) labels.append(label) context = createContext(labels, removeNull=True) outputs = {"Tanium.Label(val.ID && val.ID === obj.ID)": context} headers = ["Name", "Description", "ID", "IndicatorCount", "SignalCount", "CreatedAt", "UpdatedAt"] human_readable = tableToMarkdown("Labels", labels, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_label(client, data_args): label_id = data_args.get("label-id") raw_response = client.do_request("GET", f"/plugin/products/detect3/api/v1/labels/{label_id}") label = get_label_item(raw_response) context = createContext(label, removeNull=True) outputs = {"Tanium.Label(val.ID && val.ID === obj.ID)": context} headers = ["Name", "Description", "ID", "IndicatorCount", "SignalCount", "CreatedAt", "UpdatedAt"] human_readable = tableToMarkdown("Label information", label, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_file_downloads(client, data_args): data_args = {key: val for key, val in data_args.items() if val is not None} raw_response = client.do_request("GET", "/plugin/products/trace/filedownloads/", params=data_args) files = [] for item in raw_response: file = get_file_download_item(item) files.append(file) context = createContext(files, removeNull=True) outputs = {"Tanium.FileDownload(val.ID && val.ID === obj.ID)": context} headers = [ "ID", "Host", "Path", "Hash", "Downloaded", "Size", "Created", "CreatedBy", "CreatedByProc", "LastModified", "LastModifiedBy", "LastModifiedByProc", "SPath", "Comments", "Tags", ] human_readable = tableToMarkdown("File downloads", files, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_downloaded_file(client, data_args): file_id = data_args.get("file-id") file_content, content_desc = client.do_request("GET", f"/plugin/products/trace/filedownloads/{file_id}", resp_type="content") filename = re.findall(r"filename\*=UTF-8\'\'(.+)", content_desc)[0] demisto.results(fileResult(filename, file_content)) def filter_to_tanium_api_syntax(filter_str): filter_dict = {} try: if filter_str: filter_expressions = ast.literal_eval(filter_str) for i, expression in enumerate(filter_expressions): filter_dict["f" + str(i)] = expression[0] filter_dict["o" + str(i)] = expression[1] filter_dict["v" + str(i)] = expression[2] return filter_dict except IndexError: raise ValueError("Invalid filter argument.") def get_events_by_connection(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) connection = validate_connection_name(client, data_args.get("connection-name")) sort = data_args.get("sort") fields = data_args.get("fields") event_type = data_args.get("event-type").lower() filter_dict = filter_to_tanium_api_syntax(data_args.get("filter")) match = data_args.get("match") params = {"limit": limit, "offset": offset, "sort": sort, "fields": fields, "match": match} if filter_dict: g1 = ",".join([str(i) for i in range(len(filter_dict) // 3)]) # A weird param that must be passed params["gm1"] = match params["g1"] = g1 params.update(filter_dict) raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{connection}/{event_type}/events/", params=params) events = [] for item in raw_response: event = get_event_item(item, event_type) events.append(event) context = createContext(events, removeNull=True) outputs = {"TaniumEvent(val.ID === obj.ID)": context} headers = get_event_header(event_type) human_readable = tableToMarkdown( f"Events for {connection}", events, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_file_download_info(client, data_args): if not data_args.get("path") and not data_args.get("id"): raise ValueError("At least one of the arguments `path` or `id` must be set.") data_args = {key: val for key, val in data_args.items() if val is not None} raw_response = client.do_request("GET", "/plugin/products/trace/filedownloads/", params=data_args) if not raw_response: raise ValueError("File download does not exist.") file = get_file_download_item(raw_response[0]) context = createContext(file, removeNull=True) outputs = {"Tanium.FileDownload(val.ID && val.ID === obj.ID)": context} headers = [ "ID", "Host", "Path", "Hash", "Downloaded", "Size", "Created", "CreatedBy", "CreatedByProc", "LastModified", "LastModifiedBy", "LastModifiedByProc", "SPath", "Comments", "Tags", ] human_readable = tableToMarkdown( f'File download metadata for file `{file["Path"]}`', file, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_process_info(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{conn_name}/processes/{ptid}") process = get_process_item(raw_response) context = createContext(process, removeNull=True) outputs = {"Tanium.Process(val.ProcessID && val.ProcessID === obj.ProcessID)": context} headers = [ "ProcessID", "ProcessName", "ProcessCommandLine", "ProcessTableId", "SID", "Username", "Domain", "ExitCode", "CreateTime", ] human_readable = tableToMarkdown( f"{PROCESS_TEXT} {ptid}", process, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_events_by_process(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") raw_response = client.do_request( "GET", f"/plugin/products/trace/conns/{conn_name}/processevents/{ptid}", params={"limit": limit, "offset": offset} ) events = [] for item in raw_response: event = get_process_event_item(item) events.append(event) context = createContext(events, removeNull=True) outputs = {"Tanium.ProcessEvent(val.ID && val.ID === obj.ID)": context} headers = ["ID", "Detail", "Type", "Timestamp", "Operation"] human_readable = tableToMarkdown( f"Events for process {ptid}", events, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_process_children(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{conn_name}/processtrees/{ptid}/children") children = [] children_human_readable = [] for item in raw_response: child, readable_output = get_process_tree_item(item, 1) children.append(child) children_human_readable.append(readable_output) context = createContext(children, removeNull=True) outputs = {"Tanium.ProcessChildren(val.ID && val.ID === obj.ID)": context} headers = ["ID", "Name", "PID", "PTID", "Parent", "Children", "ChildrenCount"] human_readable = tableToMarkdown( f"{PROCESS_CHILDREN_TEXT} {ptid}", children_human_readable, headers=headers, headerTransform=pascalToSpace, removeNull=True, ) return human_readable, outputs, raw_response def get_parent_process(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{conn_name}/parentprocesses/{ptid}") process = get_process_item(raw_response) context = createContext(process, removeNull=True) outputs = {"Tanium.ParentProcess(val.ProcessID && val.ProcessID === obj.ProcessID)": context} headers = [ "ProcessID", "ProcessName", "ProcessCommandLine", "ProcessTableId", "SID", "Username", "Domain", "ExitCode", "CreateTime", ] human_readable = tableToMarkdown( f"{PROCESS_TEXT} {ptid}", process, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_parent_process_tree(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{conn_name}/parentprocesstrees/{ptid}") if not raw_response: raise ValueError("Failed to parse tanium-tr-get-parent-process-tree response.") tree, readable_output = get_process_tree_item(raw_response[0], 0) children_item = readable_output.get("Children") headers = ["ID", "Name", "PID", "PTID", "Parent", "Children", "ChildrenCount"] if children_item: process_tree = readable_output.copy() del process_tree["Children"] headers = ["ID", "Name", "PID", "PTID", "Parent", "Children", "ChildrenCount"] human_readable = tableToMarkdown( f"{PARENT_PROCESS_TEXT} {ptid}", process_tree, headers=headers, headerTransform=pascalToSpace, removeNull=True ) human_readable += tableToMarkdown( "Processes with the same parent", children_item, headers=headers, headerTransform=pascalToSpace, removeNull=True ) else: human_readable = tableToMarkdown( f"{PARENT_PROCESS_TEXT} {ptid}", readable_output, headers=headers, headerTransform=pascalToSpace, removeNull=True ) context = createContext(tree, removeNull=True) outputs = {"Tanium.ParentProcessTree(val.ID && val.ID === obj.ID)": context} return human_readable, outputs, raw_response def get_process_tree(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{conn_name}/processtrees/{ptid}") if not raw_response: raise ValueError("Failed to parse tanium-tr-get-process-tree response.") tree, readable_output = get_process_tree_item(raw_response[0], 0) headers = ["ID", "Name", "PID", "PTID", "Parent", "Children", "ChildrenCount"] children_item = readable_output.get("Children") if children_item: process_tree = readable_output.copy() del process_tree["Children"] human_readable = tableToMarkdown( f"Process information for process with PTID {ptid}", process_tree, headers=headers, headerTransform=pascalToSpace, removeNull=True, ) human_readable += tableToMarkdown( f"{PROCESS_CHILDREN_TEXT} {ptid}", children_item, headers=headers, headerTransform=pascalToSpace, removeNull=True ) else: human_readable = tableToMarkdown( f"{PROCESS_TEXT} {ptid}", readable_output, headers=headers, headerTransform=pascalToSpace, removeNull=True ) context = createContext(tree, removeNull=True) outputs = {"Tanium.ProcessTree(val.ID && val.ID === obj.ID)": context} return human_readable, outputs, raw_response def list_evidence(client, data_args): limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) sort = data_args.get("sort") params = {"sort": sort, "limit": limit, "offset": offset} raw_response = client.do_request("GET", "/plugin/products/trace/evidence", params=params) evidences = [] for item in raw_response: evidence = get_evidence_item(item) evidences.append(evidence) context = createContext(evidences, removeNull=True) outputs = {"Tanium.Evidence(val.ID && val.ID === obj.ID)": context} headers = [ "ID", "Timestamp", "ConnectionName", "User", "Summary", "Type", "CreatedAt", "UpdatedAt", "ProcessTableId", "Comments", "Tags", ] human_readable = tableToMarkdown("Evidence list", evidences, headers=headers, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def get_evidence(client, data_args): evidence_id = data_args.get("evidence-id") raw_response = client.do_request("GET", f"/plugin/products/trace/evidence/{evidence_id}") if not raw_response: raise DemistoException(f"Evidence {evidence_id} was not found.") evidence = get_evidence_item(raw_response) context = createContext(evidence, removeNull=True) outputs = {"Tanium.Evidence(val.ID && val.ID === obj.ID)": context} headers = [ "ID", "Timestamp", "Host", "User", "Summary", "ConntectionID", "Type", "CreatedAt", "UpdatedAt", "ProcessTableId", "Comments", "Tags", ] human_readable = tableToMarkdown( "Label information", evidence, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def create_evidence(client, data_args): conn_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") params = {"match": "all", "f1": "process_table_id", "o1": "eq", "v1": ptid} process_data = client.do_request("GET", f"/plugin/products/trace/conns/{conn_name}/process/events", params=params) if not process_data: raise ValueError("Invalid connection-name or ptid.") data = { "host": conn_name, "user": client.username, "data": process_data[0], "connId": conn_name, "type": "ProcessEvent", "sTimestamp": process_data[0].get("create_time"), "sId": ptid, } client.do_request("POST", "/plugin/products/trace/evidence", json_data=data, resp_type="content") return "Evidence have been created.", {}, {} def delete_evidence(client, data_args): evidence_id = data_args.get("evidence-id") client.do_request("DELETE", f"/plugin/products/trace/evidence/{evidence_id}", resp_type="content") context = {"ID": int(evidence_id), "Deleted": True} outputs = {"Tanium.Evidence(val.ID === obj.ID)": context} return f"Evidence {evidence_id} has been deleted successfully.", outputs, {} def request_file_download(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) path = data_args.get("path") # context object will help us to verify the request has succeed in the download file playbook. context = {"ConnectionName": con_name, "Path": path, "Downloaded": datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S.%f")} outputs = {"Tanium.FileDownload(val.Path === obj.Path && val.ConnectionName === obj.ConnectionName)": context} data = {"path": path, "connId": con_name} client.do_request("POST", "/plugin/products/trace/filedownloads", json_data=data, resp_type="text") filename = os.path.basename(path) return f"Download request of file {filename} has been sent successfully.", outputs, {} def get_file_download_request_status(client, data_args): downloaded = str(data_args.get("request-date")).replace("T", " ") host = data_args.get("connection-name") path = data_args.get("path") params = {"downloaded>": downloaded} if host: params["host"] = host if path: params["path"] = path raw_response = client.do_request("GET", "/plugin/products/trace/filedownloads", params=params) if raw_response: file_id = raw_response[0].get("id") status = "Completed" downloaded = raw_response[0].get("downloaded") path = path if path else raw_response[0].get("path") host = host if host else raw_response[0].get("host") else: file_id = None status = "Not found" file_download_request = {"ID": file_id, "ConnectionName": host, "Path": path, "Status": status, "Downloaded": downloaded} context = createContext(file_download_request, removeNull=True) outputs = {"Tanium.FileDownload(val.Path === obj.Path && val.ConnectionName === obj.ConnectionName)": context} headers = ["ID", "ConnectionName", "Status", "Path", "Downloaded"] human_readable = tableToMarkdown( "File download request status", file_download_request, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def delete_file_download(client, data_args): file_id = data_args.get("file-id") client.do_request("DELETE", f"/plugin/products/trace/filedownloads/{file_id}", resp_type="text") context = {"ID": int(file_id), "Deleted": True} outputs = {"Tanium.FileDownload(val.ID && val.ID === obj.ID)": context} return f"Delete request of file with ID {file_id} has been sent successfully.", outputs, {} def list_files_in_dir(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) dir_path_name = data_args.get("path") dir_path = urllib.parse.quote(dir_path_name, safe="") limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) raw_response = client.do_request("GET", f"/plugin/products/trace/filedownloads/{con_name}/list/{dir_path}") files = [] from_idx = min(offset, len(raw_response)) to_idx = min(offset + limit, len(raw_response)) for file in raw_response[from_idx:to_idx]: files.append(get_file_item(file, con_name, dir_path_name)) context = createContext(files, removeNull=True) outputs = {"Tanium.File(val.Path === obj.Path && val.ConnectionName === obj.ConnectionName)": context} headers = ["Path", "Size", "Created", "LastModified", "Permissions", "IsDirectory"] human_readable = tableToMarkdown( f"Files in directory `{dir_path_name}`", files, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_file_info(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) path_name = data_args.get("path") path = urllib.parse.quote(path_name, safe="") raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{con_name}/fileinfo/{path}") file_info = get_file_item(raw_response, con_name, full_path=path_name) context = createContext(file_info, removeNull=True) outputs = {"Tanium.File(val.Path === obj.Path && val.ConnectionName === obj.ConnectionName)": context} headers = ["Path", "ConnectionName", "Size", "Created", "LastModified", "Permissions", "IsDirectory"] human_readable = tableToMarkdown( f"Information for file `{path_name}`", file_info, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def delete_file_from_endpoint(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) path = urllib.parse.quote(data_args.get("path")) client.do_request("DELETE", f"/plugin/products/trace/filedownloads/{con_name}/{path}", resp_type="text") context = {"Path": data_args.get("path").replace("\\", "/"), "ConnectionName": con_name, "Deleted": True} outputs = {"Tanium.File(val.Path === obj.Path && val.ConnectionName === obj.ConnectionName)": context} return f"Delete request of file {path} from endpoint {con_name} has been sent successfully.", outputs, {} def get_process_timeline(client, data_args): con_name = validate_connection_name(client, data_args.get("connection-name")) ptid = data_args.get("ptid") category = data_args.get("category") limit = int(data_args.get("limit")) offset = int(data_args.get("offset")) raw_response = client.do_request("GET", f"/plugin/products/trace/conns/{con_name}/eprocesstimelines/{ptid}") timeline = get_process_timeline_item(raw_response, category, limit, offset) context = createContext(timeline, removeNull=True) outputs = {"Tanium.ProcessTimeline(val.ProcessTableID && val.ProcessTableID === obj.ProcessTableID)": context} headers = ["Date", "Event", "Category"] human_readable = tableToMarkdown( f"Timeline data for process with PTID `{ptid}`", timeline, headers=headers, headerTransform=pascalToSpace, removeNull=True ) return human_readable, outputs, raw_response def get_file_data(entry_id: str) -> tuple[str, str, str]: """Gets a file name and content from the file's entry ID. :type entry_id: ``str`` :param entry_id: the file's entry ID. :return: file name, path and content :rtype: ``tuple`` """ file = demisto.getFilePath(entry_id) file_path = file.get("path") file_name = file.get("name") with open(file_path) as f: file_content = f.read() return file_name, file_path, file_content def intel_doc_create(client, data_args): entry_id = data_args.get("entry_id") file_extension = data_args.get("file_extension") try: file_name, _, file_content = get_file_data(str(entry_id)) except Exception as e: raise DemistoException(f"Check your file entry ID.\n{str(e)}") raw_response = client.do_request( "POST", "/plugin/products/detect3/api/v1/intels/", headers={"Content-Disposition": f"filename=file.{file_extension}", "Content-Type": "application/xml"}, data=file_content, ) intel_doc = get_intel_doc_item(raw_response) context = createContext(intel_doc, removeNull=True) outputs = {"Tanium.IntelDoc(val.ID && val.ID === obj.ID)": context} if intel_doc: intel_doc["LabelIds"] = str(intel_doc["LabelIds"]).strip("[]") human_readable = tableToMarkdown("Intel Doc information", intel_doc, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def start_quick_scan(client, data_args): # get computer group ID from computer group name computer_group_name = data_args.get("computer_group_name") raw_response = client.do_request("GET", f"/api/v2/groups/by-name/{computer_group_name}") raw_response_data = raw_response.get("data") if not raw_response_data: msg = ( f"No group exists with name {computer_group_name} or" f" your account does not have sufficient permissions to access the groups" ) raise DemistoException(msg) data = {"intelDocId": int(data_args.get("intel_doc_id")), "computerGroupId": int(raw_response_data.get("id"))} raw_response = client.do_request("POST", "/plugin/products/detect3/api/v1/quick-scans/", json_data=data) quick_scan = get_quick_scan_item(raw_response) context = createContext(quick_scan, removeNull=True) outputs = {"Tanium.QuickScan(val.ID && val.ID === obj.ID)": context} human_readable = tableToMarkdown("Quick Scan started", quick_scan, headerTransform=pascalToSpace, removeNull=True) return human_readable, outputs, raw_response def fetch_incidents(client, alerts_states_to_retrieve): """ Fetch events from this integration and return them as Demisto incidents returns: Demisto incidents """ # demisto.getLastRun() will returns an obj with the previous run in it. last_run = demisto.getLastRun() # Get the last fetch time and data if it exists last_fetch = last_run.get("time") # Handle first time fetch, fetch incidents retroactively if not last_fetch: last_fetch, _ = parse_date_range(FETCH_TIME, date_format=DATE_FORMAT) last_fetch = parse(last_fetch) current_fetch = last_fetch url_suffix = "/plugin/products/detect3/api/v1/alerts?" + state_params_suffix(alerts_states_to_retrieve) raw_response = client.do_request("GET", url_suffix) # convert the data/events to demisto incidents incidents = [] for alarm in raw_response: incident = alarm_to_incident(client, alarm) temp_date = parse(incident.get("occurred")) # update last run if temp_date > last_fetch: last_fetch = temp_date + timedelta(seconds=1) # avoid duplication due to weak time query if temp_date > current_fetch: incidents.append(incident) demisto.setLastRun({"time": datetime.strftime(last_fetch, DATE_FORMAT)}) return demisto.incidents(incidents) """ COMMANDS MANAGER / SWITCH PANEL """ def main(): params = demisto.params() username = params.get("credentials").get("identifier") password = params.get("credentials").get("password") # Remove trailing slash to prevent wrong URL path to service server = params["url"].strip("/") # Should we use SSL use_ssl = not params.get("insecure", False) # Remove proxy if not set to true in params handle_proxy() command = demisto.command() client = Client(server, username, password, verify=use_ssl) demisto.info(f"Command being called is {command}") commands = { "test-module": test_module, "tanium-tr-get-intel-doc-by-id": get_intel_doc, "tanium-tr-list-intel-docs": get_intel_docs, "tanium-tr-list-alerts": get_alerts, "tanium-tr-get-alert-by-id": get_alert, "tanium-tr-alert-update-state": alert_update_state, "tanium-tr-list-snapshots-by-connection": get_snapshots, "tanium-tr-create-snapshot": create_snapshot, "tanium-tr-delete-snapshot": delete_snapshot, "tanium-tr-list-local-snapshots-by-connection": get_local_snapshots, "tanium-tr-delete-local-snapshot": delete_local_snapshot, "tanium-tr-list-connections": get_connections, "tanium-tr-get-connection-by-name": get_connection, "tanium-tr-create-connection": create_connection, "tanium-tr-delete-connection": delete_connection, "tanium-tr-list-labels": get_labels, "tanium-tr-get-label-by-id": get_label, "tanium-tr-list-events-by-connection": get_events_by_connection, "tanium-tr-get-process-info": get_process_info, "tanium-tr-get-events-by-process": get_events_by_process, "tanium-tr-get-process-children": get_process_children, "tanium-tr-get-parent-process": get_parent_process, "tanium-tr-get-parent-process-tree": get_parent_process_tree, "tanium-tr-get-process-tree": get_process_tree, "tanium-tr-list-evidence": list_evidence, "tanium-tr-get-evidence-by-id": get_evidence, "tanium-tr-create-evidence": create_evidence, "tanium-tr-delete-evidence": delete_evidence, "tanium-tr-list-file-downloads": get_file_downloads, "tanium-tr-get-file-download-info": get_file_download_info, "tanium-tr-request-file-download": request_file_download, "tanium-tr-get-download-file-request-status": get_file_download_request_status, "tanium-tr-delete-file-download": delete_file_download, "tanium-tr-list-files-in-directory": list_files_in_dir, "tanium-tr-get-file-info": get_file_info, "tanium-tr-delete-file-from-endpoint": delete_file_from_endpoint, "tanium-tr-get-process-timeline": get_process_timeline, "tanium-tr-intel-doc-create": intel_doc_create, "tanium-tr-start-quick-scan": start_quick_scan, } try: if command == "fetch-incidents": alerts_states_to_retrieve = demisto.params().get("filter_alerts_by_state") return fetch_incidents(client, alerts_states_to_retrieve) if command == "tanium-tr-get-downloaded-file": return get_downloaded_file(client, demisto.args()) if command in commands: human_readable, outputs, raw_response = commands[command](client, demisto.args()) return_outputs(readable_output=human_readable, outputs=outputs, raw_response=raw_response) except Exception as e: import traceback if command == "fetch-incidents": LOG(traceback.format_exc()) LOG.print_log() raise else: error_msg = str(e) if command in COMMANDS_DEPEND_ON_CONNECTIVITY: error_msg += DEPENDENT_COMMANDS_ERROR_MSG return_error(f"Error in Tanium Threat Response Integration: {error_msg}", traceback.format_exc()) if __name__ in ("__builtin__", "builtins", "__main__"): main()