Skip to content

Add optional PostgreSQL TLS support across PlanDev services - #1916

Open
nikhilred2619 wants to merge 4 commits into
NASA-AMMOS:developfrom
nikhilred2619:feature/1773-postgres-tls
Open

nikhilred2619 wants to merge 4 commits into
NASA-AMMOS:developfrom
nikhilred2619:feature/1773-postgres-tls

Conversation

@nikhilred2619

Copy link
Copy Markdown

Description

Adds opt-in PostgreSQL TLS support across the Java services, action server, sequencing server, and Hasura database connections.

  • Supports disable, require, verify-ca, and verify-full.
  • Adds configurable CA certificate bundles and certificate identity verification.
  • Preserves existing database connection behavior when TLS configuration is unset.
  • Updates Docker Compose and Kubernetes deployment configuration.
  • Adds regression tests for TLS configuration and certificate validation.

Related issue

Addresses #1773.

Testing

  • 24 Java JDBC/Hikari TLS integration checks passed.
  • Focused Node.js TLS tests and TypeScript compilation passed.
  • Live PostgreSQL connections verified using TLS 1.3.
  • Invalid CA and incorrect certificate identity checks passed.
  • Full system test runs were performed against the baseline, TLS-enabled, and default configurations. Intermittent failures occurred, with two TLS-run failures passing targeted retests.
  • The final certificate identity correction was validated through focused unit tests, live connection checks, and compilation rather than another full system test run.

Gateway support and the deployment guide are provided in separate companion pull requests.

Read PLANDEV_DB_SSL_MODE and PLANDEV_DB_SSL_ROOT_CERT into the PostgresStore
records of merlin-server, scheduler-server and workspace-server, and pass them
to pgjdbc as the sslMode/sslRootCert data source properties in all five app
drivers. Nothing is set when both variables are unset, so the pgjdbc default is
unchanged. Invalid settings (unknown mode, verify-* without a root cert, missing
or malformed PEM file) fail at startup.

Refs NASA-AMMOS#1773
Map PLANDEV_DB_SSL_MODE and PLANDEV_DB_SSL_ROOT_CERT to the node-postgres ssl
option for the action-server pool, the per-action worker pool and the
sequencing-server pool. The ssl key is omitted when both variables are unset,
so the node-postgres default (including PGSSLMODE) is unchanged. verify-ca keeps
chain verification and skips only the host name check. The helper is duplicated
in each server rather than shared, as agreed on the issue.

Refs NASA-AMMOS#1773
@dandelany

Copy link
Copy Markdown
Collaborator

Thanks @nikhilred2619 - @duranb is working on some fixes to our process for running CI workflows (test/scan) on fork PRs, once that is resolved @Mythicaeda and I will be able to give this a proper review.

This branch has not been deployed

No deployments
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