Reword SqlLegacyRepro placeholder connection string; add secrets instructions#4475
Reword SqlLegacyRepro placeholder connection string; add secrets instructions#4475paulmedynski wants to merge 2 commits into
Conversation
…ructions Change the SNICLOSE_CONNSTR example in SniCloseLegacyRepro.csproj from Password=... to angle-bracket placeholders (<server>/<user>/<pwd>) so it no longer trips the SEC101/037 SqlLegacyCredentials push-protection rule. Add .github/instructions/secrets.instructions.md documenting approved placeholder formats, runtime secret-handling patterns, and how to respond when a push is blocked by secret scanning.
There was a problem hiding this comment.
Pull request overview
This PR addresses secret-scanning false positives caused by placeholder connection strings and adds repository guidance to prevent future credential/secret mishandling in docs, comments, and samples.
Changes:
- Reworded the
SNICLOSE_CONNSTRplaceholder example in the SNI close legacy repro project to use angle-bracket placeholders instead of ellipses. - Added a new
.github/instructions/secrets.instructions.mdguide documenting safe placeholder formats, runtime secret-handling patterns, and a push-protection troubleshooting playbook.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/SniCloseLegacyRepro/SniCloseLegacyRepro.csproj | Updates the example env-var connection string placeholder to avoid Password=... patterns that trigger secret scanning. |
| .github/instructions/secrets.instructions.md | Adds a secrets/credentials handling guide; currently includes some literal ellipsis patterns that may themselves retrigger secret scanning. |
Comments suppressed due to low confidence (1)
.github/instructions/secrets.instructions.md:85
- This section uses the literal
Password=...again, which can trip the sameSEC101/037 SqlLegacyCredentialssecret-scanning rule. Consider describing it without including the exactPassword=...string.
- *False positive* (a placeholder like `Password=...`): reword to an approved
placeholder (`Password=<pwd>`) so future commits don't recur.
feedback) Address Copilot review feedback: the secrets instructions doc itself contained the verbatim Password / User ID connection-string shapes that trip SEC101/037 SqlLegacyCredentials. Reworded the "Do NOT use" bullets, the false-positive note, and the scanner-rules table into prose so the doc no longer reintroduces push-protection failures, keeping the safe angle-bracket placeholder examples. Added a note explaining why verbatim disallowed examples cannot be shown.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/instructions/secrets.instructions.md:61
- Optional: This connection-string example uses
User Idwhile other examples in this doc useUser ID. Consider usingUser IDconsistently to avoid readers copying mixed forms.
Server=tcp:<servername>.database.windows.net;Database=<dbname>;Authentication=Active Directory Service Principal;User Id=<AppId>;Password=<Secret>
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4475 +/- ##
==========================================
- Coverage 70.88% 62.70% -8.18%
==========================================
Files 288 283 -5
Lines 43935 66821 +22886
==========================================
+ Hits 31142 41899 +10757
- Misses 12793 24922 +12129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Two related changes to stop a placeholder connection string from tripping secret scanning, and to document placeholder conventions going forward.
tools/SniCloseLegacyRepro/SniCloseLegacyRepro.csproj— Reworded theSNICLOSE_CONNSTRexample in the header comment fromServer=...;User ID=...;Password=...to angle-bracket placeholdersServer=<server>;User ID=<user>;Password=<pwd>. The literalPassword=...(ellipsis value) was matched by theSEC101/037 SqlLegacyCredentialspush-protection rule as a credential. The new form matches the style already used in the siblingREADME.md, which the scanner ignores..github/instructions/secrets.instructions.md(new) — Documents:<pwd>,<myPassword>,********,${VAR},<Secret>) with full connection-string examples.Password=...ellipsis that tripsSEC101/037, realistic fake secrets, and bare-word secrets.SqlCredential/SecureString, integrated auth, CI secret variables).Notes