azsk / ADOScanner-docs

Welcome to the documentation of ADO Security Scanner!
MIT License
64 stars 14 forks source link

Unable to find type [VstsTaskSdk.TerminationException]. #74

Closed pshahid1 closed 6 months ago

pshahid1 commented 1 year ago

This pipeline was working fine last year and it stopped working after we used almost after a year. 2023-06-27T17:58:43.3428652Z Querying api for resources to be scanned. This may take a while... 2023-06-27T17:58:43.4322375Z Getting project configurations... 2023-06-27T17:58:43.7144465Z Getting build configurations... 2023-06-27T17:58:44.2963382Z Getting release configurations... 2023-06-27T17:58:45.1232443Z Getting service endpoint configurations... 2023-06-27T17:58:45.3411403Z Getting agent pools configurations... 2023-06-27T17:58:45.4422973Z Getting variable group configurations... 2023-06-27T17:58:45.6192592Z Getting build configurations... 2023-06-27T17:58:47.0130284Z Getting release configurations... 2023-06-27T17:58:49.8810215Z Getting service endpoint configurations... 2023-06-27T17:58:51.6339431Z 2023-06-27T17:58:51.6343452Z The set of parameters provided would result in scanning a large number of objects (> 1000). 2023-06-27T17:58:51.6344581Z If this is not what you intended, use a parameter set that would narrow down your target set. 2023-06-27T17:58:51.6350610Z If you would still like to scan all objects, rerun this command with the '-AllowLongRunningScan' switch. 2023-06-27T17:58:51.7040978Z ##[error]Could not perform ADO Security SVTs scan. Please check if task configurations are correct. 2023-06-27T17:58:51.8249137Z ##[error]Unable to find type [VstsTaskSdk.TerminationException]. 2023-06-27T17:58:52.0069994Z ##[error]Exit code 1 returned from process: file name 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', arguments '-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if ([Console]::InputEncoding -is [Text.UTF8Encoding] -and [Console]::InputEncoding.GetPreamble().Length -ne 0) { [Console]::InputEncoding = New-Object Text.UTF8Encoding $false } if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; Import-Module -Name 'D:\a_tasks\ADOSecurityScanner_0f42e73b-1b51-41b9-8bd2-c1a864393316\1.5.7\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'SilentlyContinue' ; $DebugPreference = 'SilentlyContinue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''D:\a_tasks\ADOSecurityScanner_0f42e73b-1b51-41b9-8bd2-c1a864393316\1.5.7\ADOSecurityScannerSVTRuntime.ps1'''))"'. 2023-06-27T17:58:52.0078576Z ##[section]Finishing: ADO Security Scanner

v-dpardeshi commented 6 months ago

Apologies for the inactivity on this thread. It seems that the set of parameters you provided would result in scanning a large number of objects (> 1000), which is why this error occurred. Targeting ALL Projects in an Azure DevOps Organization in a single run can be achieved through a pipeline using ExtendedCommand. You just need to add the following variables to your pipeline and start scanning:

Go to the pipeline and click on edit → Click on Variables and add ExtendedCommand with the value -AllowLongRunningScan. image