Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][MIG][16.0] vault: Migration to 16.0 #537

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
136a06d
Add vault and vault_share module
fkantelberg Mar 12, 2021
44f3ba0
Fix website in manifest
fkantelberg Mar 12, 2021
7df1e6e
Run pre-commit
fkantelberg Mar 12, 2021
143aebd
Move models to own files. Apply OCA conventions
fkantelberg Mar 13, 2021
3da2446
Remove logging causing the tests to fail
fkantelberg Mar 13, 2021
a536a32
Add application icon
fkantelberg Mar 13, 2021
0770c30
Split models into files. Use lambda for defaults
fkantelberg Mar 13, 2021
4b39dc1
Add icon to menuitem
fkantelberg Mar 13, 2021
f7b0e18
Use lambda as suggested
fkantelberg Mar 13, 2021
246ea91
Add missing keepass lib
fkantelberg Mar 14, 2021
8e6f51a
Show information if user lacks public key
fkantelberg Mar 14, 2021
5a2a013
Add note about no https
fkantelberg Mar 14, 2021
541060d
Fix domain for user_id in send wizard. Add permanent note to wizard
fkantelberg Mar 14, 2021
4b8d197
[UPD] Update vault.pot
oca-travis Sep 21, 2021
3e8452e
[UPD] README.rst
OCA-git-bot Sep 21, 2021
0937e49
[FIX] vault:
Sep 30, 2021
9ac60a3
[FIX] vault_controller
Oct 5, 2021
51501e2
vault 14.0.1.5.1
OCA-git-bot Oct 5, 2021
75db747
General fixes and improvements of the vault
fkantelberg Oct 27, 2021
8d7d9ca
[UPD] Update vault.pot
oca-travis Mar 18, 2022
abc99bc
[UPD] README.rst
OCA-git-bot Mar 18, 2022
a27a458
[IMP] update dotfiles [ci skip]
OCA-git-bot Mar 31, 2022
a9bba01
Prevent locking out the user from the private key when the login was …
fkantelberg Apr 14, 2022
f9e8c18
[UPD] Update vault.pot
Jun 12, 2022
260d398
[UPD] README.rst
OCA-git-bot Jun 12, 2022
ce0af87
vault 14.0.1.6.1
OCA-git-bot Jun 12, 2022
aadb48a
[FIX] vault: complete_name not computed when created from other entry
CarlosRoca13 Aug 31, 2022
b2f6c4b
vault 14.0.1.6.2
OCA-git-bot Aug 31, 2022
1893ded
[IMP] vault: Show just name instad of full path in searchpanel
CarlosRoca13 Jun 6, 2022
2019162
[FIX+IMP] vault: Searchpanel improvements:
victoralmau Aug 31, 2022
d7bde20
[IMP] vault: Add Vaults to searchpanel view.
victoralmau Sep 1, 2022
b9ad6bd
[UPD] Update vault.pot
Sep 1, 2022
522881e
vault 14.0.1.7.0
OCA-git-bot Sep 1, 2022
a542629
Fix locking secrets because on re-encryption after removal of users t…
fkantelberg Sep 4, 2022
120f107
vault 14.0.1.7.1
OCA-git-bot Sep 6, 2022
b1b4f07
[IMP] Allow an user to invalidate the current key if the password is …
fkantelberg Sep 8, 2022
011adbf
[UPD] Update vault.pot
Nov 28, 2022
412f9e0
vault 14.0.1.8.0
OCA-git-bot Nov 28, 2022
92088fc
Update translation files
weblate Nov 28, 2022
18350ac
[MIG][15.0] Module vault and vault_share
fkantelberg Nov 29, 2022
b8563f4
[IMP] vault: vault readonly when it's defined
CarlosRoca13 Mar 20, 2023
dadde7f
[UPD] Update vault.pot
Mar 23, 2023
a9d8503
[UPD] README.rst
OCA-git-bot Mar 23, 2023
16537d5
Update translation files
weblate Mar 23, 2023
94e660b
Added translation using Weblate (Dutch)
bosd May 5, 2023
b337b4a
Translated using Weblate (Dutch)
bosd May 5, 2023
7be5eed
[FIX] vault: Error thrown when the key version is lower than 1
CarlosRoca13 Jun 14, 2023
1c48c02
vault 15.0.1.6.2
OCA-git-bot Jun 15, 2023
ed556f4
[FIX] vault, vault_share: Error on test
CarlosRoca13 Jun 22, 2023
22c778f
vault 15.0.1.6.3
OCA-git-bot Jun 26, 2023
2d0d9fc
[FIX] vault: Error thrown when attempting to remove a right from a va…
CarlosRoca13 Jun 26, 2023
e89c197
vault 15.0.1.6.4
OCA-git-bot Jun 26, 2023
3a6c4ae
[MIG] vault: Migration to 16.0
Jul 5, 2023
65e7dd8
[IMP] vault
Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup/vault/odoo/addons/vault
6 changes: 6 additions & 0 deletions setup/vault/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
97 changes: 97 additions & 0 deletions vault/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=====
Vault
=====

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
:target: https://github.com/OCA/server-auth/tree/15.0/vault
:alt: OCA/server-auth
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-auth-15-0/server-auth-15-0-vault
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/251/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module implements a vault for secrets and files using end-to-end-encryption. The encryption and decryption happens in the browser using a vault specific shared master key. The master keys are encrypted using asymmetrically. For this the user has to enter a second password on the first login or if he needs to access data in a vault. The asymmetric keys are stored for a certain time in the browser storage.

