Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Implement encryption and decryption of blobs.
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Jochum <rene@jochums.at>
  • Loading branch information
jochumdev committed Apr 22, 2016
1 parent 82d36f9 commit 9d6bca7
Show file tree
Hide file tree
Showing 13 changed files with 364 additions and 437 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@
*.pyc
.installed.cfg
.mr.developer.cfg
pip-selfcheck.json
.project
.pydevproject
.settings/
Expand All @@ -18,3 +19,12 @@ htmlcov/
*.log
output.xml
*.swp
include/
lib/
local/
share/
packages/
src-mrd/

# Sublime
*.sublime-*
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,8 @@ language: python
python:
- 2.7
install:
- python bootstrap.py
- virtualenv .
- bin/pip install -r requirements.txt
- bin/buildout
script:
- bin/test -v1
Expand Down
4 changes: 2 additions & 2 deletions CHANGES.txt → CHANGES.rst
Expand Up @@ -5,8 +5,8 @@ CHANGES
1.0.1 (unreleased)
------------------

- Nothing changed yet.

- Add encryption for blobstorage.
[pcdummy]

1.0.0 (2012-04-06)
------------------
Expand Down
91 changes: 91 additions & 0 deletions README.rst
@@ -0,0 +1,91 @@
cipher.encryptingstorage
=========================

ZODB storage wrapper for encryption of database records.
Actually it is doing encryption and compression.


Installation manual with buildout
=================================

Follow https://pypi.python.org/pypi/keas.kmi to generate a kek.dat file::

$ 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

Now copy `kek.dat` and the `keys` folder to your plone site::

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


Then create a `encryption.conf` like this in your buildout directory::

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

Then edit buildout.cfg and add `cipher.encryptingstorage` to your eggs::

eggs +=
cipher.encryptingstorage

Now extend your `[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>

Then run buildout::

$ ./bin/buildout

Remove the generated <zodb_db main> entry in `parts/instance/etc/zope.conf`::

<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>


Run the tests/develop
=====================

::

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

$ ./bin/test -v1
5 changes: 0 additions & 5 deletions README.txt

This file was deleted.

0 comments on commit 9d6bca7

Please sign in to comment.