[auto-fix] security: remove hardcoded database credentials from appsettings.json#14
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
- Replace plaintext SQL Server password in appsettings.json with a placeholder string that fails loudly if used accidentally - Add UserSecretsId to Beam.Server.csproj to enable .NET User Secrets for local development (dotnet user-secrets set ...) - Update .gitignore to block appsettings.Production.json and appsettings.Staging.json from being committed, preventing future credential leaks via environment-specific settings files The committed password should be treated as compromised and rotated. For local dev, supply the real connection string via user secrets: cd Beam.Server dotnet user-secrets set "ConnectionStrings:DefaultConnection" "<real-conn-string>" For production/CI, use an environment variable: ConnectionStrings__DefaultConnection=<value> Closes #13 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the #1 priority improvement from weekly improvements issue #13.
What was changed
Beam.Server/appsettings.jsonREPLACE_WITH_USER_SECRET_OR_ENV_VARplaceholderBeam.Server/Beam.Server.csproj<UserSecretsId>beam-server-dev</UserSecretsId>to enable .NET User Secrets.gitignoreappsettings.Production.jsonandappsettings.Staging.jsonto prevent future credential commitsWhy
appsettings.jsoncontained a plaintext SQL Server password committed directly to source control. Any developer with read access (or anyone who ever cloned the repo) has that credential. This is the highest-priority security issue in the codebase.The committed password must be treated as compromised and rotated immediately. This PR removes the credential from future commits but cannot remove it from git history.
To fully remediate:
git filter-repoorBFG Repo-Cleanerto remove the old credential from all past commits.Local development setup (after merging)
Review checklist
ConnectionStrings__DefaultConnectionas an environment variableCloses #13