-
Notifications
You must be signed in to change notification settings - Fork 47
[ADD] clouder_template_red_october: File encyption/decryption #187
base: master
Are you sure you want to change the base?
Changes from all commits
2455516
be1aaaa
7bca20b
d14d4cd
bced5ad
77754a4
f5125b9
73b3fa9
d07eabd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
:alt: License: LGPL-3 | ||
|
||
============================== | ||
Clouder Template - Red October | ||
============================== | ||
|
||
This module provides a Clouder Template for Red October. | ||
|
||
Red October is a cryptographically-secure implementation of the two-person rule | ||
to protect sensitive data. From a technical perspective, Red October is a | ||
software-based encryption and decryption server. The server can be used to | ||
encrypt a payload in such a way that no one individual can decrypt it. The | ||
encryption of the payload is cryptographically tied to the credentials of the | ||
authorized users. | ||
|
||
Authorized persons can delegate their credentials to the server for a period of | ||
time. The server can decrypt any previously-encrypted payloads as long as the | ||
appropriate number of people have delegated their credentials to the server. | ||
|
||
This architecture allows Red October to act as a convenient decryption service. | ||
Other systems, including CloudFlare’s build system, can use it for decryption | ||
and users can delegate their credentials to the server via a simple web interface. | ||
All communication with Red October is encrypted with TLS, | ||
ensuring that passwords are not sent in the clear. | ||
|
||
`Read More on CloudFlare's Blog | ||
<https://blog.cloudflare.com/red-october-cloudflares-open-source-implementation-of-the-two-man-rule/>`_. | ||
|
||
`Browse Red October on Github | ||
<https://github.com/cloudflare/redoctober>`_. | ||
|
||
Configuration | ||
============= | ||
|
||
Clouder configuration instructions are available at https://clouder.readthedocs.io/ | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Create a new service in the Clouder Control Panel | ||
#. Select ``Red October`` as the application & configure everything else to preference | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
* The service is currently using a self-signed certificate. This should be changed once a CA exists. | ||
* Runit is being installed via community repos, which are HTTP only. This is insecure. | ||
* Path isn't persisting so there is a symlink to redoctober being created. This should be fixed at some point, | ||
likely in a base Go container instead of here. | ||
* Image volume is being mounted as root, then chown is happening in the docker entrypoint. This sseems weird, | ||
so should investigate further, but is how the CloudFlare people rigged it up so it's possible they're simply | ||
smarter than me. | ||
* Add dependency cleanup to Dockerfile. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/clouder-community/clouder/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed feedback. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Dave Lasley <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
This module is maintained by Clouder Community. | ||
|
||
To contribute to this module, please visit https://github.com/clouder-community/clouder |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
{ | ||
'name': 'Clouder Template - Red October', | ||
'version': '10.0.10.0.0', | ||
'category': 'Clouder', | ||
'depends': [ | ||
'clouder', | ||
'clouder_template_proxy', | ||
], | ||
'author': 'LasLabs Inc.', | ||
'license': 'LGPL-3', | ||
'website': 'https://github.com/clouder-community/clouder', | ||
'data': [ | ||
'data/image_template.xml', | ||
'data/image.xml', | ||
'data/image_port.xml', | ||
'data/image_volume.xml', | ||
'data/application_type.xml', | ||
'data/application_template.xml', | ||
'data/application.xml', | ||
], | ||
'installable': True, | ||
'application': False, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="application_redoctober_data" model="clouder.application"> | ||
<field name="name">Red October Data</field> | ||
<field name="code">data</field> | ||
<field name="type_id" ref="application_type_redoctober" /> | ||
<field name="tag_ids" eval="[(4, ref('clouder.tag_data'))]" /> | ||
<field name="default_image_id" ref="image_redoctober_data" /> | ||
<field name="sequence">1</field> | ||
<field name="required" eval="True"/> | ||
</record> | ||
|
||
<record id="application_redoctober_exec" model="clouder.application"> | ||
<field name="name">Red October Exec</field> | ||
<field name="code">exec</field> | ||
<field name="type_id" ref="application_type_redoctober" /> | ||
<field name="tag_ids" eval="[(4, ref('clouder.tag_exec'))]" /> | ||
<field name="default_image_id" ref="image_redoctober_exec" /> | ||
<field name="sequence">2</field> | ||
<field name="required" eval="True"/> | ||
<field name="update_strategy">auto</field> | ||
</record> | ||
|
||
<record id="application_redoctober" model="clouder.application"> | ||
<field name="name">Red October</field> | ||
<field name="code">redoctober</field> | ||
<field name="base" eval="True" /> | ||
<field name="type_id" ref="application_type_redoctober" /> | ||
<field name="template_ids" | ||
eval="[(4, ref('clouder.application_template_base_www'))]" | ||
/> | ||
<field name="child_ids" | ||
eval="[(4, ref('application_redoctober_data')), | ||
(4, ref('application_redoctober_exec')), | ||
]" | ||
/> | ||
<field name="sequence">1</field> | ||
<field name="required" eval="True"/> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="application_template_redoctober" | ||
model="clouder.application.template" | ||
> | ||
<field name="name">Red October</field> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="application_type_redoctober" | ||
model="clouder.application.type" | ||
> | ||
<field name="name">redoctober</field> | ||
<field name="system_user">redoctober</field> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="image_redoctober_data" model="clouder.image"> | ||
<field name="name">image_redoctober_data</field> | ||
<field name="template_ids" | ||
eval="[(4, [ref('image_template_redoctober_data')])]" | ||
/> | ||
<field name="parent_from">clouder/base:3.4</field> | ||
</record> | ||
|
||
<record id="image_redoctober_exec" model="clouder.image"> | ||
<field name="name">image_redoctober_exec</field> | ||
<field name="template_ids" | ||
eval="[(4, [ref('image_template_redoctober_exec')])]" | ||
/> | ||
<field name="parent_from">laslabs/clouder-red-october-exec</field> | ||
<field name="volumes_from">data</field> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="image_port_redoctober_http" | ||
model="clouder.image.port" | ||
> | ||
<field name="template_id" ref="image_template_redoctober_exec" /> | ||
<field name="name">https</field> | ||
<field name="local_port">8080</field> | ||
<field name="expose">internet</field> | ||
</record> | ||
|
||
<record id="image_port_redoctober_metrics" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When deploying this from clouder, I'm getting an error when binding to 8081. This isn't happening when I build and run the image on its own, so it has to be something I'm doing wrong in the config here or there's something I don't know about on that port. Any clues where to start? Relevant Docker logs:
Without Clouder:
I tried removing this port definition just for the hell of it, but that had no effect. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems the problem is located inside your container.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woot good call! No idea what that IP is either, it doesn't match with any of my infrastructure (both internal and external facing).
|
||
model="clouder.image.port" | ||
> | ||
<field name="template_id" ref="image_template_redoctober_exec" /> | ||
<field name="name">metrics</field> | ||
<field name="local_port">8081</field> | ||
<field name="expose">internet</field> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="image_template_redoctober_data" | ||
model="clouder.image.template" | ||
> | ||
<field name="name">image_template_redoctober_data</field> | ||
</record> | ||
|
||
<record id="image_template_redoctober_exec" | ||
model="clouder.image.template" | ||
> | ||
<field name="name">image_template_redoctober_exec</field> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
|
||
<odoo> | ||
|
||
<record id="image_volume_redoctober_cert_store" | ||
model="clouder.image.volume" | ||
> | ||
<field name="template_id" ref="image_template_redoctober_data" /> | ||
<field name="name">data</field> | ||
<field name="localpath">/var/lib/redoctober/data</field> | ||
<field name="user">root</field> | ||
</record> | ||
|
||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from . import service |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class ClouderService(models.Model): | ||
_inherit = 'clouder.service' | ||
|
||
@api.multi | ||
def deploy_post(self): | ||
super(ClouderService, self).deploy_post() | ||
for record in self: | ||
if record.application_id.type_id.name == 'redoctober': | ||
if record.application_id.code == 'data': | ||
# @TODO: Create a CSR, sign it with the CA, execute echo | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After inheriting from base, I am getting a build failed due to no command. Looking at the base, this makes sense (because there isn't).
Do we have another Docker layer with just a
cat
ortail
in it that we can use instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, ok I was sure we had a CMD in the inherited base image.
I made a direct commit to resolve it, can you try again with the latest image from Docker hub ? clouder-community/clouder@8695902 https://hub.docker.com/r/clouder/base/builds/bzb6vgezh9o8qk55ycqhedc/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woot looks like we're in business thanks! Few more tweaks here and we should be good, I'll let you know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a sidenote, I shall remove all
tail -f
I made in the data images, they are all replaced by theCMD cat
I added in the base image