This repository was archived by the owner on Jan 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
[ADD] clouder_template_red_october: File encyption/decryption #187
Open
lasley
wants to merge
9
commits into
YannickB:master
Choose a base branch
from
LasLabs:feature/master/clouder_crypto
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2455516
[ADD] clouder_template_red_october: File encyption/decryption
lasley be1aaaa
[FIX] clouder_template_red_october: Review fixes
lasley 7bca20b
Few fixes
lasley d14d4cd
Fix Dockerfile and add note about non-persisting gopath
lasley bced5ad
Fix metrics interface binding
lasley 77754a4
Allow bases and link www to application
lasley f5125b9
Move dockerfile to repo
lasley 73b3fa9
Expose ports
lasley d07eabd
Switch expose to internet
lasley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| .. 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 Red October application in Clouder | ||
|
|
||
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| * The container 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. | ||
|
|
||
| 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 <dave@laslabs.com> | ||
|
|
||
| Maintainer | ||
| ---------- | ||
|
|
||
| This module is maintained by Clouder Community. | ||
|
|
||
| To contribute to this module, please visit https://github.com/clouder-community/clouder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?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="type_id" ref="application_type_redoctober" /> | ||
| <field name="tag_ids" eval="[(4, ref('tag_cert_authority'))]" /> | ||
| <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> |
13 changes: 13 additions & 0 deletions
13
clouder_template_red_october/data/application_template.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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">lasley/redoctober-exec</field> | ||
| <field name="volumes_from">data</field> | ||
| </record> | ||
|
|
||
| </odoo> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?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> | ||
| </record> | ||
|
|
||
| <record id="image_port_redoctober_comm" | ||
| model="clouder.image.port" | ||
| > | ||
| <field name="template_id" ref="image_template_redoctober_exec" /> | ||
| <field name="name">comm</field> | ||
| <field name="local_port">8081</field> | ||
| </record> | ||
|
|
||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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">redoctober</field> | ||
| </record> | ||
|
|
||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| FROM clouder/base:3.4 | ||
| MAINTAINER Dave Lasley <dave@laslabs.com> | ||
|
|
||
| RUN addgroup -S redoctober \ | ||
| && adduser -S -g redoctober redoctober | ||
|
|
||
| # Install Build Dependencies | ||
|
|
||
| ENV buildDeps "build-base \ | ||
| gcc \ | ||
| git \ | ||
| go \ | ||
| libtool \ | ||
| openssl \ | ||
| runit@community" | ||
|
|
||
| RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | ||
|
|
||
| RUN apk add --no-cache $buildDeps | ||
|
|
||
| # Install Red October | ||
| RUN git clone --depth=1 https://github.com/cloudflare/redoctober.git /usr/lib/go/src/github.com/cloudflare/redoctober | ||
| RUN go install github.com/cloudflare/redoctober | ||
|
|
||
| # Setup Environment | ||
| ENV RO_DATA=/var/lib/redoctober/data \ | ||
| RO_CERTS=$RO_DATA/server.crt \ | ||
| RO_KEYS=$RO_DATA/server.pem | ||
|
|
||
| ENTRYPOINT ["/go/src/github.com/cloudflare/redoctober/scripts/docker-entrypoint.sh"] | ||
|
|
||
| CMD ["redoctober", \ | ||
| "-addr=:8080", \ | ||
| "-vaultpath=$RO_DATA/diskrecord.json", \ | ||
| "-certs=$RO_CERTS", \ | ||
| "-keys=$RO_KEYS"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ClouderContainer(models.Model): | ||
| _inherit = 'clouder.container' | ||
|
|
||
| @api.multi | ||
| def deploy_post(self): | ||
| super(ClouderContainer, 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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
catortailin 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 -fI made in the data images, they are all replaced by theCMD catI added in the base image