The server can never access the secrets with the information available. Only people registered in the vault can decrypt or encrypt values in a vault. The meta data isn't encrypted to be able to search/filter for entries more easily.

This modules requires a secure context for the browser to work properly.

The `vault-recovery <https://github.com/fkantelberg/vault-recovery>`_ project focuses on disaster recovery in case of an incident to recover secrets from old database backups or old exports.

**Table of contents**

.. contents::
:local:

Known issues / Roadmap
======================

* Field and file history for restoration

* Send secrets directly to an inbox within Odoo

* Import improvement

* Support challenge-response/FIDO2
* Support for argon2 and kdbx v4

* When changing an entry from one vault to another existing vault, the values added on
this entry cannot be accessed, so the field vault is going to be readonly when it
is defined.

If you want to move entries between vaults you can use the export -> import option.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/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 <https://github.com/OCA/server-auth/issues/new?body=module:%20vault%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* initOS GmbH

Contributors
~~~~~~~~~~~~

* Florian Kantelberg <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/15.0/vault>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
143 changes: 143 additions & 0 deletions vault/TECHNICAL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
::

┌───────┐ ┏━━━━━━━━━━━━━┓ ╔═══════════╗
│ input │ ┃ unencrypted ┃ ║ encrypted ║
└───────┘ ┗━━━━━━━━━━━━━┛ ╚═══════════╝

Vault
=====

Each vault stores entries with enrypted fields and files in a tree like structure. The access is controlled per vault. Every added user can read the secrets of a vault. Otherwise the users can receive permission to share the vault with other users, to write secrets in the vault, or to delete entries of the vault. The databases stores the public and password protected private key of each user. The password used for the private key is derived from a password entered by the user and should be different than the password used for the login. Keep in mind that the meta information like field name or file names aren't encrypted.

Shared-key encryption
=====================

To be able to securely share sensitive data between all users a shared-key encryption is used. All users share a common secret for each vault. This secret is encrypted by the public key of each user to grant access to the user by using the private key to restore the secret.

Encryption of master key
------------------------

::

