<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>just remembered that a while ago I added support for the config
      file name '-' (dash/minus char) which means kamailio reads the
      config from standard input. This can be used to direct content of
      the kamailio.cfg from a safe system. For example, if one stores
      the config file on a web server, can do:</p>
    <p>curl <a class="moz-txt-link-freetext" href="https://myserver.com/kamailio.cfg">https://myserver.com/kamailio.cfg</a> | kamailio -f -</p>
    <p>It can be a webserver asking for password.</p>
    <p>In the context of keeping it encrypted, there can be a tool that
      fetches and decrypts kamailio.cfg content and prints it to the
      standard output.</p>
    <p>Using this, not even kamailio.cfg needs to be saved on the local
      disc.</p>
    <p>On the other hand, as I said in a previous response, if an
      untrusted person gets access with root privileges, then it can
      attach to a running kamailio process with gdb and read from
      memory.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 17.11.17 08:02, Jurijs Ivolga wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOrA2UYP0K_rH4Ma1FkaDJThseJ2F14h3aVgesjSyEwh8eWeCw@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>Hi Robert,<br>
            <br>
          </div>
          I'm not security expert and I'm quite new in docker, but I
          think password in Docker container which will be in clear text
          saved somewhere should not be a problem, as far as you do not
          save this password to image or git and etc...<br>
        </div>
        <div><br>
        </div>
        <div>I think best way for you is to use docker secret and
          generate then config file for Kamailio using this docker
          secrets and then start Kamailio and for all of this you need
          to write some kind of Entrypoint script. Here is example how
          something similar do Homer Sipcapture, they set environment
          variables in docker-compose and then generate config file
          based on this, but you can use probably docker secrets instead
          of environment variables:</div>
        <div><br>
        </div>
        <div><a
            href="https://github.com/sipcapture/homer-docker/tree/master/kamailio"
            moz-do-not-send="true">https://github.com/sipcapture/homer-docker/tree/master/kamailio</a></div>
        <div><br>
        </div>
        <div>I found one more interesting link regarding docker secrets:<br>
        </div>
        <div><br>
        </div>
        <div><a
href="https://blog.mikesir87.io/2017/05/using-docker-secrets-during-development/"
            moz-do-not-send="true">https://blog.mikesir87.io/2017/05/using-docker-secrets-during-development/</a><br>
        </div>
        <div><br>
        </div>
        <div>With kind regards,<br>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">Jurijs<br>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Thu, Nov 16, 2017 at 11:58 PM,
          Robert <span dir="ltr"><<a
              href="mailto:robert@vooey.co.uk" target="_blank"
              moz-do-not-send="true">robert@vooey.co.uk</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">That’d
            presumably leave the clear text footprint I'm trying to
            avoid, albeit in a non-Kamailio file. I’ve made a start on
            an approach to read from a file, Docker secrets are
            basically just files, but the Docker platform handles them
            securely.<br>
            <br>
            Thanks - Robert...<br>
            <span class="im HOEnZb"><br>
              > On 16 Nov 2017, at 21:46, Bastian Triller <<a
                href="mailto:bastian.triller@gmail.com"
                moz-do-not-send="true">bastian.triller@gmail.com</a>>
              wrote:<br>
              ><br>
              > isn't using a group in the db URL an option? Generate
              some .cnf in<br>
              > /etc/mysql/conf.d (or where MySQL searches its
              configuration in a<br>
              > Docker container) from the secret and use the group
              in your db URL in<br>
              > kamailio.cfg.<br>
              ><br>
              > <a
href="http://www.kamailio.org/docs/modules/5.0.x/modules/db_mysql.html#idp419"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.kamailio.org/docs/<wbr>modules/5.0.x/modules/db_<wbr>mysql.html#idp419</a><br>
              > 97212<br>
              <br>
              <br>
            </span>
            <div class="HOEnZb">
              <div class="h5">______________________________<wbr>_________________<br>
                Kamailio (SER) - Users Mailing List<br>
                <a href="mailto:sr-users@lists.kamailio.org"
                  moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                <a
                  href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>