Package: tm-thus
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. Thereforejqis a good companion program to pipe the output to. For most distributions, you can install jq withyum install jqorapt-get install jq.Install the Trend Micro Hybrid Cloud Security Command Line InterfaceGenerically the install steps are:Ensure you have Python 3.6.x or greater installedIn the terminal of your choice, enter the following command:To install for your user:pip3 install --user tm-thusTo install globally (use this for Windows):sudo pip3 install tm-thusIf you're using a virtual environment, set that up first then enter:pip3 install tm-thusSome specific operating system instruction can be foundhereEnable command completionThe 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--userrun:source ~/.local/bin/thus_completer_bash.shIf you installed thus globally run:source /usr/bin/thus_completer_bash.shTo enable this on every login, add the command to your~/.bashrcfile.IntegrateBefore using the CLI tool, you need to provide the credentials and hostnames of your service.Guided configurationYou can configure thus by using the commandthus --configWhich will ask a sequence of questions, then write out the configuration files for you.Manual configurationIf you choose to not use the guided method, you will need to create the .thus dir and configuration files credentials and config.Create a credentials file: ~/.thus/credentialsEnter 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:OKdUZZIM1ZBVXSSave and close the credentials file.Create a configuration file: ~/.thus/configEnter the following in the file:[default]
DSMhost =
DSMverifyssl = FalseFor DSMhost, enter your host URL with the correct port and/apiattached at the end. If your Deep Security Manager has a self-signed cert, userDSMverifySSL=False. If you're using DSaaS or have a valid cert on your Deep Security Manager, useDSMVerifySSL=TrueFor example:[default]
DSMhost = https://mydsm.example.com:4119/api
DSMverifyssl = FalseSave 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 startedTo use the Trend Micro Hybrid Cloud Security Command Line Interface, enterthus 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 theAPI Reference.
To get started, try enteringthus deepsecurity computers listcomputersfor a list of computers from Deep Security orthus deepsecurity policies listPoliciesfor 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.UpgradeTo 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.TroubleshootIf 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 ResourcesExampleszsh completionSmartcheckCloud Conformity