Title: In docker compose you have a flat list of services and you manually weave them together with configuration.
Then in an effort to secure things you add on frontend&#x2F;backend networks to isolate containers from each other.<p><pre><code>   services:
     proxy:
       build: .&#x2F;proxy
       networks:
         - frontend   
     app:
       build: .&#x2F;app
       networks:
         - frontend
         - backend   
     db:
       image: mysql
       networks:
         - backend
      </code></pre>
You add config to share credentials between services.<p><pre><code>   services:
     app:
       build: .&#x2F;app
       environment:
         DB_PASSWORD_FILE: &#x2F;run&#x2F;secrets&#x2F;db_root_password
       secrets:
         - db_root_password
     db:
       image: mysql
       environment:
         MYSQL_ROOT_PASSWORD_FILE: &#x2F;run&#x2F;secrets&#x2F;db_root_password
       secrets:
         - db_root_password
         
   secrets:
     db_root_password:
       file: .&#x2F;secrets&#x2F;db_root_password.txt
    
    </code></pre>
Is there a way to abstract away these extra configuration steps and keep it simple yet secure by default?<p>If you would express db as a dependency&#x2F;resource of app, could you infer that you could put it in a seperate network and have the credentials automatically link?
&#x27;As a developer&#x27; I&#x27;m not really interested in the network specifics or which credentials, I just want them to talk securely and minimize any attack vectors and keep any configuration to a minimum.
With tens of apps, their databases and transversal connections, how to do you keep the configuration to a minimum?<p>Googling around I found;<p>humanitec:
https:&#x2F;&#x2F;docs.humanitec.com&#x2F;integrations&#x2F;resource-types&#x2F;mariadb
They express something as &#x27;resources&#x27;, a dependency type that can be provisioned automatically with inputs and outputs that then can be injected in the application env vars:
mysql:&#x2F;&#x2F;${externals.my-db.username}:${externals.my-db.password}@${externals.my-db.host}:${externals.my-db.port}&#x2F;${externals.my-db.name}<p>you&#x27;re limited to a limited set of drivers ofcourse and how would you express an app1 to app2 dependency?<p>juju:
https:&#x2F;&#x2F;juju.is&#x2F;<p>Each app is packaged in a charm which seems to be a yaml declaring inputs, dependencies and other meta data and optional python code that can respond to certain lifecycle hooks<p>https:&#x2F;&#x2F;discourse.charmhub.io&#x2F;t&#x2F;implementing-relations&#x2F;1051<p><pre><code>   name: my-node-app
   ...
   requires:
     database:
       interface: mongodb
   provides:
     website:
       interface: http
    </code></pre>
Things can seemingly be autowired based on what interface they provide and require?
So just make a list of apps until everything resolves?<p>Does anyone have experience with these tools or others like it?<p>How do you stop others and yourself from drowning in credentials, certificates, env vars, jvm params and k8s yaml(times every environment)
How do you do (not the configuration management) but manage an inventory of what configuration is needed to run your environment (or a subset for ci)?
Upvote: