MongoDB Encryption and Wekan
Brought to you by:
wekan
Originally created by: fmonthel
Hi
For some usecase we should have very critical data in Wekan board
How we can put in place Encryption into wekan to avoid, for database administrator, to have access on data stored in database
https://docs.mongodb.com/v3.2/core/security-encryption-at-rest/
Originally posted by: xet7
@fmonthel
Depends when Sandstorm gets grain-level encryption working. Then only those that have permissions to Wekan board are able to open it, and it's encrypted at rest.
Originally posted by: xet7
@fmonthel
Another option would be to figure out how to store Wekan data in ZeroDB:
https://opensource.zerodb.com/
Originally posted by: amadilsons
@xet7 Is there any specific approach you think should be taken to go about this issue??
Originally posted by: xet7
@amadilsons
If you have any progress, please add info to this issue.
Sandstorm
1) Find where in https://sandstorm.io dev mailinglist, GitHub issues, and code repos is current status of encrypted grains progress.
2) Try to make encrypted grains work on Sandstorm.
Standalone Wekan
1) Install ZeroDB and Wekan locally.
2) Try to write some code that saves data to ZeroDB, and read data from there.
3) Look at possible ways for Wekan to save data to ZeroDB, look at discussion about other databases [#787] . One possibility would be to have: Wekan <=> MongoDB driver to ZeroDB converter <=> ZeroDB database
4) If you get Wekan working with ZeroDB, you could install ZeroDB to any server use it remotely with locally installed Wekan, and server admin would not have access to data.
API time limited tokens
If you don't want to use always same passwords when using API etc, but have limited time tokens, look at HashiCorp Vault.
Originally posted by: xet7
Wekan also works with Percona Server for MongoDB:
https://www.percona.com/software/mongo-database/percona-server-for-mongodb
Here is feature matrix:
https://www.percona.com/software/mongo-database/feature-comparison
According to that feature matrix:
@fmonthel @amadilsons
Because you seem to be interested in this, you could try this and add comment to this issue, does encryption work, and what steps you did to get encryption working.
Originally posted by: xet7
https://github.com/wekan/wekan master branch works with Percona MongoDB 4.x.
You can build Wekan with
./rebuild-wekan.shwith first option 1 install dependencies, then option 2 build source. Then editstart-wekan.shfor ROOT_URL and MONGO_BIND_IP 127.0.0.1 and MONGODB_PORT=27017, and then./start-wekan.sh.Originally posted by: xet7
Hmm, other possibility would be for me to change Wekan Snap MongoDB to Percona MongoDB, and try to make some configuration options for enabling MongoDB encryption.
Originally posted by: noor-alghamdi
@xet7 do you mean that we can't encrypt DB on wekan snap?
how do we ensure that we'll not lose data in wekan snap??
I'm asking you that because there are many security standards we need to follow :\
thank you.
Originally posted by: xet7
@namacoconut
Oh sorry, I did not know you would like to encrypt DB.
For ensuring you do not lose data, you should have at least daily backups,
although just for extra safety, backups could be multiple times per day:
https://github.com/wekan/wekan/wiki/Backup
From MongoDB, if required, it is also possible to dump all database
content to plain text JSON files. Attachments are base64 encoded:
https://github.com/wekan/wekan/wiki/Export-from-Wekan-Sandstorm-grain-.zip-file
For securing Wekan server, to some bare metal server it is possible
to install KVM / XEN / or other VM, and there install Linux
with full disk encryption. Then at that VM only allow SSH
with SSH public/private keys from bare metal server to VM,
at
/etc/ssh/sshd_configdisable password login and doWith UFW firewall, inside VM, you can close all other than
necessary ports:
Also with UFW or other firewall you can allow accessing
Wekan only from some selected IP addresses.
For using Wekan Snap SSL/TLS only on selected IP
addresses with Wekan included Caddy or Nginx,
it is not possible to use Let's Encrypt free certs,
because that would require exposing server to
Internet so that free cert validation can happen.
The workaround is to buy SSL/TLS certificate and
install it manually:
https://github.com/wekan/wekan/wiki/Caddy-Webserver-Config
It is same for Nginx.
Anyway, inside that full disk encrypted VM, all Wekan
settings are also encrypted.
If that is not enough, and you would like to encrypt database,
encrypting MongoDB database is available on Percona MongoDB:
https://www.percona.com/software/mongodb/feature-comparison
I will look how to make possible changing MONGO_URL in Snap.
Originally posted by: xet7
Hmm, let's discuss some more.
If Wekan Snap included MongoDB server would be changed to Percona MongoDB, then it would be possible to add settings to Wekan so that MongoDB would be encrypted. But usually only those have direct access to MongoDB, that can SSH to Wekan server, and then get MONGO_URL username and password login etc Snap settings with:
But if that Wekan Snap is inside of encrypted Linux VM, only those that have ssh public key access to that VM can modify it, or get those settings. Anyway, Wekan does need to be able to read database login username and password from MONGO_URL to be able to login to database.
In Wekan database, currently passwords are hashed. Other data is plaintext.
Is it needed to worry about accessing server RAM ? There could be some upcoming KVM patches that prevent host accessing quest RAM:
https://lwn.net/Articles/834719/
Regarding various compliance standards, there is SIMP project, that starts from compliant configuration:
https://www.simp-project.com
Other alternative is for compliance Saltstack, although more expensive I think:
https://www.saltstack.com
When compared to some other software:
It could be possible to add to to Wekan encrypting of users data with combined hash from username/emailaddress/password and some other data. But in that case nobody else than that user can have any access to that data, and if that user does forget password, it is not possible to get access anymore.
Then there is physical security:
Some VM tech also allows for encrypting VMs. For example, AFAIK AWS has some features for encrypted VM storage, and probably some other clouds, that do certify their environment. Although, usually Wekan is self-hosted at private servers for those that can not use any public cloud at all.
Similar to SaltStack, but made with Golang, there is mgmt:
https://github.com/purpleidea/mgmt
With mgmt it is possible to immediately automatically respond to some events. For example, if mgmt detects some file has been changed, then it replaces that file with original file. Possibly it can also detect if there is some new software process started, and kill it immediately.
Then there is logging:
Originally posted by: xet7
For process monitoring, there is also https://osquery.io . With it you can make queries for processes, files, etc. I have read some discussion that in some cases it can replace virus scan or other monitoring systems, for example by verifying file hashes, signatures etc.
Ticket changed by: xet7
Originally posted by: xet7
WeKan' s future is not SSPL-licensed MongoDB.