diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5ab030524..22b77725b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,6 +30,26 @@ jobs: feedsToUse: 'config' nugetConfigPath: 'nuget.config' + - task: PowerShell@2 + displayName: 'Check for vulnerabilities' + inputs: + targetType: 'inline' + script: | + # Check for vulnerabilities. + $logFile = "output.txt" + dotnet list package --vulnerable > $logFile + + # report if vulnerabilities are found + $report = Get-Content $logFile -Raw + $hasVulnerabilities = $report | Select-String "has the following vulnerable packages" + + if ($hasVulnerabilities) + { + Write-Host "Some dependencies have known vulnerabilities!" + Write-Host "Please run `dotnet list package --vulnerable` locally to see the list of reported vulnerabilities" + exit 1 # terminate pipeline + } + - task: DotNetCoreCLI@2 inputs: command: 'build' diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index b8c080a39..8163e1109 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -49,7 +49,7 @@ - + @@ -67,7 +67,7 @@ $(AssemblyName).xml - + @@ -88,7 +88,7 @@ $(DefineConstants);FUNCTIONS_V2_OR_GREATER;FUNCTIONS_V3_OR_GREATER - + diff --git a/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj b/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj index 1d2b30732..f12265cc0 100644 --- a/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj +++ b/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj @@ -10,7 +10,7 @@ - +