Repository navigation
ci: run CredScan and break the build on findings - #1269
Maxim Semenov (maximsemenov80) wants to merge 2 commits into
Conversation
Add a CredScan job to the build pipeline, with Post Analysis so unsuppressed credential findings fail the build. CredScan is required of every team by the SDL static analysis requirement, and the old classic SDL pipeline that ran it for this repo has been disabled since 2023. TSA bug filing is not used; the requirement accepts a build break instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
CI status: the two failing e2e checks on this PR are not caused by this change.
Not tested: a failing CredScan case (a new unsuppressed secret). Adding this job is part of the SDL static analysis requirement (CredScan, with Post Analysis as the build break instead of TSA bug filing). |
|
Update on the DPS e2e failure: it is not caused by this PR. I re-ran
In both, the device registers successfully through DPS ( The Python E2E failure on |
|
Update: root cause of the e2e failures found. Fix PR: #1270 (draft). The With the fix from #1270 both pipelines pass on that branch (DPS e2e: 20 passed; Python E2E: all jobs green). Once #1270 merges, the e2e checks on this PR should pass after a re-run. |
There was a problem hiding this comment.
🟡 Changes recommended
The PostAnalysis@2 step uses the older CredScan input instead of GdnBreakGdnToolCredScan, leaving the intended CredScan-specific build-break policy unconfigured.
1 open issue
What changed in this PR
Adds credential scanning to the existing Azure Pipelines build to meet the SDL requirement, with build failure intended to replace automatic bug filing.
Changes:
- Adds a parallel CredScan job on
windows-2022, using the existing suppression file. - Publishes security analysis logs and adds Post Analysis for intended CredScan enforcement.
| File | Description |
|---|---|
vsts/build.yaml |
Adds the CredScan job, log publishing, and build-break configuration. |
Review effort: Balanced
PostAnalysis@2 does not have a "CredScan" input, so it was silently ignored and the step included every tool in its break filter. Set GdnBreakAllTools: false and GdnBreakGdnToolCredScan: true so only CredScan results break the build, as intended. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Why
The SDL static analysis requirement asks every team to run CredScan and to either file bugs or break the build on findings. This repo's CodeQL already runs in
vsts/build.yaml, but CredScan has not run since the classicazure-iot-sdk-python-sdlpipeline was disabled in 2023.What
Adds a
CredScanjob tovsts/build.yaml:CredScan@3with the existingcredscan_suppression.json,PublishSecurityAnalysisLogs@3, andPostAnalysis@2(CredScan only) so unsuppressed findings fail the build. TSA bug filing is not used; the requirement accepts a build break instead. The job runs onwindows-2022(CredScan is a Windows task) and in parallel with the other jobs, so it does not lengthen the pipeline.Verification
Queued
Azure.azure-iot-sdk-python(def 330) on this branch, build 166125: all jobs succeeded. CredScan scanned 390 files, found 19 credential-like records, all covered bycredscan_suppression.json, 0 unsuppressed; Post Analysis passed. I did not test a failing case.Notes