diff --git a/src/Commands/RetestScan.ts b/src/Commands/RetestScan.ts index b5a0f8db..d0ed1bdc 100644 --- a/src/Commands/RetestScan.ts +++ b/src/Commands/RetestScan.ts @@ -16,6 +16,12 @@ export class RetestScan implements CommandModule { requiresArg: true, demandOption: true }) + .option('template', { + alias: 'tp', + requiresArg: false, + string: true, + describe: 'ID of the template' + }) .positional('scan', { describe: 'ID of an existing scan which you want to re-run.', type: 'string', diff --git a/src/Scan/RestScans.ts b/src/Scan/RestScans.ts index cbd7cd1e..665c0583 100644 --- a/src/Scan/RestScans.ts +++ b/src/Scan/RestScans.ts @@ -2,6 +2,7 @@ import { Discovery, Header, ScanConfig, + ScanRetestConfig, Scans, ScanState, SourceType, @@ -52,8 +53,12 @@ export class RestScans implements Scans { return id; } - public async retest(scanId: string): Promise { + public async retest( + scanId: string, + body?: ScanRetestConfig + ): Promise { const { id }: { id: string } = await this.client.post({ + body, uri: `/api/v1/scans/${scanId}/retest` }); diff --git a/src/Scan/Scans.ts b/src/Scan/Scans.ts index 890e478d..93dc78ce 100644 --- a/src/Scan/Scans.ts +++ b/src/Scan/Scans.ts @@ -151,6 +151,10 @@ export interface ScanConfig { repeaters?: string[]; } +export interface ScanRetestConfig { + templateId?: string; +} + export enum IssueCategory { MEDIUM = 'Medium', HIGH = 'High', @@ -193,7 +197,7 @@ export interface StorageFile { export interface Scans { create(body: ScanConfig): Promise; - retest(scanId: string): Promise; + retest(scanId: string, body: ScanRetestConfig): Promise; stop(scanId: string): Promise;