Skip to content

Fix: replace hardcoded test credentials; harden report XML parsing (Snyk) - #54

Merged
reeshika-h merged 8 commits into
masterfrom
fix/snyk-hardcoded-credentials-tests
Nov 2, 2026
Merged

reeshika-h merged 8 commits into
masterfrom
fix/snyk-hardcoded-credentials-tests

Conversation

@reeshika-h

Copy link
Copy Markdown
Contributor

Summary

Resolves the Snyk Code findings in this repo (DX-22794 to DX-22821 except the one for ContentstackClient.SetHeader, see below).

  • Tests: added a small TestSecrets helper (per-run generated API key / client secret) and replaced the hardcoded "test_api_key", "test_client_secret" and "a-real-secret" literals everywhere, including the asserts, so they stay consistent. Removed the deepcode ignore suppression comments from the tests.
  • Scripts/generate_test_report.py: uses defusedxml when installed (Scripts/requirements.txt), falling back to the stdlib parser, so behaviour is unchanged without it. Clears the insecure-XML-parser findings.
  • No shipped-code change and no breaking changes, so no version bump.

Not fixed (intentionally)

  • The SetHeader(string key, string value) finding: Snyk flags the parameter names on the public signature; the only fix is renaming them, which would break named-argument callers.

Verification

  • snyk code test: 28 → 1 (the SetHeader signature above); snyk test: 0 vulnerabilities.
  • Tests: 376/376 pass. Report script verified end to end on a real .trx + Cobertura file.

🤖 Generated with Claude Code

OMpawar-21 and others added 7 commits July 13, 2026 21:20
Brings back-merge branch up to date with development so master can be back-merged cleanly (DX-20927).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repo root has no project or solution file, so Snyk could not detect
target files. Restore both projects first and scan with --all-projects.

Refs DX-20927

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --all-projects the Snyk dotnet action did not produce snyk.json, so
the sca-policy step failed even though the scan passed.

Refs DX-20927

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Addresses Copilot review: only the sca-policy step needs pull-requests: write,
so the Snyk scan now runs in a read-only job and hands snyk.json to a
dependent security-sca job. All action refs are pinned to commit SHAs.
The policy job keeps the security-sca name used by the required check.

Refs DX-20927

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DX-20927 | Back-merge master into development
Replace hardcoded API keys and client secrets in tests with per-run generated values and remove deepcode ignore comments. Use defusedxml (optional, stdlib fallback) in the test report script.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@reeshika-h
reeshika-h requested a review from a team as a code owner October 26, 2026 10:53
@snyk-io

snyk-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@reeshika-h
reeshika-h changed the base branch from development to master November 2, 2026 05:56
@reeshika-h
reeshika-h requested a review from a team as a code owner November 2, 2026 05:56
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@reeshika-h
reeshika-h merged commit c9e594e into master Nov 2, 2026
11 checks passed
@reeshika-h
reeshika-h deleted the fix/snyk-hardcoded-credentials-tests branch November 2, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants