Build security checks into every step of delivery, and be able to prove that what runs in production is exactly what you built, from parts you trust.
🔍 SAST
Static analysis of your source code for bugs like SQL injection or weak crypto. Runs on every PR. Tools: CodeQL, SonarQube, .NET analyzers.
🎯 DAST
Attacks the running app from the outside, like a hacker would. Finds config and runtime issues. Tools: OWASP ZAP, Burp Suite.
📦 SCA (dependency scanning)
Known CVEs and licence problems in third-party packages, including transitive ones. Tools: NuGet Audit, Dependabot, Snyk.
🔑 Secret scanning
Keys, tokens and passwords in code and git history. Use push protection to stop them before they land. Tools: GitHub secret scanning, Gitleaks.
🏗️ IaC scanning
Misconfigured Terraform, Bicep or Kubernetes YAML: public storage, open ports, no encryption. Tools: Checkov, Trivy.
🐳 Container image scanning
CVEs in the base image and OS packages. Rebuild often on a small, patched base image. Tools: Trivy, Grype, Defender for Cloud.
.NET 10 How to implement it
| Check | Library / tool | Notes |
| SCA | built-in NuGet Audit on dotnet restore (NuGetAudit, NuGetAuditMode, NuGetAuditLevel); dotnet list package --vulnerable | Projects targeting net10.0 audit transitive packages by default (NuGetAuditMode=all). dotnet package update --vulnerable is new in the .NET 10 SDK |
| SAST | built-in .NET code analyzers (security rules CA2100, CA3xxx, CA5xxx); GitHub CodeQL (supports C#) | Many security rules are off by default: turn them on with AnalysisModeSecurity. SecurityCodeScan has had no release since 2022 |
| Dependency confusion | built-in package source mapping (nuget.config) + lock files (RestorePackagesWithLockFile) | Internal names can only come from the internal feed. CI runs dotnet restore --locked-mode |
| Signed packages | built-in dotnet nuget verify; trustedSigners in nuget.config | Only accept packages signed by authors or repositories you trust |
| SBOM | Microsoft.Sbom.DotNetTool (sbom-tool, SPDX) or CycloneDX (.NET tool, dotnet-CycloneDX) | Generate an SBOM in the pipeline and publish it with the build |
| Updates | Dependabot (NuGet ecosystem) or Renovate | Automatic PRs for vulnerable and outdated packages |
<!-- Directory.Build.props: audit everything, pin everything -->
<PropertyGroup>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode> <!-- default for net10.0 -->
<NuGetAuditLevel>moderate</NuGetAuditLevel>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<AnalysisModeSecurity>All</AnalysisModeSecurity>
</PropertyGroup>
<!-- nuget.config: Contoso.* packages may ONLY come from the internal feed -->
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="internal">
<package pattern="Contoso.*" />
</packageSource>
</packageSourceMapping>
With TreatWarningsAsErrors, the new transitive audit warnings (NU1901–NU1904) can break restores after upgrading to .NET 10. Fix the root package (dotnet nuget why) rather than suppressing the warning.
Most of what you ship is code you didn't write 📦
🔍 SAST on every PR. DAST against staging.
📦 Dependency scanning + lock files: know every package, block known CVEs.
🔑 Secret scanning with push protection.
🧾 An SBOM for every build, so "are we affected?" takes minutes.
✍️ Sign your images, and only run signed ones.
Shift left to catch it cheaply. Shift right to catch what only shows up in prod.
#DevSecOps #SupplyChainSecurity #SBOM #AppSec