-
Notifications
You must be signed in to change notification settings - Fork 175
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 Security Tasks to PR and CI Pipelines #590
Merged
Merged
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
17712a4
WIP security additions
wsugarman febcb90
Add AntiMalware
wsugarman bdfc399
Fix typo for path
wsugarman 46215ab
Fix pattern for Windows
wsugarman b22ff26
Enable security if disabled
wsugarman bdd520e
Add ARMory task
wsugarman 39fb717
Add BinSkim
wsugarman 5c0c4de
Fix BinSkim path and add CredScan
wsugarman f3bd390
Try using binskim guardian globs
wsugarman e86277e
Change BinSkim dir glob
wsugarman 10fc380
Narrow BinSkim parameters
wsugarman bd6dd4f
Use guardian glob again
wsugarman 81ddbc0
Make verbose and add v1 summaries
wsugarman beb0246
Add suppressions file
wsugarman 12e76b7
Add inspector; use preview summary
wsugarman ac55497
Temporarily run CI tasks in PR
wsugarman 03ce65c
Update summary tasks again
wsugarman fc2914e
First pass Semmle
wsugarman 0d0ba5f
Fix expression
wsugarman e8fb46e
Change neq to ne
wsugarman 513d148
Revert Semmle version
wsugarman 3d5cccb
Change Semmle commands
wsugarman 29d558f
Run required queries
wsugarman af5a56a
Add component governance
wsugarman 592e527
Upload Semmle snapshot
wsugarman 9552e29
Remove Semmle
wsugarman b2525cb
Remove parameter
wsugarman 6f10253
Merge branch 'main' into users/wsugarman/SecurityPipelineTasks
wsugarman 9ea247b
Remove extra line
wsugarman 82a9615
Expand -c argument
wsugarman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"tool": "Credential Scanner", | ||
"suppressions": [ | ||
{ | ||
"placeholder": "d8147077-d907-4551-8f40-90c6e86f3f0e", | ||
"_justification": "This is an example value and does not represent a real credential." | ||
}, | ||
{ | ||
"placeholder": "globalAdminServicePrincipal", | ||
"_justification": "Service principal for local testing." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
steps: | ||
- task: ComponentGovernanceComponentDetection@0 | ||
inputs: | ||
scanType: 'Register' | ||
verbosity: 'Verbose' | ||
alertWarningLevel: 'High' | ||
failOnAlert: true | ||
ignoreDirectories: '$(Build.SourcesDirectory)\samples\Azurite' | ||
|
||
- task: AntiMalware@4 | ||
inputs: | ||
InputType: 'Basic' | ||
ScanType: 'CustomScan' | ||
FileDirPath: '$(Build.SourcesDirectory)' | ||
EnableServices: true | ||
TreatSignatureUpdateFailureAs: 'Standard' | ||
SignatureFreshness: 'OneDay' | ||
TreatStaleSignatureAs: 'Error' | ||
|
||
- task: Armory@2 | ||
inputs: | ||
targetDirectory: '$(Build.SourcesDirectory)\samples\templates' | ||
targetFiles: 'f|*.json' | ||
excludePassesFromLog: false | ||
|
||
- task: BinSkim@4 | ||
inputs: | ||
InputType: 'Basic' | ||
Function: 'analyze' | ||
AnalyzeTargetGlob: '+:file|$(Build.SourcesDirectory)\**\bin\**\Microsoft.Health.Dicom*.dll;+:file|$(Build.SourcesDirectory)\**\bin\**\Microsoft.Health.Dicom*.exe' | ||
AnalyzeVerbose: true | ||
|
||
- task: CredScan@3 | ||
inputs: | ||
scanFolder: '$(Build.SourcesDirectory)' | ||
outputFormat: 'sarif' | ||
suppressionsFile: 'CredScanSuppressions.json' | ||
verboseOutput: true | ||
|
||
- task: SdtReport@2 | ||
inputs: | ||
GdnExportAllTools: false | ||
GdnExportGdnToolArmory: true | ||
GdnExportGdnToolBinSkim: true | ||
GdnExportGdnToolCredScan: true | ||
|
||
- task: PublishSecurityAnalysisLogs@3 | ||
inputs: | ||
ArtifactName: 'CodeAnalysisLogs' | ||
ArtifactType: 'Container' | ||
AllTools: false | ||
AntiMalware: true | ||
APIScan: false | ||
Armory: true | ||
Bandit: false | ||
BinSkim: true | ||
CodesignValidation: false | ||
CredScan: true | ||
CSRF: false | ||
ESLint: false | ||
Flawfinder: false | ||
FortifySCA: false | ||
FxCop: false | ||
ModernCop: false | ||
MSRD: false | ||
PoliCheck: false | ||
RoslynAnalyzers: false | ||
SDLNativeRules: false | ||
Semmle: false | ||
SpotBugs: false | ||
TSLint: false | ||
WebScout: false | ||
ToolLogsNotFoundAction: 'Error' | ||
|
||
- task: PostAnalysis@2 | ||
inputs: | ||
GdnBreakAllTools: false | ||
GdnBreakGdnToolArmory: true | ||
GdnBreakGdnToolBinSkim: true | ||
GdnBreakGdnToolCredScan: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,11 @@ steps: | |
inputs: | ||
command: pack | ||
configuration: '$(buildConfiguration)' | ||
packagesToPack: '**/*.csproj;!test/**/*.csproj;!**/*.UnitTests.csproj' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remove the packing of test projects, and have removed the web tests and integration tests from the |
||
packDirectory: '$(build.artifactStagingDirectory)/nupkgs' | ||
versioningScheme: byEnvVar | ||
versionEnvVar: 'nuget_version' | ||
nobuild: true | ||
zipAfterPublish: true | ||
env: | ||
nuget_version: $(nuGetVersion) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Generally, I think we should keep the full argument name in scripts like this for discoverability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense