Skip to content

EDFI-2813 Harden Admin App config and fix the Docker compose SQL Server path - #262

Open
analiliagutierrez wants to merge 3 commits into
mainfrom
EDFI-2813-harden-api-config-defaults
Open

EDFI-2813 Harden Admin App config and fix the Docker compose SQL Server path#262
analiliagutierrez wants to merge 3 commits into
mainfrom
EDFI-2813-harden-api-config-defaults

Conversation

@analiliagutierrez

@analiliagutierrez analiliagutierrez commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Config cleanup carried out of EDFI-2776 (its windows-install/ folder is moving to a dedicated repo) plus a small fix to the Docker Compose SQL Server path.

What Changed

  • Drop the dead management-client secret (MANAGEMENT_DOMAIN / MANAGEMENT_CLIENT_ID / MANAGEMENT_CLIENT_SECRET) from production.js-edfi, local.js-edfi, and the compose/readme.md example — unconsumed in packages/api/src, so it only shipped a default secret.
  • Default SSL_VERIFICATION to true in production.js-edfi (installer-neutral comment). It gates TLS-certificate verification on the API's outbound calls (ODS/API, Admin API, Yopass); the previous false accepted any certificate, exposing those calls to MITM off loopback. Self-signed upstreams should be trusted via NODE_EXTRA_CA_CERTS rather than by disabling verification globally. Transparent for CA-issued upstreams and the self-contained Docker stack (which mounts its own cert); against a self-signed upstream, registering an Environment now fails explicitly with a guided cert error instead of trusting it silently.
  • Fix the Compose SQL Server path (compose/): start-services.ps1 -MSSQL only switches the container profile, so a mismatched DB_ENGINE in .env had the API start against the wrong/stopped DB. The script now warns on that mismatch (no env mutation — .env stays authoritative). readme.md gains the required DB_SECRET_VALUE swap and drops the stale manual depends_on step (the compose already waits for the active engine).

Testing

Config/script/docs only — no app runtime path changes. MANAGEMENT_* verified unconsumed; SSL_VERIFICATION honored (self-signed upstream rejected on true, accepted on false); the -MSSQL guard validated across the engine-match / mismatch / no-.env cases (default PostgreSQL path unchanged).

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

Test Results

  5 files  ±0  138 suites  ±0   3m 19s ⏱️ +2s
727 tests ±0  727 ✅ ±0  0 💤 ±0  0 ❌ ±0 
801 runs  ±0  801 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 25c89c7. ± Comparison against base commit e728b5f.

♻️ This comment has been updated with latest results.

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 pull request hardens Admin App configuration defaults and cleans up unused configuration values, while fixing a Docker Compose SQL Server startup footgun where the selected Compose profile could diverge from the API’s .env DB engine configuration.

Changes:

  • Removed unused MANAGEMENT_* secrets from the sample config templates and Compose documentation.
  • Defaulted SSL_VERIFICATION to true in production.js-edfi with updated guidance.
  • Added a guard warning in compose/start-services.ps1 when -MSSQL is used but .env DB_ENGINE does not match, and updated Compose docs for SQL Server usage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/api/config/production.js-edfi Removes unused management-client secrets and enables TLS verification by default.
packages/api/config/local.js-edfi Removes unused management-client secrets from local sample config.
compose/start-services.ps1 Warns when selected Compose DB profile and .env DB_ENGINE are inconsistent.
compose/readme.md Updates SQL Server instructions (DB secret value swap, removes stale manual depends_on step) and removes unused management-client secret example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api/config/production.js-edfi
@analiliagutierrez
analiliagutierrez marked this pull request as ready for review July 28, 2026 17:08
The MANAGEMENT_DOMAIN / MANAGEMENT_CLIENT_ID / MANAGEMENT_CLIENT_SECRET fields are dead: absent from IAuth0Secret, dropped by the AWS config loader, and read by no consumer in packages/api/src. Removing them stops shipping a default secret. Split out from EDFI-2776 so it survives the windows-install repo migration.
Default SSL_VERIFICATION to true so the API validates TLS certificates on its outbound HTTPS calls (ODS/API, AdminApi, Yopass). The previous false default exposed those calls to man-in-the-middle when the API runs off the loopback. Split out from EDFI-2776 so it survives the windows-install repo migration.
Warn when start-services.ps1 -MSSQL is used but .env still selects a
different DB_ENGINE, so the API no longer starts silently against the
wrong or a stopped database. Document the required DB_SECRET_VALUE swap
for SQL Server and drop the now-stale manual depends_on edit (the compose
file already waits for whichever database profile is active).
@analiliagutierrez
analiliagutierrez force-pushed the EDFI-2813-harden-api-config-defaults branch from 596422c to 25c89c7 Compare July 28, 2026 17:48
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.

2 participants