From d234048d61b17c3db7a45b64e07fdf0b3cde0bbf Mon Sep 17 00:00:00 2001 From: tian-lt Date: Wed, 9 Jun 2021 17:29:04 +0800 Subject: [PATCH] fixes BinSkim problems --- .../templates/build-app-internal.yaml | 19 ++++++++++++++++++- src/CalcViewModel/CalcViewModel.vcxproj | 5 ++++- src/GraphControl/GraphControl.vcxproj | 4 ++++ src/TraceLogging/TraceLogging.vcxproj | 4 ++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/build/pipelines/templates/build-app-internal.yaml b/build/pipelines/templates/build-app-internal.yaml index 9e082815..69b5262e 100644 --- a/build/pipelines/templates/build-app-internal.yaml +++ b/build/pipelines/templates/build-app-internal.yaml @@ -42,11 +42,28 @@ jobs: treatNotIndexedAsWarning: true symbolsArtifactName: $(System.teamProject)/$(Build.BuildNumber)_$(BuildPlatform)$(BuildConfiguration) + - task: CopyFiles@2 + displayName: Copy Files for BinSkim analysis + inputs: + SourceFolder: '$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator\' + # Setting up a folder to store all the binary files that we need BinSkim to scan. + # If we put more things than we produce pdbs for and can index (such as nuget packages that ship without pdbs), binskim will fail. + # Below are ignored files + # - clrcompression.dll + Contents: | + **\* + !**\clrcompression.dll + TargetFolder: '$(Agent.BuildDirectory)\binskim' + CleanTargetFolder: true + OverWrite: true + flattenFolders: false + analyzeTarget: '$(Agent.BuildDirectory)\binskim\*' + - task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 displayName: Run BinSkim inputs: inputType: Basic - analyzeTarget: $(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator\* + analyzeTarget: '$(Agent.BuildDirectory)\binskim\*' analyzeVerbose: true analyzeHashes: true continueOnError: true diff --git a/src/CalcViewModel/CalcViewModel.vcxproj b/src/CalcViewModel/CalcViewModel.vcxproj index db99377b..842360ae 100644 --- a/src/CalcViewModel/CalcViewModel.vcxproj +++ b/src/CalcViewModel/CalcViewModel.vcxproj @@ -174,6 +174,7 @@ /bigobj /await %(AdditionalOptions) 28204;4453 stdcpp17 + Guard Console @@ -208,6 +209,7 @@ /bigobj /await %(AdditionalOptions) 28204;4453 stdcpp17 + Guard Console @@ -242,6 +244,7 @@ /bigobj /await %(AdditionalOptions) 28204;4453 stdcpp17 + Guard Console @@ -276,6 +279,7 @@ /bigobj /await %(AdditionalOptions) 28204;4453 stdcpp17 + Guard Console @@ -387,7 +391,6 @@ /DUSE_MOCK_DATA %(AdditionalOptions) - _WINRT_DLL;%(PreprocessorDefinitions) diff --git a/src/GraphControl/GraphControl.vcxproj b/src/GraphControl/GraphControl.vcxproj index 8b8c0b8b..ad77b4a0 100644 --- a/src/GraphControl/GraphControl.vcxproj +++ b/src/GraphControl/GraphControl.vcxproj @@ -162,6 +162,7 @@ 28204 stdcpp17 $(ProjectDir);$(GraphingInterfaceDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + Guard Console @@ -202,6 +203,7 @@ 28204 stdcpp17 $(ProjectDir);$(GraphingInterfaceDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + Guard Console @@ -242,6 +244,7 @@ 28204 stdcpp17 $(ProjectDir);$(GraphingInterfaceDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + Guard Console @@ -282,6 +285,7 @@ 28204 stdcpp17 $(ProjectDir);$(GraphingInterfaceDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + Guard Console diff --git a/src/TraceLogging/TraceLogging.vcxproj b/src/TraceLogging/TraceLogging.vcxproj index b167a791..e0f9b1ee 100644 --- a/src/TraceLogging/TraceLogging.vcxproj +++ b/src/TraceLogging/TraceLogging.vcxproj @@ -170,6 +170,7 @@ $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) /bigobj /await /std:c++17 /utf-8 %(AdditionalOptions) 28204 + Guard Console @@ -200,6 +201,7 @@ $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) /bigobj /await /std:c++17 /utf-8 %(AdditionalOptions) 28204 + Guard Console @@ -230,6 +232,7 @@ $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) /bigobj /await /std:c++17 /utf-8 %(AdditionalOptions) 28204 + Guard Console @@ -260,6 +263,7 @@ $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) /bigobj /await /std:c++17 /utf-8 %(AdditionalOptions) 28204 + Guard Console