-
Notifications
You must be signed in to change notification settings - Fork 3
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
pam_tcb: Add support for user authentication with SELinux. #10
base: main
Are you sure you want to change the base?
Conversation
I wonder wouldn't we better off if the code was written as if selinux is always enabled? |
Well, we would lose the sanity checks on systems without SELinux. Otherwise I don't see any. |
This sounds dangerous:
Also, how would |
These sanity checks make sense even if selinux is enabled, they just have to be adjusted so that |
You mean sth like this, I guess:
|
I mean something like this (completely untested):
|
That solution works, tested on Fedora 36 (Rawhide) with a little tweak to the SELinux policy ( But Before I start to implement that, I'd like to hear your oppinions towards it, @ldv-alt and @solardiz, as we have two options here:
After that is done, I will proceed with implementing the change pw step adjustments. |
@besser82 Out of the two options you list, I prefer adding a command-line option to That said, I am not yet sure the rest of this proposal is entirely right. I'll need to take a closer look. Also, how does |
From looking at the refpolicy and the fedora targeted policy
I will push the reworked changes as outlined by @ldv, when I'm done with the check acct changes, will make more sense to review afterwards.
They use two helper binaries: |
This is needed if e.g. SELinux prevents access to file storing the hashed user password. Signed-off-by: Björn Esser <[email protected]>
Refactor the function to be non-static and to allow for more versatile use. Signed-off-by: Björn Esser <[email protected]>
c8858c8
to
0f39f93
Compare
The tcb_chkpwd helper binary is now able to also perform verifications for the expiration of user accounts. Signed-off-by: Björn Esser <[email protected]>
…unt. Perform verification through an external helper binary to possibly gain higher privileges if the verification fails for insufficient credentials in the first time. Signed-off-by: Björn Esser <[email protected]>
0f39f93
to
1d98de0
Compare
I'm sorry, I won't be able to review anything till November. |
@ldv-alt Do you have some time to spend on this, yet? Don't feel to be pushed, I'm just asking to be able to do some planning. |
On Wed, Nov 17, 2021 at 11:48:42AM -0800, Björn Esser wrote:
@ldv-alt Do you have some time to spend on this, yet? Don't feel to be pushed, I'm just asking to be able to do some planning.
I'll look at this as soon as I get strace 5.15 released, hopefully this weekend.
|
if (on(UNIX_SHADOW)) { | ||
memcpy(config, "shadow\0\0", 8); | ||
} else { | ||
memcpy(config, "passwd\0\0", 8); | ||
} |
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.
Sorry, I don't understand this on(UNIX_SHADOW)
check, given that pam_sm_acct_mgmt invokes set(UNIX_SHADOW)
unconditionally.
NSA Security-Enhanced Linux (SELinux) is an implementation of a flexible mandatory access control architecture in the Linux operating system. Background information and technical documentation about SELinux can be found at https://github.com/SELinuxProject.
With SELinux running in enforced mode even read-access to the shadow files, which the hashed user passwords are stored
in, is restricted to processes that have at least been granted
shadow_t:file read
capabilites by the SELinux policy. For thatreason the login authentication of a user must always be performed by the
tcb_chkpwd
helper binary.SELINUX_ENABLED
.The needed changes have already been applied to the SELinux reference-policy in SELinuxProject/refpolicy@bc88a1c.