fix: stop seeding demo accounts in prod + rotate exposed ones#28
Merged
Conversation
Adds pull_request triggers so CI runs on contributor PRs. Deploy jobs are gated with github.event_name == 'push' so PRs test but never deploy. Matches new required status checks in the main branch ruleset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DbInitializer was seeding demo login accounts (customer1/2, shareholder1) into Production on every startup, and shareholder1's password was published in ChatBot.md — a public-repo reader could log in with real Shareholder-level access (full cross-branch inventory + analytics). - SeedDemoData no longer creates the demo accounts when IHostEnvironment.IsProduction(); still seeds them in Development/Testing so the existing test suite and local dev are unaffected. - RotateLegacyDemoAccountPasswords overwrites the password hash of any already-seeded copies in Production with a random, never-logged value on every Production startup, so the published passwords stop working as soon as this deploys. - Scrubbed the plaintext password from ChatBot.md's verify example. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Summary
DbInitializerwas unconditionally seeding demo login accounts (customer1,customer2,shareholder1) into Production, andshareholder1's password was published inMarkdown files/ChatBot.md— a public-repo reader could log in with real Shareholder-level access (full cross-branch inventory + business analytics).IHostEnvironment.IsProduction()— still seed normally in Development/Testing so local dev and the test suite are unaffected.ChatBot.md; documented the fix inSECURITY_POSTURE.md.Test plan
dotnet build BlueberryMart.Api— 0 warnings/errorsdotnet format BlueberryMart.Api --verify-no-changes— cleandotnet test Tests/BlueberryMart.Api.Tests— 138/138 passed (Testing env still seeds demo accounts, so existing tests are unaffected)shareholder1@blueberrymart.com/shareholder1_passwordno longer logs in🤖 Generated with Claude Code