Skip to main content

Trend Micro Hybrid Cloud Security Command Line Interface (thus)

The Deep Security API enables you to automate operational tasks, thereby increasing the productivity of your value streams and improving the security services that you support. Trend Micro Hybrid Cloud Security Command Line Interface is a consistent interface that provides support for automating your tasks using the Deep Security API. This tool is particularly useful to leverage the Deep Security API without the need for a deep dive into Python or APIs. All replies from the server are in JSON. Therefore jq is a good companion program to pipe the output to. For most distributions, you can install jq with yum install jq or apt-get install jq.

Install the Trend Micro Hybrid Cloud Security Command Line Interface

Generically the install steps are:

  1. Ensure you have Python 3.6.x or greater installed
  2. In the terminal of your choice, enter the following command:
  3. To install for your user: pip3 install --user tm-thus
  4. To install globally (use this for Windows): sudo pip3 install tm-thus
  5. If you're using a virtual environment, set that up first then enter: pip3 install tm-thus

Some specific operating system instruction can be found here

Enable command completion

The Trend Micro Hybrid Cloud Security Command Line Interface package includes a very useful command completion feature. To enable tab completion under bash, enter the following depending on how you installed thus:

If you installed with --user run: source ~/.local/bin/thus_completer_bash.sh

If you installed thus globally run: source /usr/bin/thus_completer_bash.sh

To enable this on every login, add the command to your ~/.bashrc file.

Integrate

Before using the CLI tool, you need to provide the credentials and hostnames of your service.

Guided configuration

You can configure thus by using the command

thus --config

Which will ask a sequence of questions, then write out the configuration files for you.

Manual configuration

If you choose to not use the guided method, you will need to create the .thus dir and configuration files credentials and config.

  1. Create a credentials file: ~/.thus/credentials

  2. Enter the following in the file:

    [default] DSMapikey =

For DSMapikey, create an API key in the Deep Security Manager by going to Administration > User Management > API Keys > New. Fill in the necessary fields and copy the API key to your clipboard, then paste it next to DSMapikey. For example:

[default]
DSMapikey = E5D08256-1998-21F4-D38B-685ABF6B7CDB:523C4B26-7BD5-D537-9495-1AB2373305DA:OKdUZZIM1ZBVXS
  1. Save and close the credentials file.

  2. Create a configuration file: ~/.thus/config

  3. Enter the following in the file:

    [default] DSMhost = DSMverifyssl = False

For DSMhost, enter your host URL with the correct port and /api attached at the end. If your Deep Security Manager has a self-signed cert, user DSMverifySSL=False. If you're using DSaaS or have a valid cert on your Deep Security Manager, use DSMVerifySSL=True For example:

[default]
DSMhost = https://mydsm.example.com:4119/api
DSMverifyssl = False
  1. Save and close the configuration file. You can create multiple different configurations to best suit your needs. Simply follow the steps above, but in the credentials and configuration files, change default to the name of your choice. Ensure the name matches exactly in both files.

Get started

To use the Trend Micro Hybrid Cloud Security Command Line Interface, enter thus deepsecurity, and press the tab key twice. A list of available options should appear. Once you choose an option, you can continue to use tab completion until you've selected the API object you desire.

If you'd like to check what a particular object does, look it up in the API Reference. To get started, try entering thus deepsecurity computers listcomputers for a list of computers from Deep Security or thus deepsecurity policies listPolicies for a list of polices from Deep Security. Note that if the response from the server is [] this means the call to the server was successful, the result was an array with no elements in it.

Upgrade

To upgrade to the latest version of the Trend Micro Hybrid Cloud Security Command Line Interface, enter the following into your command line: pip3 install --upgrade thus.

Troubleshoot

If you run into any issues setting up or using your Trend Micro Hybrid Cloud Security Command Line Interface, log them as bugs or feature requests in GitHub issues.

More Resources

Release files for tm-thus 0.0.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tm-thus 0.0.19
File Size Uploaded
tm-thus-0.0.19.tar.gz 14.1 kB Details

Release files / tm-thus-0.0.19.tar.gz

Download URL tm-thus-0.0.19.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9d0a2908980c696cad127663d1e04e33c50caf667ca462b0eb312dfc6445936f
BLAKE2b-256 checksum
How to use checksums
f7bf55ff0e4e25eea4e85dfb245d5543ee8ca9881aa6314cd56326fdb3fb4633
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.0.19 This release

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page