Skip to content

Commit 23fc881

Browse files
committed
Merge branch 'master' into 15507-dataforseo
2 parents 9cc77e3 + cb039e0 commit 23fc881

File tree

162 files changed

+5834
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+5834
-397
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import bitdefender from "../../bitdefender_gravityzone.app.mjs";
2+
3+
export default {
4+
key: "bitdefender_gravityzone-get-policy-details",
5+
name: "Get Policy Details",
6+
description: "Retrieve details about a specific policy. [See the documentation](https://www.bitdefender.com/business/support/en/77209-135304-getpolicydetails.html)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bitdefender,
11+
policyId: {
12+
propDefinition: [
13+
bitdefender,
14+
"policyId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.bitdefender.getPolicyDetails({
20+
$,
21+
data: {
22+
params: {
23+
policyId: this.policyId,
24+
},
25+
},
26+
});
27+
28+
$.export("$summary", `Successfully retrieved details for policy ${this.policyId}`);
29+
return response;
30+
},
31+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import bitdefender from "../../bitdefender_gravityzone.app.mjs";
2+
3+
export default {
4+
key: "bitdefender_gravityzone-get-scan-task-status",
5+
name: "Get Scan Task Status",
6+
description: "Get the status of a scan task. [See the documentation(https://www.bitdefender.com/business/support/en/77209-440638-gettaskstatus.html)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bitdefender,
11+
taskId: {
12+
propDefinition: [
13+
bitdefender,
14+
"taskId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.bitdefender.getTaskStatus({
20+
$,
21+
data: {
22+
params: {
23+
taskId: this.taskId,
24+
},
25+
},
26+
});
27+
28+
$.export("$summary", `Successfully retrieved status for task ${this.taskId}`);
29+
return response;
30+
},
31+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import bitdefender from "../../bitdefender_gravityzone.app.mjs";
2+
3+
export default {
4+
key: "bitdefender_gravityzone-move-endpoint-to-group",
5+
name: "Move Endpoint to Group",
6+
description: "Move an endpoint to a different group. [See the documentation](https://www.bitdefender.com/business/support/en/77209-128489-moveendpoints.html)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bitdefender,
11+
endpointId: {
12+
propDefinition: [
13+
bitdefender,
14+
"endpointId",
15+
],
16+
},
17+
groupId: {
18+
propDefinition: [
19+
bitdefender,
20+
"groupId",
21+
],
22+
},
23+
},
24+
async run({ $ }) {
25+
const response = await this.bitdefender.moveEndpointToGroup({
26+
$,
27+
data: {
28+
params: {
29+
endpointIds: [
30+
this.endpointId,
31+
],
32+
groupId: this.groupId,
33+
},
34+
},
35+
});
36+
37+
$.export("$summary", `Successfully moved endpoint ${this.endpointId} to group ${this.groupId}`);
38+
return response;
39+
},
40+
};
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
import bitdefender from "../../bitdefender_gravityzone.app.mjs";
2+
import { ConfigurationError } from "@pipedream/platform";
3+
4+
export default {
5+
key: "bitdefender_gravityzone-scan-endpoint",
6+
name: "Scan Endpoint",
7+
description: "Trigger a scan on a specific endpoint. [See the documentation](https://www.bitdefender.com/business/support/en/77209-128495-createscantask.html)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
bitdefender,
12+
endpointId: {
13+
propDefinition: [
14+
bitdefender,
15+
"endpointId",
16+
],
17+
},
18+
scanType: {
19+
type: "integer",
20+
label: "Scan Type",
21+
description: "Type of scan to perform",
22+
options: [
23+
{
24+
label: "Quick Scan",
25+
value: 1,
26+
},
27+
{
28+
label: "Full Scan",
29+
value: 2,
30+
},
31+
{
32+
label: "Memory Scan",
33+
value: 3,
34+
},
35+
{
36+
label: "Custom Scan",
37+
value: 4,
38+
},
39+
],
40+
},
41+
name: {
42+
type: "string",
43+
label: "Name",
44+
description: "The name of the task. If the parameter is not passed, the name will be automatically generated.",
45+
optional: true,
46+
},
47+
returnAllTaskIds: {
48+
type: "boolean",
49+
label: "Return All Task IDs",
50+
description: "Indicates if the response will contain the IDs for all the tasks created as a result of the request",
51+
optional: true,
52+
},
53+
scanDepth: {
54+
type: "integer",
55+
label: "Scan Depth",
56+
description: "The scan profile",
57+
options: [
58+
{
59+
label: "Aggressive",
60+
value: 1,
61+
},
62+
{
63+
label: "Normal",
64+
value: 2,
65+
},
66+
{
67+
label: "Permissivearray",
68+
value: 3,
69+
},
70+
],
71+
optional: true,
72+
},
73+
scanPath: {
74+
type: "string[]",
75+
label: "Scan Path",
76+
description: "The list of target paths to be scanned",
77+
optional: true,
78+
},
79+
},
80+
async run({ $ }) {
81+
if ((this.scanDepth || this.scanPath) && this.scanType !== 4) {
82+
throw new ConfigurationError("Scan depth and path can only be used for custom scans");
83+
}
84+
85+
if ((this.scanDepth && !this.scanPath) || (this.scanPath && !this.scanDepth)) {
86+
throw new ConfigurationError("Scan depth and path must be used together");
87+
}
88+
89+
const response = await this.bitdefender.scanEndpoint({
90+
$,
91+
data: {
92+
params: {
93+
targetIds: [
94+
this.endpointId,
95+
],
96+
type: this.scanType,
97+
name: this.name,
98+
returnAllTaskIds: this.returnAllTaskIds,
99+
customScanSettings: this.scanDepth
100+
? {
101+
scanDepth: this.scanDepth,
102+
scanPath: this.scanPath,
103+
}
104+
: undefined,
105+
},
106+
},
107+
});
108+
109+
$.export("$summary", `Successfully initiated ${this.scanType} scan on endpoint ${this.endpointId}`);
110+
return response;
111+
},
112+
};

0 commit comments

Comments
 (0)