Enforce Security - Nextcloud and Onlyoffice

lorenzoform
Posts: 9
Joined: Wed Oct 24, 2018 7:23 am

Enforce Security - Nextcloud and Onlyoffice

Post by lorenzoform » Wed Oct 31, 2018 8:57 am

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.

Carl
Posts: 160
Joined: Thu Apr 12, 2018 10:00 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by Carl » Wed Oct 31, 2018 12:56 pm

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.

lorenzoform
Posts: 9
Joined: Wed Oct 24, 2018 7:23 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by lorenzoform » Thu Nov 01, 2018 4:33 pm

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?

Carl
Posts: 160
Joined: Thu Apr 12, 2018 10:00 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by Carl » Fri Nov 02, 2018 1:08 pm

Please specify the version of document server you are using.

lorenzoform
Posts: 9
Joined: Wed Oct 24, 2018 7:23 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by lorenzoform » Mon Nov 05, 2018 8:45 am

Onlyoffice 5.2.2-2 and if you need Nextcloud 14.0.3.

Regards.

Carl
Posts: 160
Joined: Thu Apr 12, 2018 10:00 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by Carl » Tue Nov 06, 2018 6:36 am

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

lorenzoform
Posts: 9
Joined: Wed Oct 24, 2018 7:23 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by lorenzoform » Tue Nov 06, 2018 8:26 pm

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.

Carl
Posts: 160
Joined: Thu Apr 12, 2018 10:00 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by Carl » Wed Nov 07, 2018 7:14 am

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.

lorenzoform
Posts: 9
Joined: Wed Oct 24, 2018 7:23 am

Re: Enforce Security - Nextcloud and Onlyoffice

Post by lorenzoform » Tue Dec 11, 2018 3:51 pm

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>

Maxim
Posts: 1859
Joined: Tue Oct 11, 2016 2:34 pm

Re: Enforce Security - Nextcloud and Onlyoffice

Post by Maxim » Tue Dec 18, 2018 12:58 pm

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 664 times

Post Reply