Skip to content

fix(security): remove default database credentials - #315

Merged
brokermr810 merged 4 commits into
mainfrom
fix/sonar-security-hardening
Oct 25, 2026
Merged

brokermr810 merged 4 commits into
mainfrom
fix/sonar-security-hardening

Conversation

@brokermr810

Copy link
Copy Markdown
Collaborator

Summary

  • remove the public PostgreSQL password fallback from all Compose stacks and fail closed when POSTGRES_PASSWORD is missing
  • add a cross-platform environment bootstrap that generates missing credentials while preserving existing deployments
  • recover legacy database credentials from .env or the running PostgreSQL container and refuse unsafe upgrades when an existing volume cannot be matched
  • constrain AI skill, runtime audit, and maintenance-script file access to approved directories
  • update English and Chinese installation documentation

Security impact

This addresses the 13 SonarQube default-password Blockers and hardens the 7 reported path-traversal flows without making the recommended one-command installation more complex.

Existing installer-based deployments keep their random password. Legacy manual deployments recover the current password rather than silently rotating it and disconnecting the existing PostgreSQL volume.

Validation

  • 13 passed, 4 skipped focused tests
  • Python compilation checks passed
  • Bash and PowerShell installer syntax checks passed
  • All supported Docker Compose combinations pass docker compose config --quiet
  • Compose fails with an actionable message when POSTGRES_PASSWORD is absent

Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
Comment thread backend_api_python/app/services/ai_skill_registry.py Fixed
Comment thread scripts/bootstrap_env.py Fixed
@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.88235% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ckend_api_python/app/services/ai_skill_registry.py 55.88% 6 Missing and 9 partials ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
@sonarqubecloud

Copy link
Copy Markdown

@brokermr810
brokermr810 merged commit d66e6f5 into main Oct 25, 2026
14 checks passed
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.

3 participants