Skip to content

Commit 4db84db

Browse files
add dastAlertsList
1 parent f9925f1 commit 4db84db

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/main/wrapper/CxConstants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export enum CxConstants {
3131
SUB_CMD_VALIDATE = "validate",
3232
CMD_PROJECT = "project",
3333
CMD_DAST_ENVIRONMENTS = 'dast-environments',
34+
CMD_DAST_ALERTS = 'dast-alerts',
3435
SUB_CMD_BRANCHES = "branches",
3536
CMD_SCAN = "scan",
3637
SUB_CMD_SHOW = "show",
@@ -72,6 +73,7 @@ export enum CxConstants {
7273
FORMAT_HTML_CLI = "summaryHTML",
7374
FILTER = "--filter",
7475
SCAN_ID = "--scan-id",
76+
ENVIRONMENT_ID = "--environment-id",
7577
CMD_ASCA = "asca",
7678
SOURCE_FILE = "--file-source",
7779
ASCA_UPDATE_VERSION = "--asca-latest-version",
@@ -100,6 +102,7 @@ export enum CxConstants {
100102
SCAN_CONTAINERS_REALTIME = "CxContainersRealtime",
101103
PROJECT_TYPE = "CxProject",
102104
DAST_ENVIRONMENT_TYPE = 'CxDastEnvironment',
105+
DAST_ALERT_TYPE = 'CxDastAlert',
103106
PREDICATE_TYPE = "CxPredicate",
104107
CODE_BASHING_TYPE = "CxCodeBashing",
105108
KICS_REALTIME_TYPE = "CxKicsRealTime",

src/main/wrapper/CxWrapper.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,21 @@ export class CxWrapper {
285285
return await exec.executeCommands(this.config.pathToExecutable, commands, CxConstants.DAST_ENVIRONMENT_TYPE);
286286
}
287287

288+
async dastAlertsList(environmentId: string, scanId: string, filters: string): Promise<CxCommandOutput> {
289+
const validated_filters = this.filterArguments(filters);
290+
const commands: string[] = [
291+
CxConstants.CMD_DAST_ALERTS,
292+
CxConstants.SUB_CMD_LIST,
293+
CxConstants.ENVIRONMENT_ID,
294+
environmentId,
295+
CxConstants.SCAN_ID,
296+
scanId
297+
].concat(validated_filters);
298+
commands.push(...this.initializeCommands(true));
299+
const exec = new ExecutionService();
300+
return await exec.executeCommands(this.config.pathToExecutable, commands, CxConstants.DAST_ALERT_TYPE);
301+
}
302+
288303
async projectBranches(projectId: string, filters: string): Promise<CxCommandOutput> {
289304
// Verify and add possible branch filter by name
290305
const validated_filters = this.filterArguments(CxConstants.BRANCH_NAME + filters)

0 commit comments

Comments
 (0)