|
1 | | -import { CxConfig } from "./CxConfig"; |
2 | | -import { CxParamType } from "./CxParamType"; |
3 | | -import { CxConstants } from "./CxConstants"; |
4 | | -import { ExecutionService } from "./ExecutionService"; |
5 | | -import { CxCommandOutput } from "./CxCommandOutput"; |
6 | | -import path = require('path'); |
7 | | -import { getLoggerWithFilePath, logger } from "./loggerConfig"; |
| 1 | +import {CxConfig} from "./CxConfig"; |
| 2 | +import {CxParamType} from "./CxParamType"; |
| 3 | +import {CxConstants} from "./CxConstants"; |
| 4 | +import {ExecutionService} from "./ExecutionService"; |
| 5 | +import {CxCommandOutput} from "./CxCommandOutput"; |
| 6 | +import {getLoggerWithFilePath, logger} from "./loggerConfig"; |
8 | 7 | import * as fs from "fs" |
9 | 8 | import * as os from "os"; |
10 | 9 | import CxBFL from "../bfl/CxBFL"; |
| 10 | +import path = require('path'); |
11 | 11 |
|
12 | 12 | type ParamTypeMap = Map<CxParamType, string>; |
13 | 13 |
|
@@ -260,6 +260,13 @@ export class CxWrapper { |
260 | 260 | return exec.executeKicsCommands(this.config.pathToExecutable, commands, CxConstants.KICS_REMEDIATION_TYPE); |
261 | 261 | } |
262 | 262 |
|
| 263 | + async scaRemediation(packageFile: string, packages:string, packageVersion:string): Promise<CxCommandOutput> { |
| 264 | + const commands: string[] = [CxConstants.CMD_UTILS, CxConstants.CMD_REMEDIATION,CxConstants.SUB_CMD_REMEDIATION_SCA,CxConstants.SCA_REMEDIATION_PACKAGE_FILE, packageFile,CxConstants.SCA_REMEDIATION_PACKAGE, packages,CxConstants.SCA_REMEDIATION_PACKAGE_VERSION,packageVersion]; |
| 265 | + commands.push(...this.initializeCommands(false)); |
| 266 | + const exec = new ExecutionService(); |
| 267 | + return exec.executeCommands(this.config.pathToExecutable, commands); |
| 268 | + } |
| 269 | + |
263 | 270 | getIndexOfBflNode(bflNodes: CxBFL[], resultNodes: any[]): number { |
264 | 271 |
|
265 | 272 | const bflNodeNotFound = -1; |
|
0 commit comments