Skip to content
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

login on embedded systems #342

Closed
minimaxwell opened this issue Jan 28, 2021 · 4 comments
Closed

login on embedded systems #342

minimaxwell opened this issue Jan 28, 2021 · 4 comments

Comments

@minimaxwell
Copy link

Hello,

While working on supporting the refpolicy on embedded systems generated using Buildroot, I stumbled upon a login issue where the login system gets blocked from accessing the shadow_t context.

I'm using a serial connexion handled by agetty and the util-linux login program.

The following logs are output when asked for a password :

buildroot login: root
kauditd_printk_skb: 2 callbacks suppressed
audit: type=1400 audit(1611839506.969:51): avc: denied { noatsecure } for pid=76 comm="agetty" scontext=system_u:system_r:getty_t tcontext=system_u:system_r:local_login_t tclass=process permissive=0
audit: type=1400 audit(1611839506.969:51): avc: denied { rlimitinh } for pid=76 comm="login" scontext=system_u:system_r:getty_t tcontext=system_u:system_r:local_login_t tclass=process permissive=0
audit: type=1400 audit(1611839506.969:51): avc: denied { siginh } for pid=76 comm="login" scontext=system_u:system_r:getty_t tcontext=system_u:system_r:local_login_t tclass=process permissive=0
audit: type=1400 audit(1611839507.069:52): avc: denied { read } for pid=76 comm="login" name="shadow" dev="vda" ino=88 scontext=system_u:system_r:local_login_t tcontext=system_u:object_r:shadow_t tclass=file permissive=0
Password:

Then, no matter the password entered, the login fails.

One thing to note is that these logs are only output when building with "make enableaudit", so the messages are hidden by a noaudit rule by default.

Since this issue concerns the login process and accessing the shadow file, I'd rather get your opinion on that before trying to come-up with a patch.

Adding "auth_read_shadow(local_login_t)" to the policy allows to login, but this doesn't look like this is the right solution.

I'd therefore like have your inputs in that particular issue,

Thanks a lot,

Maxime

@ghost
Copy link

ghost commented Jan 28, 2021 via email

@ghost
Copy link

ghost commented Jan 28, 2021 via email

@ghost
Copy link

ghost commented Jan 28, 2021

... then again, especially on embedded systems, you probably might want to exclude the authlogin module altogether (amongst many other modules) the issue is that doing this will open up another can of worms.

@pebenito
Copy link
Member

@minimaxwell please see if #364 will address your needs. I added an authlogin_pam tunable that is default to true, so existing users are not impacted. If you set it to false, it will add the shadow_t access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants