Use the TrendAI™ Vision One™ File Security Go SDK to scan files for malware.
The Go SDK empowers you to craft applications that seamlessly integrate with
TrendAI™ 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.
Prerequisites
Before installing the SDK, ensure you have the following:
- Go version 1.19 or later
-
TrendAI™ Vision One account associated with your region
-
Configure custom user roles with File Security permissions
Creating an API key
The File Security SDK requires a valid API key provided as a parameter to the SDK
client object.
TrendAI™ 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
- Go to .
- Click Add API Key.
- Configure the API key to use the role with the Run file scan via SDK permission.
- Verify that the API key is associated with the region you plan to use.
- Set an expiry time for the API key and make a record of it for future reference.
Installing the SDK
Procedure
- Open your Go project or create a new one.
- Add the below import statement to import the SDK into your project.
import ( "dsgithub.trendmicro.com/cloud-one-amaas/tm-v1-fs-golang-sdk/tree/main/public/examples/client" // Other imports... )
Initializing the SDK
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
TrendAI™ Vision One regions:
|
|
apikey
|
Your
TrendAI™ 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) }
