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

[MIG][16.0] Migration of vault #611

Merged
merged 68 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c0bffd1
Add vault and vault_share module
fkantelberg Mar 12, 2021
8ffcafb
Update vault.pot
oca-travis Sep 21, 2021
fdfac4a
Update vault_share.pot
oca-travis Sep 21, 2021
69ba223
README.rst
OCA-git-bot Sep 21, 2021
a473599
FIX vault: - Wrong field name
Sep 30, 2021
4807043
vault 14.0.1.5.1
OCA-git-bot Oct 5, 2021
eb89786
General fixes and improvements of the vault - Send wizard couldn't se…
fkantelberg Oct 27, 2021
d0ca265
Update vault.pot
oca-travis Mar 18, 2022
3924e00
Update vault_share.pot
oca-travis Mar 18, 2022
3c93d7d
README.rst
OCA-git-bot Mar 18, 2022
d73d283
update dotfiles [ci skip]
OCA-git-bot Mar 31, 2022
d67eab4
Prevent locking out the user from the private key when the login was …
fkantelberg Apr 14, 2022
28e4ed6
Update vault.pot
Jun 12, 2022
aac9791
README.rst
OCA-git-bot Jun 12, 2022
f7ab44a
vault 14.0.1.6.1
OCA-git-bot Jun 12, 2022
743f855
vault: complete_name not computed when created from other entry
CarlosRoca13 Aug 31, 2022
2bbbab5
vault 14.0.1.6.2
OCA-git-bot Aug 31, 2022
ca99d45
vault: Show just name instad of full path in searchpanel
CarlosRoca13 Jun 6, 2022
b14b431
Update vault.pot
Sep 1, 2022
4b339bf
Update vault_share.pot
Sep 1, 2022
4bfaedc
vault_share 14.0.1.2.0
OCA-git-bot Sep 1, 2022
b63dbc9
vault 14.0.1.7.0
OCA-git-bot Sep 1, 2022
0a28d5c
Fix locking secrets because on re-encryption after removal of users t…
fkantelberg Sep 4, 2022
d3429a9
vault 14.0.1.7.1
OCA-git-bot Sep 6, 2022
10df9e6
Allow an user to invalidate the current key if the password is lost -…
fkantelberg Sep 8, 2022
8609227
Update vault.pot
Nov 28, 2022
d49fe26
vault 14.0.1.8.0
OCA-git-bot Nov 28, 2022
f56d371
Update translation files
weblate Nov 28, 2022
4f8b4a3
Module vault and vault_share
fkantelberg Nov 29, 2022
6b89277
vault_share: File is not downloaded when clicking sharing link
CarlosRoca13 Jan 11, 2023
70aa9d1
vault: vault readonly when it's defined
CarlosRoca13 Mar 20, 2023
d000d77
Update vault.pot
Mar 23, 2023
8832792
Update vault_share.pot
Mar 23, 2023
2eb73c8
README.rst
OCA-git-bot Mar 23, 2023
7f187bd
Update translation files
weblate Mar 23, 2023
77b3162
Update translation files
weblate Mar 23, 2023
c9d460b
Added translation using Weblate (Dutch)
bosd May 5, 2023
c1707fa
Added translation using Weblate (Dutch)
bosd May 5, 2023
d4120af
Translated using Weblate (Dutch)
bosd May 5, 2023
f85fbd0
Translated using Weblate (Dutch)
bosd May 5, 2023
dcb0a80
Translated using Weblate (Dutch)
bosd May 5, 2023
b4c0d60
Translated using Weblate (Spanish)
victoralmau Jun 13, 2023
e3ba9a2
vault: Error thrown when the key version is lower than 1
CarlosRoca13 Jun 14, 2023
37f90c4
vault 15.0.1.6.2
OCA-git-bot Jun 15, 2023
7ac9139
vault, vault_share: Error on test
CarlosRoca13 Jun 22, 2023
ed419cd
vault_share 15.0.1.1.1
OCA-git-bot Jun 26, 2023
a95dd8a
vault 15.0.1.6.3
OCA-git-bot Jun 26, 2023
2714549
vault: Error thrown when attempting to remove a right from a vault wi…
CarlosRoca13 Jun 26, 2023
0d9dc4c
vault 15.0.1.6.4
OCA-git-bot Jun 26, 2023
b2f2f52
vault: Vault re-encryption in a single transaction. Add copy support …
fkantelberg Jul 14, 2023
b1c78f3
Update vault.pot
Jul 18, 2023
f8f5c43
vault 15.0.2.0.0
OCA-git-bot Jul 18, 2023
3f66325
Update translation files
weblate Jul 18, 2023
6110310
vault: Add reload when finish the reencriptation to display updated data
CarlosRoca13 Aug 2, 2023
8611581
vault 15.0.2.0.1
OCA-git-bot Aug 2, 2023
b1234ab
Translated using Weblate (Spanish)
CarlosRoca13 Aug 2, 2023
ba99da6
README.rst
OCA-git-bot Sep 3, 2023
05d104f
vault: Add new groups to allow importing/exporting secrets
CarlosRoca13 Oct 2, 2023
75d5776
Update vault.pot
Oct 4, 2023
d4692b4
post-merge updates
OCA-git-bot Oct 4, 2023
461467d
Update translation files
weblate Oct 9, 2023
56a7fd5
Update translation files
weblate Oct 10, 2023
d73a782
Translated using Weblate (Spanish)
Ivorra78 Oct 30, 2023
66b399e
Translated using Weblate (Spanish)
Ivorra78 Oct 31, 2023
9240e1a
[MIG][16.0] vault: Migration and restructuring for 16.0
fkantelberg Jan 18, 2024
38aa148
[FIX] vault: Exception when clicking away the first password dialog a…
fkantelberg Feb 14, 2024
6259a60
[FIX] vault: Check against the key of vault.right
fkantelberg Feb 17, 2024
9f4cda0
[IMP] vault: Improve handling if no secure browser context is provide…
fkantelberg Feb 19, 2024
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,
)
100 changes: 100 additions & 0 deletions vault/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=====
Vault
=====

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9bc765eb2b8c6fb6a4912b97a282f3c40996011386f83779dccfad8c2672bfe6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/16.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-16-0/server-auth-16-0-vault
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=16.0
:alt: Try me on Runboat

|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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20vault%0Aversion:%2016.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/16.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
50 changes: 50 additions & 0 deletions vault/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# © 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",
"security/vault_security.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/**/*.xml",
"vault/static/src/common/*.js",
"vault/static/src/backend/*.scss",
"vault/static/src/backend/**/*.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
Loading