Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import bitdefender from "../../bitdefender_gravityzone.app.mjs";

export default {
key: "bitdefender_gravityzone-get-policy-details",
name: "Get Policy Details",
description: "Retrieve details about a specific policy. [See the documentation](https://www.bitdefender.com/business/support/en/77209-135304-getpolicydetails.html)",
version: "0.0.1",
type: "action",
props: {
bitdefender,
policyId: {
propDefinition: [
bitdefender,
"policyId",
],
},
},
async run({ $ }) {
const response = await this.bitdefender.getPolicyDetails({
$,
data: {
params: {
policyId: this.policyId,
},
},
});

$.export("$summary", `Successfully retrieved details for policy ${this.policyId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import bitdefender from "../../bitdefender_gravityzone.app.mjs";

export default {
key: "bitdefender_gravityzone-get-scan-task-status",
name: "Get Scan Task Status",
description: "Get the status of a scan task. [See the documentation(https://www.bitdefender.com/business/support/en/77209-440638-gettaskstatus.html)",
version: "0.0.1",
type: "action",
props: {
bitdefender,
taskId: {
propDefinition: [
bitdefender,
"taskId",
],
},
},
async run({ $ }) {
const response = await this.bitdefender.getTaskStatus({
$,
data: {
params: {
taskId: this.taskId,
},
},
});

$.export("$summary", `Successfully retrieved status for task ${this.taskId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import bitdefender from "../../bitdefender_gravityzone.app.mjs";

export default {
key: "bitdefender_gravityzone-move-endpoint-to-group",
name: "Move Endpoint to Group",
description: "Move an endpoint to a different group. [See the documentation](https://www.bitdefender.com/business/support/en/77209-128489-moveendpoints.html)",
version: "0.0.1",
type: "action",
props: {
bitdefender,
endpointId: {
propDefinition: [
bitdefender,
"endpointId",
],
},
groupId: {
propDefinition: [
bitdefender,
"groupId",
],
},
},
async run({ $ }) {
const response = await this.bitdefender.moveEndpointToGroup({
$,
data: {
params: {
endpointIds: [
this.endpointId,
],
groupId: this.groupId,
},
},
});

$.export("$summary", `Successfully moved endpoint ${this.endpointId} to group ${this.groupId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import bitdefender from "../../bitdefender_gravityzone.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
key: "bitdefender_gravityzone-scan-endpoint",
name: "Scan Endpoint",
description: "Trigger a scan on a specific endpoint. [See the documentation](https://www.bitdefender.com/business/support/en/77209-128495-createscantask.html)",
version: "0.0.1",
type: "action",
props: {
bitdefender,
endpointId: {
propDefinition: [
bitdefender,
"endpointId",
],
},
scanType: {
type: "integer",
label: "Scan Type",
description: "Type of scan to perform",
options: [
{
label: "Quick Scan",
value: 1,
},
{
label: "Full Scan",
value: 2,
},
{
label: "Memory Scan",
value: 3,
},
{
label: "Custom Scan",
value: 4,
},
],
},
name: {
type: "string",
label: "Name",
description: "The name of the task. If the parameter is not passed, the name will be automatically generated.",
optional: true,
},
returnAllTaskIds: {
type: "boolean",
label: "Return All Task IDs",
description: "Indicates if the response will contain the IDs for all the tasks created as a result of the request",
optional: true,
},
scanDepth: {
type: "integer",
label: "Scan Depth",
description: "The scan profile",
options: [
{
label: "Aggressive",
value: 1,
},
{
label: "Normal",
value: 2,
},
{
label: "Permissivearray",
value: 3,
},
],
optional: true,
},
scanPath: {
type: "string[]",
label: "Scan Path",
description: "The list of target paths to be scanned",
optional: true,
},
},
async run({ $ }) {
if ((this.scanDepth || this.scanPath) && this.scanType !== 4) {
throw new ConfigurationError("Scan depth and path can only be used for custom scans");
}

if ((this.scanDepth && !this.scanPath) || (this.scanPath && !this.scanDepth)) {
throw new ConfigurationError("Scan depth and path must be used together");
}

const response = await this.bitdefender.scanEndpoint({
$,
data: {
params: {
targetIds: [
this.endpointId,
],
type: this.scanType,
name: this.name,
returnAllTaskIds: this.returnAllTaskIds,
customScanSettings: this.scanDepth
? {
scanDepth: this.scanDepth,
scanPath: this.scanPath,
}
: undefined,
},
},
});

$.export("$summary", `Successfully initiated ${this.scanType} scan on endpoint ${this.endpointId}`);
return response;
},
};
Loading
Loading