---
title: "Trend Micro Email Security collector"
canonical: "https://docs.devo.com/space/latest/375357441/Trend%20Micro%20Email%20Security%20collector"
format: markdown
---
> Macro (toc)

## Overview

Trend Micro Email Security screens out malicious senders and analyzes content to filter out spam. It examines sender authenticity and reputation and defends against malicious URLs.

The Trend Micro Email Security collector allows users to fetch policy event logs, allowed and blocked mail traffic, and user directory data.

## Devo collector features

| **Feature** | **Details** |
| --- | --- |
| Allow parallel downloading (`multipod`) | `not allowed` |
| Running environments | - `collector server`
- `on-premise` |
| Populated Devo events | `table` |
| Flattening preprocessing | `yes` |

## Data sources

| **Data source** | **Description** | **API endpoint** | **Collector service name** | **Devo table** | **Available from release** |
| --- | --- | --- | --- | --- | --- |
| Mail Tracking Logs | Fetch mail tracking logs for all available domains | `/api/v1/log/mailtrackinglog` | `mail_tracking_logs` | `mail.trend_micro.email_security.mail_tracking` | `v1.0.0` |
| Policy Event Logs | Fetch policy event logs for all available domains | `/api/v1/log/policyeventlog` | `policy_event_logs` | `mail.trend_micro.email_security.policy_event` | `v1.0.0` |
| Directory Users | Fetch users for all domains | `/api/v1/domains/<domain>/users` | `directory_users` | `mail.trend_micro.email_security.directory_user` | `v1.0.0` |

