FS#3644 - ssh upgrade should not overwrite config
Attached to Project:
Arch Linux
Opened by jan willem (jw) - Wednesday, 21 December 2005, 09:36 GMT
Last edited by Paul Mattal (paul) - Thursday, 09 February 2006, 16:07 GMT
Opened by jan willem (jw) - Wednesday, 21 December 2005, 09:36 GMT
Last edited by Paul Mattal (paul) - Thursday, 09 February 2006, 16:07 GMT
|
Details
It seems that certain upgrades of ssh move the sshd_config
file to sshd_config.pacsave and replace it with the default
shipped version (4.1p1-1 -> 4.2p1-1 and 4.0p1-1 ->
4.1p1-1 in my log).
This is somewhat a matter of opinion, but I consider this an important security risk. This is why: If some users have weak passwords one might have restricted ssh login with AllowUsers or AllowGroups. If these settings unwittingly get overwritten by an upgrade the system becomes VERY vulnerable. I know there is a notice that the config has been moved to a .pacsave, but when upgrading a large number of packages this is easy to miss. I'm not sure what the best alternative would be, but I would prefer writing the config to a .pacnew file. I guess there are security implications for this as well, but I would consider these less severe. |
This task depends upon
Add "NoUpgrade etc/ssh/sshd_config" to it
The bug you describe is the default way of working for any package.
If you add the NoUgrade flag the new config is saved to .pacnew ;)
Now I must add almost all my /etc to NoUgrade. I added hosts, hosts.allow, hosts.deny, host.conf, even issue!
IMO it would be better to change the default behaviour to not replacing ANY config files and add new option AllowUpgrade to allow pacman to upgrade some config files, saving old config file as .pacsave
I think most users will prefer this behaviour. In MOST cases old configs would work with newer version of package. Why would anyone need that his/her configs be replaced with default configs of upgraded package? Especially on a server? Or if someone want's to automatically upgrade his/her system, why he/she must place almost all config files in NoUpgrade?
Nonetheless, I agree with Roman that saving to .pacnew by DEFAULT seems like safer behaviour. I'd prefer pacman to notify me that a shipped config file differs from a the last shipped version (ie. defaults have changed, or new values were added) and save the new default config to a .pacnew, so I can do a diff to see what's changed.
Btw, does pacman currently always overwrite, or just when the shipped config file has actually changed wrt the last version?
Another bad thing with current upgrading system: when upgrading filesystem package my /etc/issue was overwritten and no issue.pacsave created! This is really BAD behaviour!
Packages can provide tracking of changes in default config files but this is done only for really important packages like kerned, filesystem, udev etc.
I hate the way gentoo does it, you need too change ALL config changes by hand.
Most of us only change 10 of the /etc files max right ?
so why should i change all other updates by hand ?
Would you like to update all dbus/hal/udev/hotplug changes always by hand ?
hmmm the issue.pacsave thing is a bug probably...
i will notify apeiro of it.
etc/issue needs to be added to the backup array.
However, when I thought about this again just now I thought of the following issue: This method wouldn't work if a user misses a few upgrades. In order to make this behaviour work correctly one would have track the package version where the current shipped config was introduced. The config file would then be updated is version of the config file in the new package is higher than the version in the installed package. This becomes a bit akward, but not impossibly so.
Anyway, what to do with config files by default is a separate discussion. My request here is that the openssh package is modified not to overwrite by default. The ssh config, like hosts.allow and hosts.deny is critical to system security, so I think it is a bad idea to silently overwrite it.
* Pacman should not replace config files, saving them in .pacsave!
* it should save new config files in .pacnew BY DEFAULT!
* add new option AllowUpgrade
About tracking changed in default config files (if this will be implemented ever):
* every config file should have a string like #version: 20051207 (or version: 20051207-2 if there were two changes in the same day)
* pacman should compare versions of existing config file and the default config of upgraded package, and if default config has changed it should alert user like this way: "NOTE: default config files in package-x.y.z changed!"
I'm willing to take a stab at implementing this if nobody else has got the time. It really gives people on each side of this issue (or both sides, like me!) the best set of solutions.
http://bugs.archlinux.org/task/3620#comment7761
Can we close this bug?