<div dir="ltr"><div><div><div>Hi,<br><br></div>Not sure that this helps, but below is how I solved similar issue by generating include file inside Docker file using env variables, but this is not a good approach for sensitive data.<br></div><div><pre><span class="gmail-m_-5049828624229244701gmail-nb">echo</span> <span class="gmail-m_-5049828624229244701gmail-s2">"\</span>
<a name="m_-5049828624229244701_Dockerfile-26"></a><span class="gmail-m_-5049828624229244701gmail-s2">modparam(\"http_client\", \"httpcon\", \"apiserver=>https://</span><span class="gmail-m_-5049828624229244701gmail-nv">$apiurl</span><span class="gmail-m_-5049828624229244701gmail-s2">\"<wbr>); \</span>
<a name="m_-5049828624229244701_Dockerfile-27"></a><span class="gmail-m_-5049828624229244701gmail-s2">"</span> >> /kamailio.apiurl</pre></div>I believe you can use docker secrets, as described below, but I never used them so I can't help much:</div><div><br></div><div><a href="https://medium.com/@basi/docker-environment-variables-expanded-from-secrets-8fa70617b3bc">https://medium.com/@basi/docker-environment-variables-expanded-from-secrets-8fa70617b3bc</a><br></div><div><br></div>With kind regards,<br><div class="gmail_extra"><br clear="all"><div><div class="gmail-m_-5049828624229244701gmail_signature"><div dir="ltr">Jurijs<br></div></div></div>
<br><div class="gmail_quote">On Thu, Nov 16, 2017 at 11:34 AM, Daniel Tryba <span dir="ltr"><<a href="mailto:d.tryba@pocos.nl" target="_blank">d.tryba@pocos.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Nov 15, 2017 at 08:46:58AM +0100, Daniel-Constantin Mierla wrote:<br>
> > I???m working for a UK high street bank and our Kamailio implementation has been challenged because we???ve got database passwords held in clear in the configuration file.<br>
...<br>
<span>> > My requirement is simple, I need to be able to supply a password via means such as loading a variable from a run-once script at start up, or a module. The ideal would be to be able to read in a Docker secret :)<br>
> ><br>
</span><span>> you can define a for a token to be used inside kamailio.cfg by using -A<br>
> command line parameter. So when you start kamailio, fetch the password<br>
> from your secure system by what so ever meaning, then build the database<br>
> url based on it and run kamailio with:<br>
><br>
> kamailio - A DBURL='mysql://user:passwd@dbh<wbr>ost/kamailio' ...<br>
<br>
</span>My guess is the next problem will be the password being visible to all<br>
users querying the processlist :)<br>
<br>
Is including a file (import_file) with passwords an option? Generate the<br>
file just before startup, remove it (ofcourse in a secure way (shred the<br>
file and overwrite all freespace with a multiple patters a few dozen<br>
times (ask the auditors for the exact specifications that make them<br>
happy))) after kamailio is running.<br>
<div class="gmail-m_-5049828624229244701HOEnZb"><div class="gmail-m_-5049828624229244701h5"><br>
<br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div></div>