. ┏━━━━━━━━━━━━┓
┃ Master key ┃
┗━━━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━┓ ┃
┃ User ┃ ▼
┃ ┃ ┏━━━━━━━━━┓
┃ ┏━━━━━━━━━━━━━┓ ┃ ┃ encrypt ┃ ╔════════════╗
┃ ┃ Public key ┃━━━━▶┃ (RSA) ┃━━━━━▶║ Master key ║
┃ ┗━━━━━━━━━━━━━┛ ┃ ┗━━━━━━━━━┛ ╚════════════╝
┃ ╔═════════════╗ ┃
┃ ║ Private key ║ ┃
┃ ╚═════════════╝ ┃
┗━━━━━━━━━━━━━━━━━┛

Decryption of master key
------------------------

::

. ┌──────────┐ ┏━━━━━━━━━━┓
│ Password │━━━━▶┃ derive ┃
└──────────┘ ┃ (PBKDF2) ┃
┗━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━┓ ▼ ╔════════════╗
┃ User ┃ ┏━━━━━━━━━━┓ ║ Master key ║
┃ ┃ ┃ Password ┃ ╚════════════╝
┃ ┏━━━━━━━━━━━━━┓ ┃ ┗━━━━━━━━━━┛ ┃
┃ ┃ Public key ┃ ┃ ┃ ▼
┃ ┗━━━━━━━━━━━━━┛ ┃ ▼ ┏━━━━━━━━━┓
┃ ╔═════════════╗ ┃ ┏━━━━━━━━┓ ┏━━━━━━━━━━━━━┓ ┃ decrypt ┃ ┏━━━━━━━━━━━━┓
┃ ║ Private key ║━━━━━┃ unlock ┃━━▶┃ Private key ┃━━━▶┃ (RSA) ┃━━━━━▶┃ Master key ┃
┃ ╚═════════════╝ ┃ ┗━━━━━━━━┛ ┗━━━━━━━━━━━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━━━━┛
┗━━━━━━━━━━━━━━━━━┛

Symmetric encryption of the data
================================

The symmetric cipher AES is used with the common master key to encrypt/decrypt the secrets of the vaults. The encryption parameter and encrypted data is stored in the database while everything else happens in the browser.

Encryption of data
------------------

::

. ┏━━━━━━━━━━━━┓
┃ Master key ┃
┗━━━━━━━━━━━━┛
┃ ┏━━━━━━━━━━━━━━━━━━┓
▼ ┃ Database ┃
┏━━━━━━━━━┓ ┃ ┃
┏━━━━━━━━━━━━┓ ┃ encrypt ┃ ┃╔════════════════╗┃
┃ Plain text ┃━━▶┃ (AES) ┃━━━▶║ Encrypted data ║┃
┗━━━━━━━━━━━━┛ ┗━━━━━━━━━┛ ┃╚════════════════╝┃
┃ ┃┏━━━━━━━━━━━━━━━━┓┃
┗━━━━━━━━▶┃ Parameters ┃┃
┃┗━━━━━━━━━━━━━━━━┛┃
┗━━━━━━━━━━━━━━━━━━┛

Decryption of data
------------------

::

. ┏━━━━━━━━━━━━┓
┃ Master key ┃
┗━━━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━━┓ ┃
┃ Database ┃ ▼
┃ ┃ ┏━━━━━━━━━┓
┃╔════════════════╗┃ ┃ decrypt ┃ ┏━━━━━━━━━━━━┓
┃║ Encrypted data ║━━━▶┃ (AES) ┃━━▶┃ Plain text ┃
┃╚════════════════╝┃ ┗━━━━━━━━━┛ ┗━━━━━━━━━━━━┛
┃┏━━━━━━━━━━━━━━━━┓┃ ▲
┃┃ Parameters ┃━━━━━━━━┛
┃┗━━━━━━━━━━━━━━━━┛┃
┗━━━━━━━━━━━━━━━━━━┛

Inbox
=====

This allows an user to receive encrypted secrets by external or internal Odoo users. External users have to use either the owner specific inbox link from his preferences or the link of an already created inbox. The value is symmetrically encrypted. The key for the encryption is wrapped with the public key of the user of the inbox to grant the user the access to the key. Internal users can directly send a secret from a vault entry to another user who has enabled this feature. If a direct link is used the access counter and expiration time can block an overwrite.

