Open manuelroccon opened 4 years ago
Hi @manuelroccon. Did you enable NextCloud exclusion rules in rule id:900130
in crs-setup.conf
?
@manuelroccon Any comments so we can figure this out?
I use secremovebyid in apache vhost configuration. This is right method to fix this issue?
Depends.
You need to first enable the exclusion rules for NextCloud. Can you please check the file crs-setup.conf
, and search for 900130
?
Then you need to have something like this:
SecAction \
"id:900130,\
phase:1,\
nolog,\
pass,\
t:none,\
setvar:tx.crs_exclusions_nextcloud=1"
That will effectively enable the exclusions we have for NextCloud. Without that, the rules to prevent this are not enabled!
@manuelroccon Can you check this please? :point_up:
ok, this exclusion rules not enabled in crs-setup.conf. But if i've more vhosts in my server with different CMS, can I put this exclusion directive only in vhost configuration that running Nextcloud?
@manuelroccon You can also do this:
# It is recommended if you run multiple web applications on your site to limit
# the effects of the exclusion to only the path where the excluded webapp
# resides using a rule similar to the following example:
# SecRule REQUEST_URI "@beginsWith /wordpress/" setvar:tx.crs_exclusions_wordpress=1
Give a quick look at the whole crs-setup.conf
file to get a taste what you can do.
@fzipi thank for your support,
The crs-setup.conf are default, i've not modify it of master brench.
I've read this recommendation about REQUEST_URI "@beginsWith /wordpress/" in crs-setup.conf, but REQUEST_URI of vhosts not start with specific pattern. All vhosts are separate domain. If i make this exclusion in crs-setup.conf is applied to all sites inside server.
So I think i must put this directive (SecAction "id:900130,) directly inside the apache vhost config, to apply this only specific vhost (in this case in nextcloud).
Is fine this tipe of configuration for you or there are other solutions?
Hi @manuelroccon,
Hmmm.. :thinking: you will definitely need to apply this to a particular url/vhost. One technique I normally use in these cases is to use the SecWebAppId
directive.
For example (you may need to modify it a bit, it is just a rough idea),
<VirtualHost Z.Z.Z.Z:44>
SecWebAppId my-nextcloud
...
...
</VirtualHost>
# And then:
SecRule WEBAPPID "@eq my-nextcloud" "setvar:tx.crs_exclusions_wordpress=1"
Please check the documentation for more examples.
Type of Issue
False positive
Description
I've just configured rules. Last version of Nextcloud give me this errors.
Audit Logs / Triggered Rule Numbers
--4693d56e-A-- [11/Apr/2020:16:00:06 +0300] XpG-VqTsDq4eM7zXEJkhRwAAAEs 123.123.123.123 53284 123.123.123.123 443 --4693d56e-B-- PROPFIND /remote.php/dav/files/user/ HTTP/1.1 Host: nextcloud.domanin.it Depth: 0 Authorization: Basic= User-Agent: Mozilla/5.0 (Macintosh) mirall/2.6.4stable (build 20200303) (Nextcloud) Accept: / Content-Type: text/xml; charset=utf-8 X-Request-ID: be437f90-c473-40a7-8b98-a519a3473402 Cookie: oc_sessionPassphrase=; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; oc20oosppk3h= Content-Length: 114 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: en-US,*
--4693d56e-C-- <?xml version="1.0" ?>