[MDEV-7032] new pam plugin with a suid wrapper Created: 2014-11-06 Updated: 2021-09-01 Resolved: 2018-07-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugin - pam |
| Fix Version/s: | 10.4.0 |
| Type: | Task | Priority: | Critical |
| Reporter: | Sergei Golubchik | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | 10.4.0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
PAM authentication in many cases only works if done by the root user or the user that is authenticating itself. For example, to read /etc/shadow one has to be root. unix_chkpwd wrapper, created specifically to loosen this requirement, checks that user name matches the current UID. Google-authenticator PAM module reads the data from ~user/ home directory — again, can be only done as root or that user. And so on. A solution to all these problems could be a small setuid wrapper that pam plugin invokes. Perhaps this wrapper should check that it is invoked as mysql user… |
| Comments |
| Comment by Hartmut Holzgraefe [ 2014-11-06 ] |
|
> Perhaps this wrapper should check that it is invoked as mysql user… This is an absolute must requirement IMHO to not expose /etc/shadow password information to a random user But all in all I think that pam_unix doesn't work as a general authentication mechanism by design and that no new tools to work around this should be distributed ... If /etc/shadow based authentication is a must then explicitly adding user "mysql" the "shadow" group looks like a better approach as it requires explicit admin action ... problem right now though is that this automatically exposes |
| Comment by Sergei Golubchik [ 2014-11-08 ] |
|
/etc/shadow is just one use case. S/Key stores data in /etc/skeykeys. I've got complains about google-authenticator too. Many other PAM modules store data in $HOME. This setuid wrapper is the only solution I can think of that solves all these issues. |
| Comment by Alexey Botchkov [ 2018-07-03 ] |
|
Fixed along with the |
| Comment by Christopher Halbersma [ 2018-07-09 ] |
|
> Fixed along with the Nice. |