<div dir="auto"><div dir="ltr"><div><div><div><div>My PR allowing you to use secrets to pass sensitive parameters into APBs was just merged.<br><br></div>The PR was motivated by our work on Amazon APBs, where we have highly sensitive credentials, as well as cluster-specific configuration that the user shouldn't have to deal with.<br><br></div>Our solution, at least until the OpenServiceBroker API supports secret passing between the catalog and broker, is to have a project administrator create a secret in the namespace of the broker, and update the broker configuration to associate that secret with a specific APB. <br><br>On the next catalog request to the broker, any parameters provided by that secret should be filtered from the spec, so the user will not be prompted for them. Any APB that has associated secrets will run in the namespace of the broker and with the secrets mounted. The APB base image has been updated to handle parsing those mounted secrets into a format consumable by ansible, as well as to disable ansible logging to prevent the credentials from showing up in plain text.<br><br></div>I also included a python script (scripts/create_broker_secret.<wbr>py in the ansible-service-broker project) that should make interacting with the secret changes pretty simple. It will allow you to specify a secret name, namespace of the broker, and image you'd like to associate, as well as a series of key=value pairs or yaml formatted files, and it will create the corresponding secret, update the broker configuration, and rollout a new broker if necessary.<br><br></div>As an unexpected side-benefit, I've actually found this change very useful for testing, because I was able to specify parameters in the secret and never had to enter them again. I mostly tested with the rhscl-postgresql-apb, using the following secret:<br><br><pre><code>./scripts/create_broker_<wbr>secret.py</code> test ansible-service-broker <a href="http://docker.io/fabianvf/rhscl-postgresql-apb" target="_blank">docker.io/fabianvf/rhscl-<wbr>postgresql-apb</a> postgresql_user=admin postgresql_password=changeme postgresql_version="9.5"</pre><div><div><br>It really did speed up my testing cycles a lot.<br><br></div><div>Full usage output for the script:<br></div><div>
<div id="m_-8492302708723081575gmail-readme" class="m_-8492302708723081575gmail-readme m_-8492302708723081575gmail-blob m_-8492302708723081575gmail-instapaper_body">
<article class="m_-8492302708723081575gmail-markdown-body m_-8492302708723081575entry-content"><pre><code>❯❯❯ ./scripts/create_broker_<wbr>secret.py --help
USAGE:
./scripts/create_broker_<wbr>secret.py NAME NAMESPACE IMAGE [KEY=VALUE]* [@FILE]*
NAME: the name of the secret to create/replace
NAMESPACE: the target namespace of the secret. It should be the namespace of the broker for most usecases
IMAGE: the docker image you would like to associate with the secret
KEY: a key to create inside the secret. This cannot contain an "=" sign
VALUE: the value for the KEY in the secret
FILE: a yaml loadable file containing key: value pairs. A file must begin with an "@" symbol to be loaded
EXAMPLE:
./scripts/create_broker_<wbr>secret.py mysecret ansible-service-broker <a href="http://docker.io/ansibleplaybookbundle/hello-world-apb" target="_blank">docker.io/<wbr>ansibleplaybookbundle/hello-<wbr>world-apb</a> key1=hello key2=world @additional_parameters.yml
</code></pre>
</article>
</div></div></div></div></div>