Views:

Use the Trend Vision One File Security Go SDK to scan files for malware.

The Go SDK empowers you to craft applications that seamlessly integrate with Trend Vision One File Security. With this SDK you can perform a thorough scan of data and artifacts within your applications to identify potential malicious elements.
Follow the steps below to set up your development environment and configure your project, laying the foundation to effectively use File Security.

Checking prerequisites Parent topic

Before installing the SDK, ensure you have the following:

Creating an API key Parent topic

The File Security SDK requires a valid API key provided as a parameter to the SDK client object. Trend Vision One API keys are associated with different regions. Refer to the region flag below to obtain a better understanding of the valid regions associated with the API key.

Procedure

  1. Go to AdministrationsAPI Keys.
  2. Click Add API Key.
  3. Configure the API key to use the role with the Run file scan via SDK permission.
  4. Verify that the API key is associated with the region you plan to use.
  5. Set an expiry time for the API key and make a record of it for future reference.

Installing the SDK Parent topic

Procedure

  1. Open your Go project or create a new one.
  2. Add the below import statement to import the SDK into your project.
    import (
        "github.com/trendmicro/tm-v1-fs-golang-sdk/client"
        // Other imports...
    )

Initializing the SDK Parent topic

Before using the SDK to interact with File Security, you need to initialize it with your API key or token and specify the region you want to connect to. Replace YOUR_API_KEY_OR_TOKEN and YOUR_REGION with your actual API key or token and the corresponding region.

Parameters

Parameter Description
region
The region for the API key you obtained. Value provided must be one of the Trend Vision One regions:
  • ap-northeast-1
  • ap-south-1
  • ap-southeast-1
  • ap-southeast-2
  • eu-central-1
  • us-east-1
apikey
Your Trend Vision One API key

Procedure

  • Use the example below to initialize the SDK.
    apiKey := "YOUR_API_KEY_OR_TOKEN"
    region := "YOUR_REGION"
    
    client, err := client.NewClient(apiKey, region)
    if err != nil {
        // Handle initialization error
        panic(err)
    }

What to do next

Find out how to use the SDK.