Skip to content

Reword SqlLegacyRepro placeholder connection string; add secrets instructions#4475

Open
paulmedynski wants to merge 2 commits into
mainfrom
dev/paul/remove-secrets
Open

Reword SqlLegacyRepro placeholder connection string; add secrets instructions#4475
paulmedynski wants to merge 2 commits into
mainfrom
dev/paul/remove-secrets

Conversation

@paulmedynski

@paulmedynski paulmedynski commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related changes to stop a placeholder connection string from tripping secret scanning, and to document placeholder conventions going forward.

  1. tools/SniCloseLegacyRepro/SniCloseLegacyRepro.csproj — Reworded the SNICLOSE_CONNSTR example in the header comment from Server=...;User ID=...;Password=... to angle-bracket placeholders Server=<server>;User ID=<user>;Password=<pwd>. The literal Password=... (ellipsis value) was matched by the SEC101/037 SqlLegacyCredentials push-protection rule as a credential. The new form matches the style already used in the sibling README.md, which the scanner ignores.

  2. .github/instructions/secrets.instructions.md (new) — Documents:

    • Golden rules for handling secrets in a repo that mirrors to public GitHub.
    • Approved placeholder formats (<pwd>, <myPassword>, ********, ${VAR}, <Secret>) with full connection-string examples.
    • Disallowed styles — notably the Password=... ellipsis that trips SEC101/037, realistic fake secrets, and bare-word secrets.
    • Preferred runtime patterns (env vars, SqlCredential/SecureString, integrated auth, CI secret variables).
    • A playbook for when a push is blocked by secret scanning, including handling of already-public/mirrored commits.

Notes

  • This is a documentation/tooling-comment change only; no product code or public API is affected.
  • The reword prevents recurrence in future files/commits but does not retroactively alter historical commits.

…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.
Copilot AI review requested due to automatic review settings July 24, 2026 10:50
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jul 24, 2026
@paulmedynski
paulmedynski marked this pull request as ready for review July 24, 2026 10:51
@paulmedynski
paulmedynski requested a review from a team July 24, 2026 10:51
@paulmedynski paulmedynski moved this from To triage to In review in SqlClient Board Jul 24, 2026
@paulmedynski paulmedynski added this to the 7.1.0-preview3 milestone Jul 24, 2026
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Jul 24, 2026
@paulmedynski
paulmedynski enabled auto-merge (squash) July 24, 2026 10:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_CONNSTR placeholder example in the SNI close legacy repro project to use angle-bracket placeholders instead of ellipses.
  • Added a new .github/instructions/secrets.instructions.md guide 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 same SEC101/037 SqlLegacyCredentials secret-scanning rule. Consider describing it without including the exact Password=... string.
   - *False positive* (a placeholder like `Password=...`): reword to an approved
     placeholder (`Password=<pwd>`) so future commits don't recur.

Comment thread .github/instructions/secrets.instructions.md Outdated
Comment thread .github/instructions/secrets.instructions.md Outdated
 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Id while other examples in this doc use User ID. Consider using User ID consistently to avoid readers copying mixed forms.
Server=tcp:<servername>.database.windows.net;Database=<dbname>;Authentication=Active Directory Service Principal;User Id=<AppId>;Password=<Secret>

Comment thread .github/instructions/secrets.instructions.md
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.70%. Comparing base (d040700) to head (12c3de7).
⚠️ Report is 3 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (d040700) and HEAD (12c3de7). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (d040700) HEAD (12c3de7)
CI-SqlClient 1 0
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     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 62.70% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants