CI/CD and Security Scanning

GitHub Actions Workflows

The repository has eight workflows covering build, test, security scanning, and release automation.

.NET Build (.github/workflows/build.yml)

Release (.github/workflows/release.yml)

CodeQL (.github/workflows/codeql.yml)

PSScriptAnalyzer (.github/workflows/powershell.yml)

Semgrep (.github/workflows/semgrep.yml)

Gitleaks (.github/workflows/gitleaks.yml)

Dependency Review (.github/workflows/dependency-review.yml)

Trivy — SCA Full Scan (.github/workflows/osv-scanner.yml)

Trivy — Reusable Workflow (.github/workflows/trivy-reusable.yml)

Dependabot (.github/dependabot.yml)

Weekly automated PRs for:

Security Scanning Stack Summary

Layer Tool Trigger Scope
SAST (C#) CodeQL Push/PR/weekly Source code vulnerabilities
SAST (patterns) Semgrep Push/PR/weekly Vulnerable patterns, deprecated APIs
Secret scanning Gitleaks Push/PR/weekly Secrets/credentials across full git history
SAST (PS) PSScriptAnalyzer Push/PR/weekly PowerShell scripts
SCA (PR gate) Dependency Review PRs only New CVEs introduced by PR diff
SCA (full) Trivy Push + weekly All NuGet deps, multi-DB
Dependabot alerts GitHub native Always CVE alerts on current packages
Dependabot updates GitHub native Weekly PRs NuGet + GitHub Actions version bumps

Action Versioning Policy

All actions use floating major-version tags — no SHA pins. Rationale: personal/low-risk repo; SHA pins add friction without meaningful supply-chain benefit at this scale.

Action family Tag used
actions/checkout @v6
actions/setup-dotnet @v5
actions/dependency-review-action @v5
github/codeql-action/* @v4 (init/analyze/upload-sarif — all consistent)
semgrep/semgrep-action @v1
gitleaks/gitleaks-action @v3.0.0
microsoft/psscriptanalyzer-action SHA pin — repo has no tags (unmaintained since 2023-03-03)
aquasecurity/trivy-action @v0.36.0
softprops/action-gh-release @v3
Note: Removed scanners

Codacy / SonarSharp Alert Resolution (Historical)

PR #13 — 211 alerts to 0

Initial alert storm on first push of feature/secret-protection. Key fixes:

Category Fix
S1451 — File header .editorconfig suppression
S3990 / ComVisible / CLSCompliant Added Properties/AssemblyInfo.cs with explicit attributes
S2221 — Catch specific exception Replaced bare catch { } with typed catches
S1121 — Cyclomatic complexity Extracted ParseState + helper methods; CC 12 → 4
S3994 — Uri parameter Changed BuildJarUri return type to Uri

PR #14 — 170 alerts to ~147

Two-commit fix sequence addressing S4261 (async suffix), S3994 (Uri params), S134 (nesting depth), S109 (magic numbers), and naming false positives.

Remaining unfixable (~80)

Require Codacy dashboard configuration — not fixable via code:

Rule Count Reason
S1451 (copyright header) ~20 No regex pattern configured on Codacy server
S3904/S3991/S3992/S3993 (assembly attributes) ~58 Codacy processes each .cs file in isolation
S1128/S100/S1515/S4261 ~7 False positives on NuGet types and raw string literals
Warning: Key lesson

// NOSONAR only suppresses line-level rules. File-level rules (S1451, S3904) require Codacy dashboard configuration.

Security Policy (Security.md)

Community Files

File Purpose
CONTRIBUTING.md Dev setup, PR guidelines, branch naming, commit convention, CI checks
CODE_OF_CONDUCT.md Contributor Covenant v2.0 — enforcement via GitHub private reporting
Security.md Security policy, architecture overview, dependency monitoring