Visibility and Management of Docker Containers with the Tanium Client

If you are creating Docker container images to run containers for immutable applications, fast spin-up of additional resources to handle additional load, or for any other reason, you can include a Tanium client so that Tanium has visibility and management capability of your container.

Be aware that not all modules, and not all sensors or packages are guaranteed to work with containers. Compatibility will depend on choices you make as a container developer when creating your dockerfile configurations, and the supporting components you choose to install. Be prepared to speak to your account TAMs and account sales partners about what can be supported, and about licensing implications of clients in containers.

This short introduction assumes you are using a traditional dockerfile configuration to build your container image. This is not a tutorial on creating Docker containers, or appropriate container hardening techniques and data volume persistence; articles on these topics can be found here:

Getting started: https://docs.docker.com/get-started/Docker security: https://docs.docker.com/engine/security/security/

The examples provided here are specific to Linux distributions, but the same concept is true for Docker containers on Windows hosts. Simply use the Windows Tanium client installer, with Windows paths for installation.

Before Getting Started

Have a copy of your Tanium server’s tanium.pub pub key, and a copy of the client installer for the host operating system you are building a container on. If OEL, have a copy of the relevant TaniumClient*.oel*.rpm, if Ubuntu have taniumclient*.ubuntu*.deb, and so on based on Tanium supported operating systems.

You will also need to have the IP address(es) of your Tanium server(s). While it is possible to add BIND / DNS components to a container, in general you would probably want to install as little extra as possible. While best practice is to use a FQDN any time possible in case an IP address changes, IP addresses are guaranteed to work, even in containers with no DNS lookups available.

Putting the Tanium Client on a Docker Container Image

I find the easiest is to place the tanium.pub and the client install file in the same directory as your dockerfile and supporting files. For simplicity, I tend to copy, then rename my Tanium client installer simply to taniumclient.rpm.

Add the following lines to your dockerfile, somewhere after the initialFROM <image> and MAINTAINER”<your name and email> lines:

COPY tanium.pub /COPY taniumclient.rpm /RUN rpm -i taniumclient.rpm ; yum clean all;COPY tanium.pub /opt/Tanium/TaniumClientRUN /opt/Tanium/TaniumClient/TaniumClient config set ServerNameList 10.1.10.13,10.1.15.13;RUN systemctl enable taniumclient.service

Some people recommend adding the following lines as well, but I have never found them to be necessary, and in some cases, they may cause your container build to fail, depending on your OS distribution and service start mechanism:# these are not generally necessary! with the client installed#   it will auto start when the container is instantiated# RUN systemctl start taniumclient.service# CMD ["/usr/sbin/init"]

Note that the above lines are for RedHat based variants – RedHat, CentOS and Oracle Enterprise Linux. Given Fedora is also an rpm RedHat variant, this syntax will also work for Fedora, but bear in mind that Fedora is not a Tanium supported variant. With this added to a dockerfile configuration, provided your build is successful, your container will include a Tanium client. Replace the rpm -i with appropriate apt install or zypper install, or Windows equivalents for your chosen container host.

Remember also, that your container is using the underlying host operating system resources, so sensors that query for example Get Load Average from all machines, will return the load average for the host server, from all containers on that server. Remember also when instantiating your containers to start them with a meaningful host and container name, using the -h and --name parameters in the docker run command.

Troubleshooting the Container Client Connection to the Tanium Server

For debugging dockerfile and Tanium client problems, (Linux example only provided), you should be able to instantiate your docker container from the image, then attach to it with e.g. docker attach <container ID>  or  docker exec -it <container ID> /bin/bash

At a bash prompt inside your container, check to see if you can ping or connect to your Tanium server, or Tanium zone server if your container is in a restricted network segment such as a DMZ. Change to /opt/Tanium/TaniumClient/TaniumClient (inside your container) just as with a normal client, look at the logs, and if necessary change the log verbosity. Depending on the end point you are using and how you created the Docker image, you might not be able to increase the log verbosity and restart the client. You might need to do this by increasing log verbosity in the dockerfile and building a new image.

After the line:RUN /opt/Tanium/TaniumClient/TaniumClient config set ServerNameList 10.1.10.13,10.1.15.13;Add a new line:RUN /opt/Tanium/TaniumClient/TaniumClient config set LogVerbosityLevel 1;

For further information on Tanium and Docker containerization, feel free to reach out to your TAM.