@@ -127,28 +127,39 @@ export class CxWrapper {
127127 return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_TYPE ) ;
128128 }
129129
130- async scanAsca ( sourceFile : string , updateVersion = false , agent ?: string | null ) : Promise < CxCommandOutput > {
131- const commands : string [ ] = [ CxConstants . CMD_SCAN , CxConstants . CMD_ASCA , CxConstants . SOURCE_FILE , sourceFile ] ;
130+ async scanAsca (
131+ sourceFile : string ,
132+ updateVersion = false ,
133+ agent ?: string | null ,
134+ ignoredFilePath ?: string
135+ ) : Promise < CxCommandOutput > {
136+ const commands : string [ ] = [
137+ CxConstants . CMD_SCAN ,
138+ CxConstants . CMD_ASCA ,
139+ CxConstants . SOURCE_FILE ,
140+ sourceFile
141+ ] ;
132142
133- if ( updateVersion ) {
134- commands . push ( CxConstants . ASCA_UPDATE_VERSION ) ;
135- }
136- if ( agent ) {
137- commands . push ( CxConstants . AGENT ) ;
138- commands . push ( agent ) ;
139- }
140- else {
141- commands . push ( CxConstants . AGENT ) ;
142- // if we don't send any parameter in the flag
143- // then in the cli takes the default and this is not true
144- commands . push ( '"js-wrapper"' ) ;
145- }
143+ if ( updateVersion ) {
144+ commands . push ( CxConstants . ASCA_UPDATE_VERSION ) ;
145+ }
146146
147- commands . push ( ...this . initializeCommands ( false ) ) ;
148- const exec = new ExecutionService ( ) ;
149- return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_ASCA ) ;
147+ if ( agent ) {
148+ commands . push ( CxConstants . AGENT , agent ) ;
149+ } else {
150+ commands . push ( CxConstants . AGENT , '"js-wrapper"' ) ;
150151 }
151152
153+ if ( ignoredFilePath ) {
154+ commands . push ( CxConstants . IGNORE__FILE_PATH , ignoredFilePath ) ;
155+ }
156+
157+ commands . push ( ...this . initializeCommands ( false ) ) ;
158+
159+ const exec = new ExecutionService ( ) ;
160+ return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_ASCA ) ;
161+ }
162+
152163 async ossScanResults ( sourceFile : string , ignoredFilePath ?: string ) : Promise < CxCommandOutput > {
153164 const commands : string [ ] = [
154165 CxConstants . CMD_SCAN ,
@@ -168,20 +179,53 @@ export class CxWrapper {
168179 return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_OSS ) ;
169180}
170181
171- async containersRealtimeScanResults ( sourceFile : string ) : Promise < CxCommandOutput > {
172- const commands : string [ ] = [ CxConstants . CMD_SCAN , CxConstants . CMD_CONTAINERS_REALTIME , CxConstants . SOURCE , sourceFile ] ;
173- commands . push ( ...this . initializeCommands ( false ) ) ;
174- const exec = new ExecutionService ( ) ;
175- return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_CONTAINERS_REALTIME ) ;
182+ async containersRealtimeScanResults (
183+ sourceFile : string ,
184+ ignoredFilePath ?: string
185+ ) : Promise < CxCommandOutput > {
186+ const commands : string [ ] = [
187+ CxConstants . CMD_SCAN ,
188+ CxConstants . CMD_CONTAINERS_REALTIME ,
189+ CxConstants . SOURCE ,
190+ sourceFile
191+ ] ;
192+
193+ if ( ignoredFilePath ) {
194+ commands . push ( CxConstants . IGNORE__FILE_PATH ) ;
195+ commands . push ( ignoredFilePath ) ;
176196 }
177197
178- async iacRealtimeScanResults ( sourceFile : string , engine : string ) : Promise < CxCommandOutput > {
179- const commands : string [ ] = [ CxConstants . CMD_SCAN , CxConstants . CMD_IAC_REALTIME , CxConstants . SOURCE , sourceFile , CxConstants . ENGINE , engine ] ;
180- commands . push ( ...this . initializeCommands ( false ) ) ;
181- const exec = new ExecutionService ( ) ;
182- return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_IAC ) ;
198+ commands . push ( ...this . initializeCommands ( false ) ) ;
199+
200+ const exec = new ExecutionService ( ) ;
201+ return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_CONTAINERS_REALTIME ) ;
202+ }
203+
204+ async iacRealtimeScanResults (
205+ sourceFile : string ,
206+ engine : string ,
207+ ignoredFilePath ?: string
208+ ) : Promise < CxCommandOutput > {
209+ const commands : string [ ] = [
210+ CxConstants . CMD_SCAN ,
211+ CxConstants . CMD_IAC_REALTIME ,
212+ CxConstants . SOURCE ,
213+ sourceFile ,
214+ CxConstants . ENGINE ,
215+ engine
216+ ] ;
217+
218+ if ( ignoredFilePath ) {
219+ commands . push ( CxConstants . IGNORE__FILE_PATH ) ;
220+ commands . push ( ignoredFilePath ) ;
183221 }
184222
223+ commands . push ( ...this . initializeCommands ( false ) ) ;
224+
225+ const exec = new ExecutionService ( ) ;
226+ return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . SCAN_IAC ) ;
227+ }
228+
185229 async secretsScanResults ( sourceFile : string , ignoredFilePath ?: string ) : Promise < CxCommandOutput > {
186230 const commands : string [ ] = [
187231 CxConstants . CMD_SCAN ,
0 commit comments