-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Multiple security.yaml files #3432
Comments
The above doesn't sound correct. CLI shouldn't have its own salt and the admin should create the main salt... But generally, every host/site should have its own salt as it is used for example for the form nonces and caching the content. |
I have a similar problem: my website is in a subfolder named "test" of the "mysite.com" main site |
It's also saving plugin config files in this new folder. |
|
It would be Grav/my site. I'm not sure what's confusing about plugin config files. The new folder is the /user/"mysite.com"/config/ folder. In other words, when modifying plugin settings and clicking save (using the admin panel), /user/mysite.com/config/ creates a new plugins folder (if one doesn't already exist) and saves the plugin-name.yaml file there, instead of in /user/config/plugins/plugin-name.yaml. |
Although the behaviour of the creation of folder /user/<domain>/config/ is new, it is a common configuration strategy of Grav to allow different configurations depending on the domain, eg. user/localhost for dev configs and user/mydomain.com for production configs. Think of different caching configuration, debugging, etc. See Environment Configuration The folder structure /user/<domain>/config is the Grav 1,6 way (see here) of separating configurations. The 1.7 way (see here) would be /user/env/<domain>/config As @mahagr explained (which was new to me) every domain/site should have its own salt. To achieve this, different config folders are required. Hence the new folder(s) being created. So, the main issues here is the creation of the /user/cli folder and the fact that the 1.6 structure of Environment Configuration is being used. |
I wonder if this could be a problem when moving the site from a subfolder of "mysite.com <http://mysite.com/>" to its definitive domain (as I've said, I use this environment for testing)...
… Il giorno 2 set 2021, alle ore 17:50, pamtbaau ***@***.***> ha scritto:
@beamaria <https://github.com/beamaria> , @TheoAcker12 <https://github.com/TheoAcker12>
Although the behaviour of the creation of the /user/<domain>/config/ is new, it is a common configuration strategy of Grav to allow different configurations depending on the domain, eg. user/localhost for dev configs and user/mydomain.com for production configs. Think of different caching configuration, debugging, etc. See Environment Configuration <https://learn.getgrav.org/17/advanced/environment-config>
The folder structure /user/<domain>/config* is the Grav 1,6 way (see here <https://learn.getgrav.org/16/advanced/environment-config#automatic-environment-configuration>) of separating configurations. The 1.7 way (see here <https://learn.getgrav.org/17/advanced/environment-config#automatic-environment-configuration>) would be /user/env/<domain>/config
As @mahagr <https://github.com/mahagr> explained (which was new to me) every domain/site should have its own salt. To achieve this, different config folders are required. Hence the new folder(s) being created.
So, the main issues here is the creation of the /user/cli folder and the fact that the 1.6 structure of Environment Configuration is being used.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#3432 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACZG6TVP2F2DXD5KS7EK5ATT76TONANCNFSM5DH7PCTQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I confer. My sites (envs) folder name in $folder = "sites/{$name}" and I have
|
Whatever this is, it came with Grav 1.7.20, and it's definitely wrong. I just logged into my host, and found a pile of directories under
Mind you, my setup is an Ubuntu 20.04 LTS cloud server running NGINX and I have it configured to only serve up "subdomain.mydomain" as it were. I installed Grav in
and that is what NGINX points the root at. And while I MIGHT understand one or two of these domain directories (at least as far as that they exist, not that Grav went and added these subdirectories), along with IPs and domains that have NOTHING to do with my site, there are directories showing domains I own with subdomains that simply do not exist!! All are timestamped beginning from when I upgraded Grav 1.7.18 to 1.7.20 on 2 Sep. through 4 Sep., with some FQDNs being ones I do not even recognize (e.g., seda9.bet) while others are not for this site but get redirected here (several I did not even realize were doing that). Honestly, this is just nasty whatever this is. Not sure what you all were aiming for with this, but it's just poor form. If I had to guess, anyone who sets up an FQDN even with a forward to land on your Grav site is going to pollute your directory structure, as I have 2 directories with IP addresses (one which is accurate for the hosting system the site is on, the other absolutely not). All I can guess is that if bots/spiders/etc. are probing for FQDNs (whether you created them or not) and they land on your site, Grav is generating these directories. Why is anyone's guess, but it is, frankly, a horrible idea and just screams for abuse. NOTE: I am going to delete all of these and see whether they regenerate over the next few days. But honestly... just no. |
I just tested, and sure enough, as soon as I logged into my admin page, it regenerated the directory To be clear, I have never run anything less than Grav 1.7. That's what I started with. I've updated over time using the Grav Admin panel, and to date things have worked quite well. But this... is just horrible frankly. Oh, and I have no Anyway, this feature really muddies up the directory structure something fierce. If you need more specifics, let me know. But truth is, the fact I found directories with names implying subdomains like support.mydomain.com or stage.mydomain.com that simply do not even exist, not to mention domains like |
Grav uses What you comment about external sites is indeed worrying. Let's hope developers have a quick look into this. |
@fseesink, I can (partly) confirm the behaviour you're seeing. For each subdomain.domain with which the site can be reached, a new /user/subdomain.domain/config/security.yaml (or /user/env/subdomain.domain/config/security.yaml) is being created.
However, this behaviour only happens on my local dev machine (Windows 10/WSL/Ubuntu-20.04/Apache. On my production server, I cannot access sites using non-existing subdomains. Nor can I access xxx.google.com, xxx.grav.org, xxx.mozilla.org, xxx.netflix.com, xxx.facebook.com, etc. Error DNS_PROBE_FINISHED_NXDOMAIN is being thrown. It makes me wonder how your sites can be accessed using non-existing subdomains and even unknown IP addresses. Also note, when folder /user/env exists, all <domain>/config/security.yaml files are being created in folder /user/env. As a side note, I experience the tone of voice in your posts as a bit, uhm, "unpleasant". But that might just be me, not being a native English speaker. |
@vitaminace33 Regarding So to the Grav folks, if there is supposed to be a @pamtbaau Though not my intention to sound "unpleasant", I could see how it came across that way. Yes, I was surprised (and not in a good way) to see my So yes, I wasn't thrilled. But you're right. It could have sounded better. So apologies to anyone if I came across too harshly. My main concern is to see this fixed ASAP, as this could require a bit of cleanup for folks the longer this lasts. If nothing else, it would be nice to disable this. Now, regarding where all the directory names came from, I believe I at least have a partial answer. I've had this cloud server for a bit. It's a pretty stock setup of Ubuntu 20.04 LTS with NGINX using Now I had configured my So in the end I tweaked the main
before including those *.conf files. So now for any FQDNs not specifically handled by those *.conf files, the server simply does not respond. Best I can guess on the IP address directory I did not recognize as well as that seda9.bet one is that due to my config, if anyone out there was using tools that somehow created FQDNS which pointed at my server's IP, that would create this mess. Now why they're doing that is anyone's guess, but I'm sure it wasn't for any good reason. Hopefully this clamps things down to just the FQDNs I actually have/care about. But yes, I could see others being in a similar situation using stock setups. |
Quick note: I manually created the |
I also created |
Wow. Even though I have things configured and working so that only subdomain.domain loads the Grav site, and that the other domains (also mapped to same IP) are sent a 444 code (so none return a proper webpage), I'm still seeing a directory being created for each of them. What the ?? The IP of the server is back, as is |
Bloody heck. Well this feature sure has made me go look at my whole setup. Ok, I figured out how the nonexistent subdomains were creeping in. I started by tinkering, eventually noticing that if I did a |
Just FYI: For anyone running a Grav site where their webserver configuration responds to HTTP/S requests to the server's IP (which is a rather common configuration), be advised that polluting your Grav directory structure is a trivial task. I have reported this to the devs with an example. |
I can confirm that this behaviour is both in main websites (official FQDN) and in their subfolders. I have a website that is virtually ready to go online, but I'll wait till this issue is solved...Don't want an official website to be hacked or have security issues! |
This is the fix that triggers the files to be added: ab97831 It cannot be changed as it fixes another bad bug where environments without configuration files were ignored. So I ended up using a bit different approach to fix this bug. |
Hi Matias, thanks for the explanation. Is this fixing already in 1.7.20 or we have to wait till the next version? |
@mahagr, Not sure if the fix fixes the issue... Steps for installing Grav in folder /www/grav/grav-admin:
The following file is being created in the root of Grav:
Also, you explained that each domain/site should have its own |
Looks like I had a typo. For some unknown reason it was working properly in my case. |
Issue solved. But what about your initial remark that every site/domain should have its own salt? Now, there is only one salt inside /user/config/security.yaml no matter the domain I've used to access the site. |
If you create folder So I'm assuming that if you have a different site, you also have something custom in its configuration. |
Tested it and you are correct. File |
Sounds like it's fixed then! |
Hi Matias,
I have a site developed in localhost with a folder /user/localhost/config/plugins folder and security.yaml file
Is it ok if I cancel the folder localhost and then upload the zipped files of the site to the official domain?
I made the local backup zipped site using the BU tool in admin Panel
… Il giorno 14 set 2021, alle ore 11:42, Matias Griese ***@***.***> ha scritto:
Sounds like it's fixed then!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#3432 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACZG6TRYBQD2W3JSCKM5XFDUB4RJBANCNFSM5DH7PCTQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
We will be releasing likely today, so no need to do that. |
To @mahagr and everyone who worked on this, thank you. I have just updated to Grav 1.7.21 (along with patching various plugins) and can confirm the issue we noted earlier has been handled. I adjusted my webserver config to accept connections by IP (as I had that disabled), then tried brute forcing as I'd done before. But no new directories/etc. However, if I did as mentioned and created a Again, appreciate the quick response, and all the work done on Grav. I really like using it. |
Thanks to Matias and to the Grav team! |
!@#$%^&* I spoke too soon. YES, the issue of potential randomly generated directories appears fixed, but in the process something else has now been horribly borked. I can't seem to save ANY pages anymore since upgrading to Grav 1.7.21. sigh This is frustrating. |
I cannot reproduce the behaviour you are experiencing.... I'm using a fresh install of Grav 1.7.21 + Admin and pages Home and Typography can be changed and saved correctly... Also new pages are being saved successfully. |
Is the above by desing? If so, why?
If all three are required, why not using /user/env/cli/config/security.yaml and /user/env/localhost/config/security.yaml?
The text was updated successfully, but these errors were encountered: