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

BinSkim failed. Verify the target(s) to be scanned. #45

Open
mhborg-timextender opened this issue Feb 27, 2023 · 2 comments
Open

BinSkim failed. Verify the target(s) to be scanned. #45

mhborg-timextender opened this issue Feb 27, 2023 · 2 comments

Comments

@mhborg-timextender
Copy link

mhborg-timextender commented Feb 27, 2023

We have a project that I recently tried adding the following YAML to the build pipeline:

  - task: UseDotNet@2
    displayName: 'Use dotnet'
    condition: eq(variables['Build.SourceBranchName'], '18321-add-vulnerability-scan')
    inputs:
      version: 3.1.x
  - task: UseDotNet@2
    displayName: 'Use dotnet'
    condition: eq(variables['Build.SourceBranchName'], '18321-add-vulnerability-scan')
    inputs:
      version: 6.0.x
  - task: MicrosoftSecurityDevOps@1
    displayName: 'Microsoft Security DevOps'
    condition: eq(variables['Build.SourceBranchName'], '18321-add-vulnerability-scan')
    inputs:
      tools: 'BinSkim,CredScan,ESlint'

But BinSkim fails with the following:

    D:\a\_msdo\packages\nuget\Microsoft.CodeAnalysis.BinSkim.1.9.5\tools\netcoreapp3.1\win-x64\BinSkim.exe analyze --config default --hashes --statistics --sarif-output-version OneZeroZero --output D:\a\1\s\.gdn\.r\binskim\001\binskim.sarif @D:\a\1\s\.gdn\.r\binskim\001\.gdntoolinput
    Analyzing...
    D:\a\1\s\UserPortalAPI\bin\Release\netcoreapp3.1\runtimes\win-arm64\native\sni.dll : error ERR997.ExceptionLoadingPdb : 'sni.dll' was not evaluated because its PDB could not be loaded (E_PDB_NOT_FOUND).
    D:\a\1\s\UserPortalAPI\bin\Release\netcoreapp3.1\runtimes\win-x64\native\sni.dll : error ERR997.ExceptionLoadingPdb : 'sni.dll' was not evaluated because its PDB could not be loaded (E_PDB_NOT_FOUND).
    D:\a\1\s\UserPortalAPI\bin\Release\netcoreapp3.1\runtimes\win-x86\native\sni.dll : error ERR997.ExceptionLoadingPdb : 'sni.dll' was not evaluated because its PDB could not be loaded (E_PDB_NOT_FOUND).
    
    Done. 125 files scanned.
    
    One or more rules was disabled for an analysis target, as it was determined not to be applicable to it (this is a common condition). Pass --verbose on the command-line for more information.
    
    Analysis did not complete due to one or more unrecoverable execution conditions.
    Unexpected fatal runtime condition(s) observed: ExceptionLoadingPdb
    
    Tool run time: 3.1682485 seconds
    ------------------------------------------------------------------------------
    BinSkim completed with exit code 1
##[error]Error running binskim job: 1 of 1
##[error]GuardianErrorExitCodeException: binskim completed with an Error exit code: 1. BinSkim failed. Verify the target(s) to be scanned. BinSkim targets must be a specific filename, or a pattern with a wildcard like *.dll, dir\*.dll, or dir\*
    ------------------------------------------------------------------------------

Although it doesn't fail the entire build pipeline, I am still curious why it fails.

@jmarti326
Copy link

Where you able to get an answer of this error? I am having the same problem, but don't find anything in the docs.

@mhborg-timextender
Copy link
Author

Where you able to get an answer of this error? I am having the same problem, but don't find anything in the docs.

No, currently have binskim disabled in our pipelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants