Disclaimer: worked out together with an AI assistant (Claude).
What I found
The generated sogo.conf of the sogo1 module contains the database credentials in clear text:
SOGoProfileURL = "mysql://sogo:Nethesis,1234@127.0.0.1:3306/sogo/sogo_user_profile";
OCSFolderInfoURL = "mysql://sogo:Nethesis,1234@127.0.0.1:3306/sogo/sogo_folder_info";
...
The password is a constant. It does not appear in ~/.config/state/environment, and expand-configuration does not pass it in via properties — it is baked into the shipped Jinja2 template, identical on every installation.
Why I think it is worth changing
To be clear about the actual exposure: MariaDB is not published outside the pod. The unit only exposes SOGo itself (--publish 127.0.0.1:${TCP_PORT}:20001). Reaching the database therefore requires either the sogo1 module user or root on the node — and anyone with either already has access to everything the database holds. So this is not a remotely exploitable hole, and I would not call it a vulnerability.
Where it does matter is defence in depth. An attacker who gains code execution inside the sogo-app container through an application-level flaw currently has full database access immediately, with no further step, because the credential is publicly known from the module source. A password generated at install time would cost that attacker an additional step. That is the whole argument — modest, but it is the kind of step that is cheap to add once and free thereafter.
There is also a practical side: the constant makes it awkward to paste diagnostic output. Every cat sogo.conf in a forum thread leaks a password — harmless here precisely because it is the well-known default, but it trains a bad habit.
Why it looks feasible
The mechanism already exists in the same module. sogo-app.service runs:
ExecStartPre=/usr/local/bin/runagent reveal-master-secret
So secret handling is in place — the database password is simply not routed through it. Making it a generated value would mean adding it to the module environment and referencing it from the template like the other parameters (workers_count, ldap_password, etc. are already handled that way).
As it stands, an administrator cannot practically change it: it would have to be altered in the template and inside the MariaDB container at the same time, and any template edit is lost on the next module update unless carried in a sogo.conf.local override — which then also freezes the rest of the template.
Question
Is there a reason the SOGo module keeps this as a constant while other modules generate their secrets? If it is simply historical, would a change be considered — at least for new installations, with existing ones left as they are?
Best regards,
Thorsten