You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+124-81
Original file line number
Diff line number
Diff line change
@@ -1,66 +1,159 @@
1
-
# Trend Vision One File Security Node.js SDK User Guide
1
+
# Trend Vision One™ File Security Node.js SDK User Guide
2
2
3
-
The Trend Vision One File Security Node.js SDK empowers developers to craft applications seamlessly integrating with the cloud-based Trend Vision One anti-malware file scanning service. This ensures a thorough scan of data and artifacts within the applications, identifying potential malicious elements.
3
+
Trend Vision One™ - File Security is a scanner app for files and cloud storage. This scanner can detect all types of malicious software (malware) including trojans, ransomware, spyware, and more. Based on fragments of previously seen malware, File Security detects obfuscated or polymorphic variants of malware.
4
+
File Security can assess any file type or size for malware and display real-time results. With the latest file reputation and variant protection technologies backed by leading threat research, File Security automates malware scanning.
5
+
File Security can also scan objects across your environment in any application, whether on-premises or in the cloud.
4
6
5
-
This guide outlines the steps to establish your development environment and configure your project, laying the foundation for utilizing the File Security Node.js SDK effectively.
7
+
The Node.js software development kit (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.
8
+
Follow the steps below to set up your development environment and configure your project, laying the foundation to effectively use File Security.
6
9
7
-
## Prerequisites
10
+
## Checking prerequisites
8
11
9
-
Before installing the SDK, ensure that the following prerequisites are met:
12
+
Before installing the SDK, ensure you have the following:
10
13
11
-
-NodeJS version 16.20.1+, 18.x or above
12
-
- Trend Vision One account with a chosen region - for more information, see the [Trend Vision One account document](https://docs.trendmicro.com/en-us/enterprise/trend-micro-xdr-help/Home).
13
-
-A Trend Vision One API key - for more information, see the [Trend Vision One API key documentation](https://docs.trendmicro.com/en-us/enterprise/trend-vision-one/administrative-setti/accountspartfoundati/api-keys.aspx).
14
+
-Node.js 16.20.1+, 18.x or later
15
+
- Trend Vision One account associated with your region - for more information, see the [Trend Vision One account document](https://docs.trendmicro.com/en-us/documentation/article/trend-vision-one-accountspartfoundati).
16
+
-Custom role with File Security permissions
14
17
15
-
## Installation
18
+
When you have all the prerequisites, continue with creating an API key.
16
19
17
-
To install the SDK's NodeJS package, run the following commands in your NodeJS application folder.
20
+
## Creating an API Key
21
+
22
+
The File Security SDK requires a valid application programming interface (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. For more information, see the [Trend Vision One API key documentation](https://docs.trendmicro.com/en-us/documentation/article/trend-vision-one-api-keys).
23
+
24
+
### Procedure
25
+
26
+
- Go to Administrations > API Keys.
27
+
- Click Add API Key.
28
+
- Configure the API key to use the role with the 'Run file scan via SDK' permission.
29
+
- Verify that the API key is associated with the region you plan to use.
30
+
- Set an expiry time for the API key and make a record of it for future reference.
31
+
32
+
## Installing the SDK
33
+
34
+
To install the SDK's Node.js package, run the following commands in your Node.js application folder.
18
35
19
36
```sh
20
37
npm install file-security-sdk
21
38
```
22
39
23
-
## Authentication
40
+
## Using File Security Node.js SDK
24
41
25
-
To authenticate with the API, you need an Trend Vision One API key. Sign up for a [Trend Vision One account](https://docs.trendmicro.com/en-us/enterprise/trend-vision-one.aspx) and follow the instructions on [Manage Trend Vision One API Keys](https://docs.trendmicro.com/en-us/enterprise/trend-vision-one/administrative-setti/accountspartfoundati/api-keys.aspx) to obtain an API key.
42
+
Using File Security Node.js SDK to scan for malware involves the following basic steps:
26
43
27
-
When creating a Trend Vision One account, choose a region for the account. All of the account data, as well as the security data for the Trend Vision One security services in the account, is stored in that region. For more information, see the [Trend Vision One regions documentation](https://docs.trendmicro.com/en-us/enterprise/trend-vision-one.aspx).
44
+
1. Create an AMaaS client instance by specifying preferred Vision One region where scanning should be done and a valid API key.
45
+
2. Replace `__YOUR_OWN_VISION_ONE_API_KEY__` and `__REGION__` with your actual API key and the desired region.
46
+
3. Invoke file scan method to scan the target data.
47
+
4. Parse the JSON response returned by the scan APIs to determine whether the scanned data contains malware or not.
28
48
29
-
### Usage
49
+
### Steps
30
50
31
-
To initiate a new instance of the AmaasGrpcClient, we need to supply the AMaaSHostName and Vision One API Key.
51
+
- Supply the AMaaSHostName and API Key to initiate a new instance of the AmaasGrpcClient.
| amaasHostName | The region of your Vision One account. The region is the location where you acquire your api key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-northeast-1`, `ap-southeast-2`, `ap-southeast-1`, etc. ||
153
+
| amaasHostName | The region of your Vision One account. The region is the location where you acquire your api key. Value provided must be one of the Vision One regions, e.g. `ap-northeast-1`, `ap-south-1`, `ap-southeast-1`, `ap-southeast-2`, `eu-central-1`, `us-east-1`, etc. ||
61
154
| credent | Your own Vision One API Key. ||
62
-
| timeout | Timeout to cancel the connection to server in seconds. |180|
63
-
| enableTLS | Enable or disable TLS. TLS should always be enabled when connecting to the AMaaS server. | true |
155
+
| timeout | Timeout to cancel the connection to server in seconds. |300|
156
+
| enableTLS | Enable or disable TLS. TLS should always be enabled when connecting to the File Security service. For more information, see the 'Ensuring Secure Communication with TLS' section.| true |
64
157
65
158
**_Return_**
66
159
An AmaasGrpcClient instance
@@ -74,7 +167,7 @@ Scan a file for malware and retrieves response data from the API.
`Number of malware found in buffer: ${bufferScanResult.scanResult}`
220
-
);
221
-
} catch (error) {
222
-
// Error handling
223
-
console.error("Error occurred:", error.message);
224
-
} finally {
225
-
if (typeofscanClient!=="undefined") {
226
-
scanClient.close();
227
-
}
228
-
}
229
-
```
230
-
231
267
## Errors
232
268
233
269
The built-in JavaScript `Error` object with name "`Error`" will be thrown when error occurs.
@@ -244,3 +280,10 @@ The actual message in the following table may be vary in different environment.
244
280
| Error: Failed to open file. ENOENT: no such file or directory, stat {file_path} | The {file_path} specified in `scanFile` cannot be found. Please make sure the file exists and {file_path} specified is correct. |
245
281
| Error: Failed to open file. EACCES: permission denied, open {file_path} | There is a file access permission issue. Please make sure the SDK has read permission of the {file_path} specified in `scanFile`. |
246
282
| Error: Invalid region: {region} | The region is invalid. Please make sure a correct region is used. |
283
+
284
+
## Ensuring Secure Communication with TLS
285
+
286
+
The communication channel between the client program or SDK and the Trend Vision One™ File Security service is fortified with robust server-side TLS encryption. This ensures that all data transmitted between the client and Trend service remains thoroughly encrypted and safeguarded.
287
+
The certificate employed by server-side TLS is a publicly-signed certificate from Trend Micro Inc, issued by a trusted Certificate Authority (CA), further bolstering security measures.
288
+
289
+
The File Security SDK consistently adopts TLS as the default communication channel, prioritizing security at all times. It is strongly advised not to disable TLS in a production environment while utilizing the File Security SDK, as doing so could compromise the integrity and confidentiality of transmitted data.
0 commit comments