Page 1 of 2

Enforce Security - Nextcloud and Onlyoffice

Posted: Wed Oct 31, 2018 8:57 am
by lorenzoform
I'm using onlyoffice with nextcloud. In nextcloud I simply typed the url of onlyoffice and saved the configuration and after that I started using them togheter.

How can I sure that onlyoffice is secure and nobody can use it in an unwanted way? In fact I don't think it's an exclusive relationship between nextcloud and onlyoffice, is it there a way to limit the usage of onlyoffice only with our nextcloud, or any way to improve security?


Regards.

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Wed Oct 31, 2018 12:56 pm
by Carl
Hello,

You can enable JSON Web Token in Document Server config for more security:
https://api.onlyoffice.com/editors/security
https://api.onlyoffice.com/editors/signature/

Note: starting from Document Server version 5.2, JWT is enabled in local.json config.
You also need to indicate the exact secret value in ONLYOFFICE integration app settings in Nextcloud for connection to work.

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Thu Nov 01, 2018 4:33 pm
by lorenzoform
Hi,

in default.json I defined and enabled secret as in the documentation and restarted the onlyoffice server:


"secret": {
"browser": {"string": "secret", "file": "", "tenants": {}},
"inbox": {"string": "Secret_TEST", "file": "", "tenants": {}},
"outbox": {"string": "Secret_TEST", "file": ""},
"session": {"string": "secret", "file": ""}
},
"token": {
"enable": {
"browser": true,
"request": {
"inbox": true,
"outbox": true
}
},

but the nextcloud continue to work with onlyoffice without problem, as no secret defined. Is it normal?
Where do I need to define the secret in nextcloud?

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Fri Nov 02, 2018 1:08 pm
by Carl
Please specify the version of document server you are using.

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Mon Nov 05, 2018 8:45 am
by lorenzoform
Onlyoffice 5.2.2-2 and if you need Nextcloud 14.0.3.

Regards.

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Tue Nov 06, 2018 6:36 am
by Carl
Hello,
Carl wrote:Note: starting from Document Server version 5.2, JWT is enabled in local.json config.
Please open /etc/onlyoffice/documentserver/local.json and enable JWT and secret there. Don't forget to restart DS services after changing the config: supervisorctl restart all

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Tue Nov 06, 2018 8:26 pm
by lorenzoform
lorenzoform wrote:Hi,

in default.json I defined and enabled secret as in the documentation and restarted the onlyoffice server:


"secret": {
"browser": {"string": "secret", "file": "", "tenants": {}},
"inbox": {"string": "Secret_TEST", "file": "", "tenants": {}},
"outbox": {"string": "Secret_TEST", "file": ""},
"session": {"string": "secret", "file": ""}
},
"token": {
"enable": {
"browser": true,
"request": {
"inbox": true,
"outbox": true
}
},

but the nextcloud continue to work with onlyoffice without problem, as no secret defined. Is it normal?
Where do I need to define the secret in nextcloud?
I confirm that I made these changes to /etc/onlyoffice/documentserver/local.json , after that I restarted the entire server.

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Wed Nov 07, 2018 7:14 am
by Carl
Restarting the container reverts the changed parameters of document server config to default values (set via environment variable). Please open the local.json file and check if JWT is enabled. You need to restart only document server services after changing the config.

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Tue Dec 11, 2018 3:51 pm
by lorenzoform
Sorry for delay,
I had temporarily suspended the project.
I think it's there some confusing between local and default json.
Now it's work also restarting the VM.
Where do I need to place the token into Next Cloud ?
My .htaccess in Next Cloud contains following rows:


<IfModule mod_headers.c>
<IfModule mod_setenvif.c>
<IfModule mod_fcgid.c>
SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</IfModule>
<IfModule mod_proxy_fcgi.c>
SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
</IfModule>

Re: Enforce Security - Nextcloud and Onlyoffice

Posted: Tue Dec 18, 2018 12:58 pm
by Maxim
Hello!
Where do I need to place the token into Next Cloud ?
You need to put your secret key in Onlyoffice settings of Nextcloud.
Settings - Nextcloud .png
Settings - Nextcloud .png (28.66 KiB) Viewed 1196 times