Views:

Use the Trend Vision One™ File Security Node.js SDK to scan files for malware.

The Node.js SDK for Trend Vision One™ File Security empowers you to craft applications which seamlessly integrate with 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:
When you have all the prerequisites, continue with creating an API key.

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. Ensure you have already created the API key.
  2. Run the following commands in your Node.js application folder to install the Node.js package.
    npm install file-security-sdk
  3. Continue to authenticating.

Authenticating Parent topic

Procedure

  1. Supply the AMaaSHostName and API Key to initiate a new instance of the AmaasGrpcClient.
    import { AmaasGrpcClient } from "file-security-sdk";
  2. Use a fully qualified domain name (FQDN) with or without a port. Replace __REGION__ with the region of your Trend Vision One account.
    const amaasHostName = "antimalware.__REGION__.cloudone.trendmicro.com:443";
  3. Use the region. Replace __REGION__ with the region of your Trend Vision One account.
    const amaasHostName = __REGION__;
  4. Replace __YOUR_OWN_VISION_ONE_API_KEY__ with your own Trend Vision One API key.
    const key = __YOUR_OWN_VISION_ONE_API_KEY__;
  5. Create a new instance of the AmaasGrpcClient class using the key.
    const scanClient = new AmaasGrpcClient(amaasHostName, key);

What to do next

Refer to the following resources as needed: