Barbican筆記

雜記

記錄一下最近研究barbican組件的個人理解。

barbican主要是密鑰管理的。存儲(store secret)的時候有各種文件格式(text\plain),獲取的時候根據(jù)它是證書,私鑰進行格式化,比如x509。

{'text/plain': 'text/plain',
'text/plain;charset=utf-8': 'text/plain',
'text/plain; charset=utf-8': 'text/plain',
'application/octet-stream': 'application/octet-stream',
'application/pkcs8': 'application/pkcs8',
'application/aes': 'application/aes'}

tips:ocatavia可以對pkcs12證書進行格式化(當然也是封裝的接口),一般情況下,獲取的證書默認進行pkcs12格式化的,同時也兼容了barbican原生的證書格式化。包括監(jiān)聽器綁定證書的方式也同lbv2不一樣,并沒有采用容器的方式(實際pkcs12也可以看著是容器)。

barbican后端支持多種存儲,所以官網(wǎng)提供了多個插件:

[secretstore]
# Set to True when multiple plugin backends support is needed
enable_multiple_secret_stores = True
stores_lookup_suffix = software, kmip, pkcs11, dogtag 
[secretstore:software]
secret_store_plugin = store_crypto
crypto_plugin = simple_crypto
[secretstore:kmip]
secret_store_plugin = kmip_plugin
global_default = True 
[secretstore:dogtag]
secret_store_plugin = dogtag_plugin 
[secretstore:pkcs11]
secret_store_plugin = store_crypto
crypto_plugin = p11_crypto

目前barbican自身代碼,限定了pkcs8,pkcs11,x509等格式的支持程度。
lbv2支持的私鑰是pkcs8(??????)證書是x509,octvia在代碼里增加了pkcs12的代碼文件,并新增/certificate/manager/barbican.py可實現(xiàn)barbican對pkcs12的支持,所以私鑰和證書都可以支持pkcs12
https://developer.openstack.org/api-guide/key-manager/containers.html#certificate-containers
https://docs.openstack.org/releasenotes/octavia/queens.html

Users can now use a reference to a single PKCS12 bundle as their default_tls_container_ref instead of a Barbican container with individual secret objects. PKCS12 supports bundling a private key, certificate, and intermediates. Private keys can no longer be passphrase protected when using PKCS12 bundles. No configuration change is necessary to enable this feature. Users may simply begin using this. Any use of the old style containers will be detected and automatically fall back to using the old Barbican driver.
Certificate bundles can now be stored in any backend Castellan supports, and can be retrieved via a Castellan driver, even if Barbican is not deployed.

創(chuàng)建證書容器的body如下:

{          
    "type": "certificate",
    "status": "ACTIVE",
    "name": "Example.com Certificates",
    "consumers": [],
    "container_ref": "https://{barbican_host}/v1/containers/{uuid}",
    "secret_refs": [
        {
            "name": "certificate",
            "secret_ref": "https://{barbican_host}/v1/secrets/{uuid}"
        },
        {
            "name": "private_key",
            "secret_ref": "https://{barbican_host}/v1/secrets/{uuid}"
        },
        {
            "name": "private_key_passphrase",
            "secret_ref": "https://{barbican_host}/v1/secrets/{uuid}"
        },
        {
            "name": "intermediates",
            "secret_ref": "https://{barbican_host}/v1/secrets/{uuid}"
        }

    ],
    "created": "2015-03-30T21:10:45.417835",
    "updated": "2015-03-30T21:10:45.417835"
}      

證書容器是用來存儲證書相關的密鑰,需要指定以下幾種type,其中certificate是必須指定,其余的均是可選的。

A certificate container is used for storing the following secrets that are relevant to certificates:
certificate
private_key (optional)
private_key_passphrase (optional)
intermediates (optional)
The payload for the secret referenced as the “certificate” is expected to be a PEM formatted x509 certificate.
The payload for the secret referenced as the “intermediates” is expected to be a PEM formatted PKCS7 certificate chain.

參考

http://www.iceyao.com.cn/2017/11/19/Neutron-lbaas%E4%BB%A3%E7%90%86https%E5%AE%9E%E8%B7%B5/
https://docs.openstack.org/barbican/latest/install/barbican-backend.html
https://docs.openstack.org/barbican/latest/configuration/plugin_backends.html
https://developer.openstack.org/api-guide/key-manager/containers.html#certificate-containers
https://docs.openstack.org/releasenotes/octavia/queens.html
個人分析,歡迎指正,若轉(zhuǎn)載請注明出處!
歡迎訪問我的主頁

?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,872評論 0 10
  • 今宵良辰皆是夢,驀然回首已成空。 酒醉金迷千金散,多情笑我惹人愁。 霓羅裙下難得醉,香床暖枕懷里柔。 清風吹送相思...
    Lucifer83閱讀 839評論 0 51
  • 有的人來過,停留了 又走了 我把你推開,你走了 那就走吧 你沒留個信息,就走了 我就不找了 你來了我生活的地方,沒...
    黑青蛙閱讀 203評論 0 0
  • 一、幣范兒逗比會議 定個會議時間都要那么逗比真的好嘛……我也想玩啊,可惜當時在回貴港的路上睡著了,沒接上去:小天天...
    TMAC紫菜湯的地盤閱讀 472評論 2 1
  • 國慶節(jié)回家,期盼之余又有些擔心。 為什么呢? 因為今年2月過年時,我一不留神說出自己想要辭職的想法,我親愛的老爸不...
    生活教練Helen閱讀 423評論 3 5

友情鏈接更多精彩內(nèi)容