Creating API tokens in ServiceNow

API tokens for ServiceNow integrations

API authentication tokens enable users to secure sessions between ServiceNow integrations and your Tanium environment. One API token is required for each service account or persona that you use to work in a ServiceNow integration. After you create an API token in your Tanium instance, you can then enter the API token as a system property when configuring the integration in ServiceNow. Scheduled jobs in ServiceNow automatically rotate the tokens every seven days by default.

Note: Do not use a single token for multiple processes. For example, do not use a single token for a ServiceNow integration and a Splunk integration, or for multiple ServiceNow instances, or for multiple connections from one ServiceNow instance to Tanium Cloud or the Tanium Server. When a token rotates for any process, that token stops working for any other processes that use it.

RBAC for API tokens

Consider the following factors when you select a service account or a persona to associate with a token:

  • Service account: A service account is a user account that no specific user owns. Using a service account instead of a persona gives you more visibility into who is making changes during a session. All users who use the service account must share its credentials. For more information, see Configure a service account.

  • Persona: Using a persona enables you to configure one set of RBAC controls (such as role and computer group assignments) that apply to all the users who are assigned to that persona. For more information, see Configure a persona.

Note: Use a service account to create every token unless the token is for workflows that a specific user account or persona must run according to the mandates of your organization. If users or personas are deleted or disabled (such as when a user leaves your organization), their tokens produce 401 Unauthorized errors when other accounts or personas try to use those tokens. Such errors are less likely for tokens that are bound to service accounts because those accounts are more often permanent.

Trusted IP addresses for API tokens

Each API token specifies trusted IP addresses for the ServiceNow environment that communicates with Tanium Cloud. A token can authenticate only for traffic from the specified systems.

Note: For improved security, limit API token access to the IP address ranges that are necessary for the integrations.

You must determine the trusted IP addresses before creating the associated token. See the ServiceNow Support KB article Finding the IP address information for your instance and then record the addresses that correspond to your Tanium environment:

  • On-Premises: Record the IP addresses of the management, instrumentation, and discovery (MID) servers that enable communication between the ServiceNow instance and the Tanium environment.

  • Cloud: Record the Source address used for integrations into customer network with NO VPN ranges of your ServiceNow instance. This is a /29 IP address range. Because production environments span two data centers, customers must allow addresses from both /29 IP ranges to ensure reliable connectivity.

Tip: To test the integration, you can use 0.0.0.0/0 to allow access from any IP address. However, this configuration is insecure and should never be used in production, because it permits token usage from any source IP.

Configure a service account

Associating an API token with a service account instead of a persona is a best practice, as described in RBAC for API tokens. If an account for the integration already exists, edit that account to assign the necessary roles. Otherwise, configure the assignments when you create a new account.

Perform the following steps to configure a service account. All the links in these steps are to the Tanium Console User Guide.

  1. In Tanium Console, create a service account for your ServiceNow integration if the account does not already exist. For the steps, see Create a user.
  2. Assign the following roles to the account. For the steps, see Manage role assignments for a user.
    • Interact Basic User
    • Gateway User
  3. Click Save to save the account configuration.

For more information about how to create and configure user accounts in Tanium Console, see Managing users.

Configure a persona

Associate a persona with an API token only if you do not use a service account, as described in RBAC for API tokens. If a persona for the integration already exists, edit that persona to assign the necessary roles and users. Otherwise, configure the assignments when you create a persona.

Perform the following steps to configure a persona. All the links in these steps are to the Tanium Console User Guide.

  1. In Tanium Console, create a persona if the persona for your ServiceNow integration does not already exist.
  2. Assign the following roles to the persona, as described in Manage role assignments for a persona:
    • Interact Basic User
    • Gateway User
  3. Assign users to the persona, as described in Manage user assignments for a persona.
  4. Click Save to save the persona configuration. If you created a new persona, you must perform a hard refresh on your browser tab before the persona becomes available to select for your current Tanium session.

Create API tokens

Review the prerequisites and best practices in API tokens for ServiceNow integrations before you create tokens. Then perform the following steps for each token.

  1. Sign in to Tanium Console as a user who has the role permissions to create and manage API tokens. For details, see RBAC management permissions.
  2. From the Main menu, go to Administration > Permissions > API Tokens.
  3. Click New API Token, configure the following settings, and click Create.
    • Notes: Identify the integration type and ServiceNow instance to which the token applies.
    • Expiration: By default, ServiceNow instances automatically rotate tokens every seven days. Set an expiration interval that is a bit longer than seven days to account for unexpected events, such as disruptions to network connections, that might delay the automatic rotation.
    • Trusted IP Addresses: Enter the IP addresses for the ServiceNow systems that communicate with Tanium Cloud, as described in Trusted IP addresses for API tokens.
  4. Copy Copy the token to your clipboard. Paste the token in a text file and save the file in a secure location.
    Important: The token value includes the token- prefix. You cannot view the token value in Tanium Console after the visibility timeout of five minutes expires, you refresh the API Tokens page or grid, or you navigate to another Console page. If you later manually rotate the token, you must re-enter its value. Therefore, if you want manual rotation to be an option, copy the value (including token-) before the timeout and save it in a secure location.