Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vuln check in pipeline and resolve package warnings #2691

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<Compile Include="**/*.cs" Exclude="Auth/*.cs;Correlation/*.cs;**/obj/**/*.cs" />
<!-- Don't increase below versions without significantly testing on Functions V1!
Increasing these versions increments some dependencies that have binding redirects in Functions V1. -->
<PackageReference Include="Azure.Identity" Version="1.1.1" />
<PackageReference Include="Azure.Identity" Version="1.10.2" />
Copy link
Contributor Author

@davidmrdavid davidmrdavid Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment above about not increasing versions here makes me worry this might not be a safe update ^. However the Functions V1 tests pass and so does a manual local test.

Given this, that Functions V1 is close to EOL, and that DF is not an auto-upgrading component of Functions V1 (not bundles), I'm not too worried about this change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Functions V1 is not EOL yet, let's make sure we at least smoke test this with Functions V1 to confirm whether or not it's a breaking change.

<PackageReference Include="Microsoft.Azure.WebJobs" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="1.0.2" />
Expand All @@ -67,7 +67,7 @@
<DocumentationFile>$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Azure.Identity" Version="1.5.0" />
<PackageReference Include="Azure.Identity" Version="1.10.2" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.31" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.0" />
Expand All @@ -88,7 +88,7 @@
<DefineConstants>$(DefineConstants);FUNCTIONS_V2_OR_GREATER;FUNCTIONS_V3_OR_GREATER</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Azure.Identity" Version="1.5.0" />
<PackageReference Include="Azure.Identity" Version="1.10.2" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.37" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.0" />
Expand Down
2 changes: 1 addition & 1 deletion test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.30" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="2.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
Loading