feat(workflow-executor): optional database TLS via DATABASE_SSL#1685
Merged
Conversation
Managed databases (RDS, etc.) commonly require TLS, but the CLI only passed the
connection URI to Sequelize with no SSL option, so the executor was rejected
with "no pg_hba.conf entry ... no encryption" and crashed at startup.
Add DATABASE_SSL=true to connect over TLS using
`dialectOptions: { ssl: { require: true, rejectUnauthorized: false } }` —
encrypt without verifying the server certificate, mirroring the agent's server
setup. Defaults off, so existing non-TLS setups are unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
QA hardening of the DATABASE_SSL flag: - Parse it leniently (true/1/yes/on, case-insensitive) and throw ConfigurationError on an unrecognized value, instead of silently treating anything but "true" as disabled — same footgun we just removed for LOG_LEVEL. - Log the resolved database TLS state at startup so operators can confirm whether the connection is encrypted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
forest-bot
added a commit
that referenced
this pull request
Jun 19, 2026
# @forestadmin/workflow-executor [1.6.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/workflow-executor@1.5.1...@forestadmin/workflow-executor@1.6.0) (2026-06-19) ### Features * **workflow-executor:** optional database TLS via DATABASE_SSL ([#1685](#1685)) ([91870c7](91870c7))
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.

Problem
Managed databases (AWS RDS, etc.) commonly require TLS. The executor CLI only passed the connection URI to Sequelize with no SSL option, so against such a database the connection is rejected at startup:
→
runStore.init()(migration) throws → the process exits → the service never becomes healthy. Hit while deploying the executor as a Beanstalk service against the staging RDS (which enforces SSL).Fix
Add a
DATABASE_SSLenv var. When enabled, the database connection uses:i.e. encrypt without verifying the server certificate — the same setup the agent's server uses for staging/production RDS, and the standard approach for RDS without bundling the CA. Defaults off, so existing non-TLS deployments are unchanged.
Robust parsing (QA hardening)
DATABASE_SSLis parsed leniently —true/1/yes/on(case-insensitive) enable it,false/0/no/off/ unset disable it — and an unrecognized value throwsConfigurationErrorrather than silently disabling TLS (the same footgun we just removed forLOG_LEVEL).Observability
The resolved database TLS state is logged at startup (
databaseSslin the "Workflow executor starting" line), so operators can confirm whether the connection is encrypted.Tests
cli.test.ts— 83 passing, andcli-core.tsat 100% statements / lines / functions (all changed lines covered):DATABASE_SSLtruthy variants (true/TRUE/True/1/yes/on) → enabled.false/0/no/off/'') → disabled; unset → disabled.ConfigurationError.runCliwith SSL on →buildDatabasereceivesdatabase.dialectOptions.ssl = { require: true, rejectUnauthorized: false }; with SSL off →databasestays{ uri }.logStartupreportsdatabaseSslin database mode.Documented in the README and
--help.Known limitation (intentional)
rejectUnauthorized: falseis the only TLS mode offered — it encrypts but does not verify the server certificate (MITM exposure). This matches the agent's server setup and is the practical choice for RDS, but there is noverify-full/ custom-CA option yet. Worth a follow-up for stricter TLS policies. End-to-end TLS is verified at deploy time (no SSL-capable DB in this package's CI; the tests assert wiring).🤖 Generated with Claude Code