Authenticating content files

Overview of content imports and exports

Exporting content (such as sensors and roles) enables you to review the content attributes offline in an application outside Tanium Console (such as in Microsoft Excel) or to import the content into another Tanium Server.

Note: For the user role permissions that are required to import or export content, see Import content files and Export content files.

Supported file formats

You can export content as a file in one of the following formats:

  • JSON

    A JSON file contains the configurations of content objects. Exporting configurations is useful if you want to import them into another Tanium environment. For example, you might test custom sensors in a lab environment to ensure that they work as intended before importing the sensors into your production environment. You must be assigned a role with the Export Content permission to export a JSON file. If you have Import Signed Content permission, you can then import the file into another Tanium Server. The Administrator reserved role has export and import permissions.

  • CSV

    A CSV file contains all the attributes of content objects that you see in various grids in Tanium Console. For example, if you export in CSV format from the Sensors page, the CSV file contains all the sensor attributes (columns) that you see in the grid on that page. CSV exports are useful for reviewing content attributes in applications that support CSV. For example, you can use Microsoft Excel to create charts based on sensor attributes.

Digital signatures and keys

In Tanium deployments with a production license, content that you import requires a digital signature by default. Signature validation helps to protect your deployment from imports of unauthorized files. A private key is used to create the signature. The Tanium Server uses the associated public key to validate the signature during the import process. You maintain the public keys of trusted signers on the Server. If none of the public keys in the Server key store can validate the signature, the Server does not import the content, and Tanium Console shows failure messages:

Error Error occurred beginning import: FAILURE

Error Import validation failed. The signature did not match. Please verify the file contents, validate the signature, and try again.

Note: In Tanium deployments with a lab license, Tanium Console notifies you if the file you selected to import is unsigned and lets you choose whether to proceed. However, the best practice is to not import unsigned files in any deployment.

You do not have to generate keys or signatures for content that you import as a component of a Tanium solution. Tanium signs this content before making it available, and the associated public key is distributed to the Tanium Server key store during the Server installation process. For all other content, you must manually generate a public-private key pair to sign and validate the content files that you import.

As one-time tasks before importing content, you must generate the public-private key pair and copy the public key to the Tanium Server key store. You must then use the private key to sign each new content file that you import. If you plan to import a file that another user signed, you can first perform an integrity check on the file as described at Verify content file signatures.

Import and export permissions

Users who are assigned a role with Import Signed Content permission can import signed content files. Users who have the Administrator reserved role can export and import all content types. For other users, the ability to export varies by content type and role assignments. For more information, see Content management permissions.

Create content authentication keys

The Tanium Server provides a command-line program to generate a cryptographic key pair for signing and validating content files. The program is KeyUtility on Windows and TaniumKeyUtility on Linux. The program and its associated files reside in the top-level installation directory of the Server. You can run the program from the Server installation directory (Windows only) or copy the files to a working directory on another system and run the program from that working directory.

Windows: Create content authentication keys

  1. (Optional) To run KeyUtility from a working directory, set up the directory as follows:

    1. Copy the following files from the Tanium Server installation directory (such as \Program Files\Tanium\Tanium Server) or from the location where you unzipped the KeyUtility-<release>.zip file that Tanium Support provided:

      • KeyUtility.exe

      • libeay32.dll

      • ssleay32.dll

    2. Paste the files into the working directory.

  2. Open the Windows Command Prompt (cmd.exe) and run the following command from the directory where the KeyUtility files reside. The <file name> argument defines the key-file names, but you do not have to specify the suffix. KeyUtility automatically appends the suffix .pub for the public key and .pvk for the private key.

    CODE
    KeyUtility.exe makekeys <file name>

The following is an example of the command and the resulting contents of a working directory:

CODE
D:\Tanium\Working>KeyUtility.exe makekeys import

D:\Tanium\Working>dir
			
Directory of D:\Tanium\Working
			
09/05/2018  08:05 PM    <DIR>          .
09/05/2018  08:05 PM    <DIR>          ..
08/17/2018  03:04 AM         4,254,704 KeyUtility.exe
03/27/2018  07:03 PM         2,632,192 libeay32.dll
03/27/2018  07:03 PM           457,728 ssleay32.dll
09/05/2018  08:05 PM               158 import.pub
09/05/2018  08:05 PM               241 import.pvk
5 File(s)      7,345,023 bytes
2 Dir(s)  41,049,174,016 bytes free

Linux: Create content authentication keys

On a Tanium Appliance, running TaniumKeyUtility requires shell access, which is not available in most cases. The following steps describe how to run the program from another working directory instead.

  1. Contact Tanium Support to request the the KeyUtility-<release>.tgz file that contains TaniumKeyUtility and associated files:

    • TaniumKeyUtility

    • libcrypto.so.1.0.0

    • libssl.so.1.0.0

    Tip: You can also find the files in the Tanium Server installation directory (such as /opt/Tanium/TaniumServer).
  2. Copy KeyUtility-<release>.tgz to the working directory and uncompress it:

    CODE
    tar -xvf KeyUtility-<release>.tgz
  3. Run the following command from the directory where TaniumKeyUtility resides. The <file name> argument defines the key-file names, but you do not have to specify the suffix. TaniumKeyUtility automatically appends the suffix .pub for the public key and .pvk for the private key.

    CODE
    ./TaniumKeyUtility makekeys <file name>

The following is an example of the command and the resulting contents of a working directory:

CODE
./TaniumKeyUtility makekeys import

ls -l			

-r-xr-x---  1 tanium tanium  7947792 Jun  1 13:39 TaniumKeyUtility
-r-xr-x---  1 tanium tanium  2947600 Jun  1 13:39 libcrypto.so.1.0.0
-r-xr-x---  1 tanium tanium   459272 Jun  1 13:39 libssl.so.1.0.0
-rw-r-----  1 tanium tanium      158 Jul 19 16:38 import.pub
-rw-r--r--  1 tanium tanium      241 Jul 19 16:38 import.pvk

Sign content files

After you create a public-private key pair for authenticating content files, use the private key to sign the files.

Windows: Sign content files

  1. Copy the content file to a location that you can access from the directory where the KeyUtility and content-signing key files reside.

    The directory is either the Tanium Server installation directory (such as \Program Files\Tanium\Tanium Server) or a working directory that you set up. For more information, see Windows: Create content authentication keys.

  2. Open the Windows Command Prompt (cmd.exe) and go to the directory where the KeyUtility and key files reside.

  3. Sign the content file.

    CODE
    KeyUtility.exe signcontent <private_key> <content_file>

    The following is an example of the command:

    CODE
    KeyUtility.exe signcontent import.pvk sensors.json
  4. Open the content file in a text editor and verify that a signature such as the following appears at the bottom:

    CODE
    <!--hash=2a8bc7529c9fcdad037982bcbfc12306aa88ac8b9d95d02248ec369008188b7c0e356ad1811609c7
    			54eb01dc97c09b9f2acb10331e2d9dbf77d309124c61950a;signature=01AF3D547A97CCBD62A022F398
    			586DEAD4E29A30C29406283DA2E8F1E9FCF176194D66D4D9602538102F8F2FBBCFBC7AF370DB44E839C04
    			7253A246447E9A146706F00E94CD26D2CF29D8916E6EE0F21C77F0E13A6769905E5DDC09458912A94BB74
    			C1311C9B26301DB8D8C73AC043EBC6A5A836FB6815011F1ACB37E0248A30F100B631-->

Linux: Sign content files

  1. Copy the content file to a location that you can access from the directory where the TaniumKeyUtility and content-signing key files reside.

  2. Go to the directory where the TaniumKeyUtility and key files reside.

    CODE
    cd <working directory>
  3. Sign the content file.

    CODE
    ./TaniumKeyUtility signcontent <private_key> <content_file>

    The following is an example of the command:

    CODE
    ./TaniumKeyUtility signcontent import.pvk "sensors.json"
  4. Open the content file in a text editor and verify that a signature such as the following appears at the bottom:

    CODE
    <!--hash=2a8bc7529c9fcdad037982bcbfc12306aa88ac8b9d95d02248ec369008188b7c0e356ad1811609c7
    			54eb01dc97c09b9f2acb10331e2d9dbf77d309124c61950a;signature=01AF3D547A97CCBD62A022F398
    			586DEAD4E29A30C29406283DA2E8F1E9FCF176194D66D4D9602538102F8F2FBBCFBC7AF370DB44E839C04
    			7253A246447E9A146706F00E94CD26D2CF29D8916E6EE0F21C77F0E13A6769905E5DDC09458912A94BB74
    			C1311C9B26301DB8D8C73AC043EBC6A5A836FB6815011F1ACB37E0248A30F100B631-->

Verify content file signatures

Users might copy content files between systems to make the files accessible for importing. For example, after testing custom sensors in a lab environment, a user might export the sensors as a JSON file and copy it to a production environment. Before you import a file that another user digitally signed, you can verify the integrity of the file as a security measure. Signature verification ensures that the correct private key was used to sign the file and that no one modified the file after it was signed. To verify the signature of a private key, you specify its associated public key in the verification command.

Windows: Verify file signatures

  1. Copy the content file to a location that you can access from the directory where the KeyUtility and content-signing key files reside.

    The directory is either the Tanium Server installation directory (such as \Program Files\Tanium\Tanium Server) or a working directory that you set up. For more information, see Windows: Create content authentication keys.

  2. Open the Windows Command Prompt (cmd.exe) and go to the directory where the KeyUtility and key files reside.

  3. Run the following command, where <public_key> is the public key associated with the private key that you are verifying:

    CODE
    KeyUtility.exe verifycontent <public_key> <content_file>

    The following is an example of the command:

    CODE
    KeyUtility.exe verifycontent import.pub sensors.json

    If the file passes verification, the output is:

    CODE
    Signature Verified.

Linux: Verify file signatures

  1. Copy the content file to a location that you can access from the directory where the TaniumKeyUtility and content-signing key files reside.

  2. Go to the directory where the TaniumKeyUtility and key files reside.

    CODE
    cd <working directory>
  3. Run the following command, where <public_key> is the public key associated with the private key that you are verifying:

    CODE
    ./TaniumKeyUtility verifycontent <public_key> <content_file>

    The following is an example of the command:

    CODE
    ./TaniumKeyUtility verifycontent import.pub sensors.json

    If the file passes verification, the output is:

    CODE
    Signature Verified.

Copy the public key to the key store

Before you import a content file, the Tanium Server keys directory must have a copy of the public key that the Server uses to validate the signature in the file. This is the public key that is associated with the private key that you use to sign content files, not the Server root public key tanium.pub.

Windows: Copy the public key to the key store

  1. Copy the public key from the directory where you ran the key-generation command. The directory is either the Tanium Server installation directory (such as \Program Files\Tanium\Tanium Server) or a working directory that you set up. For more information, see Windows: Create content authentication keys.

  2. Paste the public key into the \Program Files\Tanium\Tanium Server\content_public_keys\content directory.