Juju Charm - Barbican
Go to file
Ryan Beisner 88b5bd5490 Add .gitreview and clean up repo
Add src/README.md placeholder to prevent inheritence of the
lower layer readme file in the built charm.

Add src/tox.ini and test-requirements for Amulet prep.

Update metadata.yaml for series.

Update tox.ini to minimize and clarify pep8 ignores.

Resolve flake8/pbr test-requirements version range conflict.

Remove legacy lint and test targets from Makefile, ensuring
these tests will execute via tox.  Trusty test runners have
no py35 interpreter, and would have failed in running both
py34 and py35 in succession as it was defined.

Update src/layer.yaml repo value to point to official location
and remove unnecessary options.

Change-Id: Ia663fda7761dca6dc08583314f00beedf1db60cc
2016-08-03 18:54:57 +00:00
manual_testing move novarc to manual testing subdir 2016-05-18 14:44:44 +00:00
src Add .gitreview and clean up repo 2016-08-03 18:54:57 +00:00
unit_tests Tidyup formating 2016-07-21 09:24:30 +00:00
.gitignore Add SSL support 2016-07-18 13:09:36 +00:00
.gitreview Add .gitreview and clean up repo 2016-08-03 18:54:57 +00:00
.testr.conf Initial unit_tests added - NOT FUNCTIONAL at this stage 2016-05-19 18:00:23 +00:00
LICENSE Add barbican-hsm-plugin interface support 2016-07-12 12:35:51 +00:00
Makefile Add .gitreview and clean up repo 2016-08-03 18:54:57 +00:00
README.md Renamed barbican-hsm-plugin to barbican-hsm 2016-07-13 15:42:33 +00:00
requirements.txt Get charm to build 2016-05-19 12:15:53 +00:00
setup.sh Render paste ini properly and other fixes 2015-12-11 13:43:03 +00:00
test-requirements.txt Add .gitreview and clean up repo 2016-08-03 18:54:57 +00:00
tox.ini Add .gitreview and clean up repo 2016-08-03 18:54:57 +00:00

README.md

Barbican Source Charm

THIS CHARM IS FOR EXPERIMENTAL USE AT PRESENT.

This repository is for the reactive, layered, Barbican source charm. From the wiki 'Barbican is a REST API designed for the secure storage, provisioning and management of secrets such as passwords, encryption keys and X.509 Certificates. It is aimed at being useful for all environments, including large ephemeral Clouds.'

Plugins

The Barbican charm currently supports the following plugins:

  • charm-barbican-softhsm

Creating the primary MKEK and primary HMAC

Barbican (can use|uses) a Master Key Encryption Key (MKEK) scheme to wrap other keys so that in the course of issuing new encryption keys, it doesn't exhaust the storage capacity of an HSM.

See KMIP MKEK Model Plugin for more details.

Barbican itself can generate the MKEK and HMAC keys and store them in the associated HSM through the use of two actions 'generate-mkek' and 'generate-hmac'.

The names of the keys are stored in the configuration for the service as 'mkek-label' and 'hmac-label'. These default to 'primarymkek' and 'primaryhmac' respectively.

Note that these keys are not recoverable from the HSM. If the HSM has already been configured with these keys then these actions would overwrite the existing key. So only use them for the initial implementation or to change the MKEK and HMAC keys in the HSM.

Use of actions

For juju 1.x:

juju action do generate-mkek

For juju 2.x:

juju run-action generate-mkek

Note that, depending on the HSM, it may only be possible to do this ONCE as the HSM may reject setting up the keys more than once.

Developer Notes

The Barbican charm has to be able to set [crypto] and [xxx_plugin] sections in the barbican-api.conf file. This data comes via the barbican-hsm interface from a charm (probably a subordinate) that provides the interface.

On the barbican-hsm interface the data is provided in the plugin_data() method of the interface (or if it is adapted) in the plugin_data property.

The theory of operation for the crypto plugin is that a local library that supports the PKCS#11 interface that Barbican can talk to locally.

Note(AJK): it is not clear yet how a clustered Barbican can be created with a single HSM backend. It's likely to be a separate piece of hardward with a local library that talks to it.

In order for Barbican to be configured for the example softhsm2 library, the configuration file needs to include the entries:

[crypto]
enabled_crypto_plugins = p11_crypto

[p11_crypto_plugin]
library_path = '/usr/lib/libCryptoki2_64.so'
login = 'catt'
mkek_label = 'primarymkek'
mkek_length = 32
hmac_label = 'primaryhmac' slot_id = <slot_id>

Note that the /var/lib/softhsm/tokens directory HAS to exist as otherwise the softhsm2-util command won't work.