Encryption of inbox
-------------------

::

. ┏━━━━━━━━━━━━┓
┃ Plain data ┃
┗━━━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━┓ ┃
┃ User ┃ ▼
┃ ┃ ┏━━━━━━━━━┓
┃ ┏━━━━━━━━━━━━━┓ ┃ ┃ encrypt ┃ ╔════════════════╗
┃ ┃ Public key ┃━━━━▶┃ (RSA) ┃━━━━━▶║ Encrypted data ║
┃ ┗━━━━━━━━━━━━━┛ ┃ ┗━━━━━━━━━┛ ╚════════════════╝
┃ ╔═════════════╗ ┃
┃ ║ Private key ║ ┃
┃ ╚═════════════╝ ┃
┗━━━━━━━━━━━━━━━━━┛

Decryption of inbox
-------------------

::

. ┌──────────┐ ┏━━━━━━━━━━┓
│ Password │━━━━▶┃ derive ┃
└──────────┘ ┃ (PBKDF2) ┃
┗━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━┓ ▼ ╔════════════════╗
┃ User ┃ ┏━━━━━━━━━━┓ ║ Encrypted data ║
┃ ┃ ┃ Password ┃ ╚════════════════╝
┃ ┏━━━━━━━━━━━━━┓ ┃ ┗━━━━━━━━━━┛ ┃
┃ ┃ Public key ┃ ┃ ┃ ▼
┃ ┗━━━━━━━━━━━━━┛ ┃ ▼ ┏━━━━━━━━━┓
┃ ╔═════════════╗ ┃ ┏━━━━━━━━┓ ┏━━━━━━━━━━━━━┓ ┃ decrypt ┃ ┏━━━━━━━━━━━━┓
┃ ║ Private key ║━━━━━┃ unlock ┃━━▶┃ Private key ┃━━━▶┃ (RSA) ┃━━━━━▶┃ Plain data ┃
┃ ╚═════════════╝ ┃ ┗━━━━━━━━┛ ┗━━━━━━━━━━━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━━━━┛
┗━━━━━━━━━━━━━━━━━┛
4 changes: 4 additions & 0 deletions vault/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2021 Florian Kantelberg - initOS GmbH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import controllers, models, wizards
52 changes: 52 additions & 0 deletions vault/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# © 2021 Florian Kantelberg - initOS GmbH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Vault",
"summary": "Password vault integration in Odoo",
"license": "AGPL-3",
"version": "16.0.1.0.0",
"website": "https://github.com/OCA/server-auth",
"application": True,
"author": "initOS GmbH, Odoo Community Association (OCA)",
"category": "Vault",
"depends": ["base_setup", "web"],
"data": [
"security/ir.model.access.csv",
"security/ir_rule.xml",
"views/res_config_settings_views.xml",
"views/res_users_views.xml",
"views/vault_entry_views.xml",
"views/vault_field_views.xml",
"views/vault_file_views.xml",
"views/vault_log_views.xml",
"views/vault_inbox_views.xml",
"views/vault_right_views.xml",
"views/vault_views.xml",
"views/menuitems.xml",
"views/templates.xml",
"wizards/vault_export_wizard.xml",
"wizards/vault_import_wizard.xml",
"wizards/vault_send_wizard.xml",
"wizards/vault_store_wizard.xml",
],
"assets": {
"vault.assets_frontend": [
"vault/static/src/common/*.js",
"vault/static/src/frontend/*.js",

],
"web.assets_backend": [
"vault/static/lib/**/*.min.js",
"vault/static/src/common/*.js",
"vault/static/src/backend/*.scss",
"vault/static/src/backend/*.js",
# "vault/static/src/legacy/vault_controller.js",
"vault/static/src/backend/*.xml",
# "vault/static/src/legacy/vault_widget.js",
],
"web.tests_assets": [
"vault/static/tests/**/*.js",
],
},
}
4 changes: 4 additions & 0 deletions vault/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2021 Florian Kantelberg - initOS GmbH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
Loading