-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
packaging: Require account validation with pam_unix.so if PAM enabled #15163
Conversation
Possible to get @eqvinox to look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard NAK.
PAM
is incomplete in FRR and should in fact be disabled. It would only work correctly if vtysh
is setuid root. pam_unix.so
requires root privileges, which you don't have when executing vtysh
.
A possible reason to ship FRR with PAM enabled is so that users can enable it without rebuilding FRR, by first setting vtysh setuid root and then making a PAM config. However, we do not test this and it very likely does not work correctly and creates security holes.
OTOH the reason why we're not disabling PAM is probably that users and distro packagers would get confused ("why are you removing security?".) It's a bit of a stupid situation.
Actually the correct fix here is to replace Except then people will complain that we created a security hole on their system by opening something up. sigh |
More context: #14745 |
Actually it looks like we ignore the PAM result anyway. Which means maybe we can fix this properly because that means we can't be breaking someone's security (because it was already broken, lol.) |
Ok. Yeah. So. This is what we're currently doing: https://github.com/FRRouting/frr/blob/master/vtysh/vtysh_user.c#L51-L74
⇒ the entirety of PAM in FRRouting is non-functional Generally speaking, all |
Okay, so just to "hide" the warnings, we can use pam_permit.so? I can change that if this is the only change. |
Yes. In lieu of either disabling it completely, or completely reworking it to do something useful (which would involve making vtysh I would also add a comment to the NB: |
f67c50f
to
3623e45
Compare
3623e45
to
a1907fc
Compare
With a current pam_rootok.so, it works only with `root` account. If the user is under `frrvty`, `frr` group, it gets the error: ``` % groups | grep -o -E "frrvty|frr" frrvty frr % vtysh -c 'end' vtysh_pam: Failed in account validation: Permission denied(6) ``` Checking the logs: ``` vtysh[23930]: pam_rootok(frr:account): root check failed ``` Signed-off-by: Donatas Abraitis <[email protected]>
a1907fc
to
e68c4f0
Compare
With a current pam_rootok.so, it works only with
root
account. If the user is underfrrvty
,frr
group, it gets the error:Checking the logs:
Let's require a valid user, instead of the root user only.