For more information on how the events are parsed, [visit our page](https://docs.devo.com/space/latest/356581468/mail.trend_micro).

## Minimum configuration required for basic pulling

Although this collector supports advanced configuration, the fields required to retrieve data with basic configuration are defined below.

> ℹ️ This minimum configuration refers exclusively to those specific parameters of this integration. There are more required parameters related to the generic behavior of the collector. Check setting sections for details.

| **Setting** | **Details** |
| --- | --- |
| `override_base_url` | By default, the collector will use [api.tmes.trendmicro.com](http://api.tmes.trendmicro.com). If your base URL is any other value, use this parameter to indicate the new base URL.<br>All available API base URLs can be found [in this article](https://docs.trendmicro.com/en-us/enterprise/trend-micro-email-security-rest-api-online-help/getting-started-with/understanding-the-ur.aspx). |
| `username` | The username associated with the API key. |
| `api_key` | The Trend Micro Email Security API key. See <u>[here](https://docs.trendmicro.com/en-us/enterprise/trend-micro-email-security-rest-api-online-help/getting-started-with/obtaining-the-api-ke.aspx)</u> for generation instructions. |

> ℹ️ See the **Accepted authentication methods** section to verify what settings are required based on the desired authentication method.

## Accepted authentication methods

| **Authentication method** | **API Key** | **Username** |
| --- | --- | --- |
| `api_key` | `Required` | `Required` |

## Run the collector

Once the data source is configured, you can either send us the required information if you want us to host and manage the collector for you (<u>Cloud collector</u>), or deploy and host the collector in your own machine using a Docker image (<u>On-premise collector</u>).

> Macro (rw-ui-tabs-macro)
> 
> > Macro (rw-tab)
> 
> We use a piece of software called Collector Server to host and manage all our available collectors. If you want us to host this collector for you, [get in touch with us](https://devo.my.site.com/support/login?ec=302&startURL=%2Fsupport%2Fs%2F) and we will guide you through the configuration.
> 
> > Macro (rw-tab)
> 
> This data collector can be run in any machine that has the Docker service available because it should be executed as a docker container. The following sections explain how to prepare all the required setup for having the data collector running.
> 
> ### Structure
> 
> The following directory structure should be created for being used when running the collector:
> 
> ```
> <any_directory>
> └── devo-collectors/
>     └── <product_name>/
>         ├── certs/
>         │   ├── chain.crt
>         │   ├── <your_domain>.key
>         │   └── <your_domain>.crt
>         ├── state/
>         └── config/ 
>             └── config.yaml 
> ```
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Devo credentials
> 
> In Devo, go to **Administration → Credentials → X.509 Certificates**, download the **Certificate**, **Private key** and **Chain CA** and save them in `<product_name>/certs/`. Learn more about security credentials in Devo [here](#).
> 
> ![image](media://25c45971-7729-4588-bc45-28e78bd88cb2)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>   debug: false
>   id: not_used
>   name: trend_micro_email_security
>   persistence:
>     type: filesystem
>     config:
>       directory_name: state
> outputs:
>   devo_1:
>     type: devo_platform
>     config:
>       address: <devo_address>
>       port: 443
>       type: SSL
>       chain: <chain_filename>
>       cert: <cert_filename>
>       key: <key_filename>
> 
> inputs:
>   trend_micro_email_security:
>     id: <short_unique_id>
>     enabled: true
>     override_base_url: <override_base_url_value>
>     credentials:
>       username: <username_value>
>       api_key: <api_key_value>
>     services:
>       policy_event_logs:
>         override_tag: <override_tag_value>
>         request_period_in_seconds: <request_period_in_seconds_value>
>         start_time_in_utc: <start_time_in_utc_value>
>       mail_tracking_logs:
>         override_tag: <override_tag_value>
>         request_period_in_seconds: <request_period_in_seconds_value>
>         start_time_in_utc: <start_time_in_utc_value>
>       directory_users:
>         override_tag: <override_tag_value>
> ```
> 
> Replace the placeholders with your required values following the description table below:
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | **Parameter** | **Data type** | **Type** | **Value range / format** | **Details** |
> | `devo_address` | `str` | `mandatory` | - `collector-us.devo.io `
> - `collector-eu.devo.io` | Use this parameter to identify the Devo Cloud where the events will be sent. |
> | `chain_filename` | `str` | `mandatory` | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the chain.cert file downloaded from your Devo domain. Usually this file's name is: `chain.crt`. |
> | `cert_filename` | `str` | `mandatory` | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.cert downloaded from your Devo domain. |
> | `key_filename` | `str` | `mandatory` | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.key downloaded from your Devo domain. |
> | `input_id_value` | `int` | `Mandatory` | Minimum length: 5<br>Maximum length: 15 | Use this param to give a unique id to this input service.<br>> ⚠️ This parameter is used to build the persistence address. Do not use the same value for multiple collectors. It could cause a collision. |
> | `username_value` | `str` | `mandatory` | minimum length: 1 | The username of the Trend Micro Email Security account. |
> | `api_key_value` | `str` | `mandatory` | minimum length: 1 | The API key |
> | `override_tag_value` | `str` | `optional` | Devo tag-friendly string (no special characters, spaces, etc.) For more information see <u>[Devo Tags](https://docs.devo.com/space/latest/95126204/About%20Devo%20tags)</u>. | An optional tag that allows users to override the service default tags.<br>> ℹ️ This parameter can be removed or commented. |
> | `start_time_in_utc_value` | `str` | `optional` | UTC datetime string having datetime string format `%-Y-%m-%d %H-%M-%S` (e.g., “`2000-01-01 00:00:01`”) | This configuration allows you to set a custom date as the beginning of the period to download. This allows downloading historical data (one month back for example) before downloading new events.<br>> ℹ️ This parameter should be removed if it is not used. |
> | `obfuscation_data_values` | `array<object>` | `optional` | The objects in the array look like this:<br>```
> obfuscation_data:
>   - name:
>       - credentials
>       - "*"
>     value: "**********"
> ``` | Each object represents the necessary configuration to obfuscate messages before these are sent to Devo.<br>> ℹ️ This parameter can be removed or commented. |
> 
> ### Download the Docker image
> 
> The collector should be deployed as a Docker container. Download the Docker image of the collector as a .tgz file by clicking the link in the following table:
> 
> | **Collector Docker image** | **SHA-256 hash** |
> | --- | --- |
> | [collector-trend_micro_email_security_if-docker-image-1.0.0](https://drive.google.com/file/d/1hKqSsayjrUNrJX2i49DHW5BoY0vev4Ff/view?usp=drive_link) | `5b728220e86bcc296c901def3dd716de9afefa11f63d6c23e3807fdde4cb6dd9` |
> 
> Use the following command to add the Docker image to the system:
> 
> ```
> gunzip -c <image_file>-<version>.tgz | docker load
> ```
> 
> > ⚠️ Once the Docker image is imported, it will show the real name of the Docker image (including version info). Replace `<image_file>` and `<version>` with a proper value.
> 
> The Docker image can be deployed on the following services:
> 
> #### Docker
> 
> Execute the following command on the root directory `<any_directory>/devo-collectors/<product_name>/`
> 
> ```
> docker run 
> --name collector-<product_name> 
> --volume $PWD/certs:/devo-collector/certs 
> --volume $PWD/config:/devo-collector/config 
> --volume $PWD/state:/devo-collector/state 
> --env CONFIG_FILE=config.yaml 
> --rm 
> --interactive 
> --tty 
> <image_name>:<version>
> ```
> 
> > ⚠️ Replace `<product_name>`, `<image_name>` and `<version>` with the proper values.
> 
> #### Docker Compose
> 
> The following Docker Compose file can be used to execute the Docker container. It must be created in the `<any_directory>/devo-collectors/<product_name>/` directory.
> 
> ```
> version: '3'
> services:
>   collector-<product_name>:
>     image: <image_name>:${IMAGE_VERSION:-latest}
>     container_name: collector-<product_name>
>     volumes:
>       - ./certs:/devo-collector/certs
>       - ./config:/devo-collector/config
>       - ./credentials:/devo-collector/credentials
>       - ./state:/devo-collector/state
>     environment:
>       - CONFIG_FILE=${CONFIG_FILE:-config.yaml}
> ```
> 
> To run the container using docker-compose, execute the following command from the `<any_directory>/devo-collectors/<product_name>/` directory:
> 
> ```
> IMAGE_VERSION=<version> docker-compose up -d
> ```
> 
> > ⚠️ Replace `<product_name>`, `<image_name>` and `<version>` with the proper values.

## Collector services detail

This section is intended to explain how to proceed with specific actions for services.

### Events service

<details>
<summary>Verify data collection</summary>

#### Setup output

A successful run has the following output messages for the setup module:

```
2023-06-28T22:10:09.542    INFO InputProcess::MainThread -> TMESPullerSetup(unknown,trend_micro_email_security#10000,directory_users#predefined) -> Starting thread
2023-06-28T22:10:10.292    INFO InputProcess::TMESPullerSetup(unknown,trend_micro_email_security#10000,directory_users#predefined) -> Successfully authenticated to the remote source.
2023-06-28T22:10:10.292    INFO InputProcess::TMESPullerSetup(unknown,trend_micro_email_security#10000,directory_users#predefined) -> Setup for module <TMESLogPuller> has been successfully executed
```

#### Puller output

A successful initial run has the following output messages for the puller module:

> ℹ️ Note that the `PrePull` action is executed only one time before the first run of the `Pull` action.

```
InputProcess::TMESDirectoryUsersPuller(trend_micro_email_security,10000,directory_users,predefined) -> Statistics for this pull cycle (@devo_pulling_id=1688015679009):Number of requests made: 6; Number of events received: 50069; Number of duplicated events filtered out: 0; Number of events generated and sent: 50069; Average of events per second: 6754.261.
2023-06-28T22:14:46.425    INFO InputProcess::TMESDirectoryUsersPuller(trend_micro_email_security,10000,directory_users,predefined) -> The data is up to date!
2023-06-28T22:14:46.426    INFO InputProcess::TMESDirectoryUsersPuller(trend_micro_email_security,10000,directory_users,predefined) -> Data collection completed. Elapsed time: 7.417 seconds. Waiting for 3592.583 second(s) until the next one
```

After a successful collector’s execution (that is, no error logs found), you will see the following log message:

```
INFO ThreatQuotientDataPuller(threatquotient_collector,threatquotient_data_puller#111,events#predefined) -> Statistics for this pull cycle (@devo_pulling_id=1655983326.290848): Number of requests performed: 2; Number of events received: 52; Number of duplicated events filtered out: 0; Number of events generated and sent: 52 (from 52 unflattened events); Average of events per second: 92.99414315733.
```

> ℹ️ The value `@devo_pulling_id` is injected in each event to group all events ingested by the same pull action. You can use it to get the exact events downloaded in that `Pull` action in Devo’s search window.
</details>

<details>
<summary>Restart the persistence</summary>

No persistence restart is available for this service. All users available at pull time will be fetched and sent to Devo.
</details>

<details>
<summary>Troubleshooting</summary>

This collector has different security layers that detect both an invalid configuration and abnormal operation. This table will help you detect and resolve the most common errors.

| **Error type** | **Error ID** | **Error message** | **Cause** | **Solution** |
| --- | --- | --- | --- | --- |
| `InitiVariablesError` | `1` | Invalid `start_time_in_utc: {ini_start_str}`. Must be in parseable datetime format. | The configured `start_time_in_utc_value` is not in a valid datetime format. | Update the `start_time_in_utc_value` to be in an accepted datetime format. |
| `InitiVariablesError` | `2` | Invalid `start_time_in_utc: {ini_start_str}`. Must be in the past. | The configured `start_time_in_utc_value` is a future datetime. | Update the `start_time_in_utc_value`  to be a past datetime. |
</details>

## Collector operations

This section is intended to explain how to proceed with specific operations of this collector.

<details>
<summary>Verify collector operations</summary>

### Initialization

The initialization module is in charge of setup and running the input (pulling logic) and output (delivering logic) services and validating the given configuration.

A successful run has the following output messages for the initializer module:

```
023-01-10T15:22:57.146    INFO MainProcess::MainThread -> Loading configuration using the following files: {"full_config": "config.yaml", "job_config_loc": null, "collector_config_loc": null}
2023-01-10T15:22:57.146    INFO MainProcess::MainThread -> Using the default location for "job_config_loc" file: "/etc/devo/job/job_config.json"
2023-01-10T15:22:57.147    INFO MainProcess::MainThread -> "\etc\devo\job" does not exists
2023-01-10T15:22:57.147    INFO MainProcess::MainThread -> Using the default location for "collector_config_loc" file: "/etc/devo/collector/collector_config.json"
2023-01-10T15:22:57.148    INFO MainProcess::MainThread -> "\etc\devo\collector" does not exists
2023-01-10T15:22:57.148    INFO MainProcess::MainThread -> Results of validation of config files parameters: {"config": "config.yaml", "config_validated": True, "job_config_loc": "/etc/devo/job/job_config.json", "job_config_loc_default": True, "job_config_loc_validated": False, "collector_config_loc": "/etc/devo/collector/collector_config.json", "collector_config_loc_default": True, "collector_config_loc_validated": False}
2023-01-10T15:22:57.171 WARNING MainProcess::MainThread -> [WARNING] Illegal global setting has been ignored -> multiprocessing: False
```

### Events delivery and Devo ingestion

The event delivery module is in charge of receiving the events from the internal queues where all events are injected by the pullers and delivering them using the selected compatible delivery method.

A successful run has the following output messages for the initializer module:

```
2023-01-10T15:23:00.788    INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
2023-01-10T15:23:00.789    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(standard_senders,devo_1) -> Starting thread (every 300 seconds)
2023-01-10T15:23:00.790    INFO OutputProcess::MainThread -> DevoSenderManager(standard_senders,manager,devo_1) -> Starting thread
2023-01-10T15:23:00.842    INFO OutputProcess::MainThread -> global_status: {"output_process": {"process_id": 18804, "process_status": "running", "thread_counter": 21, "thread_names": ["MainThread", "pydevd.Writer", "pydevd.Reader", "pydevd.CommandThread", "pydevd.CheckAliveThread", "DevoSender(standard_senders,devo_sender_0)", "DevoSenderManagerMonitor(standard_senders,devo_1)", "DevoSenderManager(standard_senders,manager,devo_1)", "OutputStandardConsumer(standard_senders_consumer_0)", 
```

> ℹ️ By default, these information traces will be displayed every 10 minutes.

#### Sender services

The Integrations Factory Collector SDK has 3 different senders services depending on the event type to delivery (`internal`, `standard`, and `lookup`). This collector uses the following Sender Services:

| **Sender services** | **Description** |
| --- | --- |
| `internal_senders` | In charge of delivering internal metrics to Devo such as logging traces or metrics. |
| `standard_senders` | In charge of delivering pulled events to Devo. |

#### Sender statistics

Each service displays its own performance statistics that allow checking how many events have been delivered to Devo by type:

| **Logging trace** | **Description** |
| --- | --- |
| `Number of available senders: 1` | Displays the number of concurrent senders available for the given Sender Service. |
| `sender manager internal queue size: 0` | Displays the items available in the internal sender queue. |
| `Standard - Total number of messages sent: 57, messages sent since "2023-01-10 16:09:16.116750+00:00": 0 (elapsed 0.000 seconds` | Displayes the number of events from the last time and following the given example, the following conclusions can be obtained:<br>- 44 events were sent to Devo since the collector started.
- The last checkpoint timestamp was `2023-01-10 16:09:16.116750+00:00`.
- 21 events where sent to Devo between the last UTC checkpoint and now.
- Those 21 events required `0.007 seconds` to be delivered. |
</details>

<details>
<summary>Check memory usage</summary>

To check the memory usage of this collector, look for the following log records in the collector which are displayed every 5 minutes by default, always after running the memory-free process.

- The used memory is displayed by running processes and the sum of both values will give the total used memory for the collector.
- The global pressure of the available memory is displayed in the `global` value.
- All metrics (Global, RSS, VMS) include the value before freeing and after `previous -> after freeing memory`

```
INFO InputProcess::MainThread -> [GC] global: 20.4% -> 20.4%, process: RSS(34.50MiB -> 34.08MiB), VMS(410.52MiB -> 410.02MiB)
INFO OutputProcess::MainThread -> [GC] global: 20.4% -> 20.4%, process: RSS(28.41MiB -> 28.41MiB), VMS(705.28MiB -> 705.28MiB)
```

> ℹ️ Differences between `RSS` and `VMS` memory usage:
> ℹ️ 
> ℹ️ - `RSS` is the Resident Set Size, which is the actual physical memory the process is using
> ℹ️ - `VMS` is the Virtual Memory Size which is the virtual memory that process is using
</details>

## Change log

| **Release** | **Released on** | **Release type** | **Details** | **Recommendations** |
| --- | --- | --- | --- | --- |
| `v1.0.0` | 9/6/2023 | [INITIAL RELEASE] | - | `Recommended version` |