We would like to do SecretScan as part of PRs when feature branches are merged / PRed into dev.
I was thinking to have the SecretScan pipeline yaml stored in a shared Azure DevOps Project/Repository.
Add the SecretScan pipeline in each of our projects.
And add this as required pipeline for PRs. Instead of having the YAML defining SecretScan in each and every repository.
What I am wondering is, how to check out the current repo (where PR was triggered) during the SecretScan.
The SecretScan at the moment looks like this, but when triggered - it only scans itself - and not the triggering repository.
stages:
- stage: SecretScan
displayName: Scan project for secrets
jobs:
- job: Secret_Scan
displayName: Secret Scan
pool:
vmImage: 'windows-latest'
steps:
- checkout: self
- task: UseDotNet@2
displayName: 'Use dotnet'
inputs:
version: 3.1.x
- task: UseDotNet@2
displayName: 'Use dotnet'
inputs:
version: 5.0.x
- task: UseDotNet@2
displayName: 'Use dotnet'
inputs:
version: 6.0.x
- task: MicrosoftSecurityDevOps@1
displayName: 'Microsoft Security DevOps'
inputs:
categories: 'secrets'
break: true