How to Group Computers Based on Your Organization’s Needs Using Custom Tags (6/2020 update)
How to Group Computers Based on Your Organization’s Needs Using Custom Tags (6/2020 update)
Grouping together computers that have similarity is easy in Tanium. For example, all Windows computers are easily grouped together by operating system. However, many customers want to group together computers that otherwise have no apparent similarities. Tanium provides content that allows you to group these systems together (e.g. logical or organization groupings). Custom tags can be very useful, but depending on the scenario there may be other ways to solve your issue using Tanium including using computer groups.
Custom Tags Basics
Custom Tags are applied by running an Action and specifying the tags that you wish to apply to the targeted computers.
Tags can not have spaces in their name. If you would like to provide visual separation in tags, consider using underscores: DMZ_Tag and not “DMZ Tag”. “DMZ Tag” will create two tags: DMZ and Tag.
when selecting targets for Actions, it is best practice to group the computers into as big of a group as possible to run (i.e. do not click on hundreds of individual computers to run an Action that applies custom tags). You can use ad-hoc filters or the filter clause in a Question to select only one entry (e.g. Online). Example images showing the correct and incorrect way to target:
Custom Tags are removed by selecting the custom tags that you wish to remove and applying an Action to remove. The Package automatically identifies the Custom Tags to be removed from the source Question.
Please note, this content is Operating System dependent, so be sure to use Unix Packages for Unix clients. Also, if you are testing this in rapid deployment, remember that it may take 10-15 minutes for the tag information to be updated inside of Tanium Questions. You can speed this up by modifying the maximum age in the Question Builder under Advanced.
How to Use Custom Tags
In this section, we will explain the process involved in using Custom Tags: how to deploy them, how to remove en masse, how to remove individually, how they are stored, and how to troubleshoot common errors.
Deploy a Custom Tag
1. Ask a Question in Interact that will allow you to select one or more Computers to tag, for example "Get Computer Name". See best practice above about selecting targets. 2. Select the computers you wish to tag and click Deploy Action. 3. Choose the appropriate Package to tag the systems. Select "Custom Tagging - Add Tags" for Windows. Select "Custom Tagging - Non Windows" for Unix assets. 4. Enter the tag or tags that you wish to use. 5. Once the Action has completed, you can ask the question in Interact to retrieve the custom tags. Each custom tag will show up as a separate entry for better targeting of Actions. To see which computers have which tags, you can ask "Get computer name and custom tags". 6. Verify the tags have been added by asking a Question such as "Get custom tags."
use the Sensor “Custom Tags Exists” as a source for Actions. This Sensor allows you to target positively against a system to check if it has a tag or not. Example question for targeting a system that has a tag (tag1 in this case): Get Online from all machines with Custom Tag Exists[tag1,1] equals True
Remove a Custom Tag
1. Ask a Question in Interact, for example "Get custom tags." 2. Select the custom tags you wish to remove. 3. Choose the appropriate Package and deploy to remove the tags. Select "Custom Tagging - Remove Tags (Non-Windows)" for Unix assets. 4. Verify the tags have been removed by asking a Question such as "Get custom tags." Please note that depending on timing, you may have to temporarily modify the max age of the custom tags sensor.
If you deploy the remove custom tags content and receive the error "Multiple values required for required sensor parameters", this means you have targeted your Action against more than just a custom tag. To avoid this, follow the steps above to remove a single tag or one per row. If you target against a Question with multiple Sensors (e.g. Get Computer Name and Custom Tags), you will not be able to proceed because Tanium does not know which value to pass to the Remove Tags Package.
Remove a Single Custom Tag from a Single Computer
In this use case, we will walk through removing a single Custom Tag from a single computer. From this use case, other use cases may be extracted.
1. Ask for the custom tags for a specific computer, e.g. "Get custom tags for all computers with computer name containing "ABC"" 2. Select the custom tag you would like to remove. 3. Choose the appropriate Package and deploy to remove the tags. E.g. select "Custom Tagging - Remove Tags (Non-Windows)" for Unix assets. 4. Verify the tag has been removed by asking a Question such as "Get custom tags." Please note that depending on timing, you may have to temporarily modify the max age of the custom tags sensor.
Where Custom Tags Are Stored
In Windows, custom tags are stored in the Windows Registry in the Tanium Client registry. In Unix, the custom tags are stored in a text file in the Tanium Client directory.