Skip to content

Commit

Permalink
Add BinSkim to SDT tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Dec 2, 2021
1 parent a53b29e commit 848f979
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions azure-pipelines/Get-SymbolFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
The root path to recursively search for PDBs.
.PARAMETER Tests
A switch indicating to find test-related PDBs instead of product-only PDBs.
.PARAMETER ConvertToWindowsPDBs
A switch to convert and return paths to Windows PDBs instead of portable PDBs.
Ignored on non-Windows agents.
#>
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[string]$Path,
[switch]$Tests
[switch]$Tests,
[switch]$ConvertToWindowsPDBs=$true
)

$WindowsPdbSubDirName = "symstore"
Expand Down Expand Up @@ -54,7 +58,7 @@ $PDBs |% {

Write-Output $BinaryImagePath

if (-not ($IsMacOS -or $IsLinux)) {
if ($ConvertToWindowsPDBs -and -not ($IsMacOS -or $IsLinux)) {
# Convert the PDB to legacy Windows PDBs
Write-Host "Converting PDB for $_" -ForegroundColor DarkGray
$WindowsPdbDir = "$($_.Directory.FullName)\$WindowsPdbSubDirName"
Expand All @@ -65,5 +69,7 @@ $PDBs |% {
}

Write-Output "$WindowsPdbDir\$($_.BaseName).pdb"
} else {
Write-Output $_.FullName
}
}
7 changes: 7 additions & 0 deletions azure-pipelines/secure-development-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ steps:
targetArgument: $(System.DefaultWorkingDirectory)
optionsUEPATH: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml

- task: BinSkim@3
displayName: Run BinSkim
inputs:
InputType: Basic
Function: analyze
AnalyzeTarget: $(BinSkimTargets)

- task: SdtReport@2
displayName: Create Security Analysis Report
inputs:
Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines/variables/BinSkimTargets.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$Path = "$PSScriptRoot\..\..\bin"
if (Test-Path $Path) {
[string]::join(';', (& "$PSScriptRoot\..\Get-SymbolFiles.ps1" -ConvertToWindowsPDBs:$false -Path $Path))
}

0 comments on commit 848f979

Please sign in to comment.