[GH-ISSUE #2706] Add DSN Configuration to management.json to unify postgre config. #5665

Open
opened 2026-08-05 01:04:29 -04:00 by saavagebueno · 2 comments
Owner

Originally created by @marcportabellaclotet-mt on GitHub (Oct 8, 2024).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/2706

I’d like to suggest a new feature for Netbird. It would be useful to add a key for handling the DSN directly in the management.json file. Currently, the engine is specified in management.json, while the DSN is set via an environment variable.

It would be great to consolidate this by allowing the DSN to be defined within management.json, like so:

"StoreConfig": {
  "Engine": "postgres",
  "DSN": "xxxx"
}

This would simplify configuration management.

Thanks for considering this!

Originally created by @marcportabellaclotet-mt on GitHub (Oct 8, 2024). Original GitHub issue: https://github.com/netbirdio/netbird/issues/2706 I’d like to suggest a new feature for Netbird. It would be useful to add a key for handling the DSN directly in the `management.json` file. Currently, the engine is specified in `management.json`, while the DSN is set via an environment variable. It would be great to consolidate this by allowing the DSN to be defined within `management.json`, like so: ```json "StoreConfig": { "Engine": "postgres", "DSN": "xxxx" } ``` This would simplify configuration management. Thanks for considering this!
saavagebueno added the feature-request label 2026-08-05 01:04:29 -04:00
Author
Owner

@PizzaLovingNerd commented on GitHub (May 27, 2026):

Closing this as this issue is stale and modern versions of NetBird use a combined config.yaml which supports configurations like

 server:
    store:
      engine: "postgres"
      dsn: "host=<PG_HOST> user=<PG_USER> password=<PG_PASSWORD> dbname=<PG_DB_NAME> port=<PG_PORT>"

Cheers!

<!-- gh-comment-id:4559965704 --> @PizzaLovingNerd commented on GitHub (May 27, 2026): Closing this as this issue is stale and modern versions of NetBird use a combined config.yaml which supports configurations like ```yaml server: store: engine: "postgres" dsn: "host=<PG_HOST> user=<PG_USER> password=<PG_PASSWORD> dbname=<PG_DB_NAME> port=<PG_PORT>" ``` Cheers!
Author
Owner

@Tarasusrus commented on GitHub (Jul 4, 2026):

Hi @marcportabellaclotet-mt,

Before discussing implementation, I want to raise a security question. The Postgres DSN embeds the username and password, and this store holds all account/user/policy data for the whole deployment. Putting it in management.json on disk means the file itself becomes a credential: anyone who gets a copy of it (via backup, log bundle, or a config shared for support/debugging) gets direct access to the database.

How do you handle secrets in your deployment today? If the DSN moves into management.json, wouldn't that make it much easier to accidentally expose database credentials through configuration backups or files shared for debugging?

<!-- gh-comment-id:4881323468 --> @Tarasusrus commented on GitHub (Jul 4, 2026): Hi @marcportabellaclotet-mt, Before discussing implementation, I want to raise a security question. The Postgres DSN embeds the username and password, and this store holds all account/user/policy data for the whole deployment. Putting it in `management.json` on disk means the file itself becomes a credential: anyone who gets a copy of it (via backup, log bundle, or a config shared for support/debugging) gets direct access to the database. How do you handle secrets in your deployment today? If the DSN moves into `management.json`, wouldn't that make it much easier to accidentally expose database credentials through configuration backups or files shared for debugging?
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#5665