跳至主要内容

用于加密数据库记录的ZODB存储封装器

项目描述

cipher.encryptingstorage

ZODB 存储包装器,用于加密数据库记录。实际上它执行加密和压缩。

使用 buildout 的安装手册

按照 https://pypi.python.org/pypi/keas.kmi 生成 kek.dat 文件

$ git clone https://github.com/zopefoundation/keas.kmi.git
$ cd keas.kmi
$ python2.7 bootstrap.py
$ ./bin/buildout
$ ./bin/runserver &

$ wget https://localhost:8080/new -O kek.dat --ca-certificate sample.pem \
        --post-data=""

$ wget https://localhost:8080/key --header 'Content-Type: text/plain' \
     --post-file kek.dat -O datakey.dat --ca-certificate sample.pem

现在将 kek.datkeys 文件夹复制到您的 plone 网站中

$ cp -pi kek.dat /home/yourname/Plone/training/var/kek.dat
$ cp -pri keys /home/yourname/Plone/training/var/dek-storage

然后在您的 buildout 目录中创建一个 encryption.conf,如下所示

[encryptingstorage:encryption]
enabled = true
kek-path = /home/yourname/Plone/training/var/kek.dat
dek-storage-path = /home/yourname/Plone/training/var/dek-storage/

然后编辑 buildout.cfg 并将 cipher.encryptingstorage 添加到您的 eggs 中

eggs +=
    cipher.encryptingstorage

现在扩展您的 [instance]plone.recipe.zope2instance

zope-conf-imports =
    cipher.encryptingstorage
zope-conf-additional =
    <zodb_db main>
      cache-size 30000
      <encryptingstorage>
        config encryption.conf
        # FileStorage database
        <filestorage>
          path ${buildout:buildout_dir}/var/filestorage/Data.fs
          blob-dir ${buildout:buildout_dir}/var/blobstorage
        </filestorage>
      </encryptingstorage>
      mount-point /
    </zodb_db>

然后运行 buildout

$ ./bin/buildout

parts/instance/etc/zope.conf 中删除生成的 <zodb_db main> 条目

<zodb_db main>
    # Main database
    cache-size 30000
    # Blob-enabled FileStorage database
    <blobstorage>
      blob-dir /home/yourname/Plone/training/var/blobstorage
      # FileStorage database
      <filestorage>
        path /home/yourname/Plone/training/var/filestorage/Data.fs
      </filestorage>
    </blobstorage>
    mount-point /
</zodb_db>

运行 tests/develop

$ virtualenv -p /usr/bin/python2.7 --no-site-packages .
$ ./bin/pip install -r requirements.txt
$ ./bin/buildout

$ ./bin/test -v1

变更记录

1.1 (2016-04-22)

  • 为 blobstorage 添加加密。[pcdummy]

1.0.0 (2012-04-06)

0.1.0 (2012-02-14)

  • 作为独立包的初始发布。

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

cipher.encryptingstorage-1.1.tar.gz (16.4 kB 查看哈希值)

上传时间 源代码

由以下支持