Skip to contentSkip to conversation

Direct logins (via local and ssh) as httpd_admin_r?

DISCUSSION Mark Müller 3 participants 4 messages Aug 28, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hello,

I can't login directly as httpd_admin_r. The default_context is set properly, but the following error occurs:

Local login:

avc: denied { transition } for pid=2178 exe=/bin/login path=/bin/bash dev=08:07 ino=46120 scontext=system_u:system_r:local_login_t tcontext=webadmin:httpd_admin_r:httpd_admin_t tclass=process

SSH login:
avc: denied { transition } for pid=2183 exe=/usr/sbin/sshd path=/bin/bash dev=08:07 ino=46120 scontext=system_u:system_r:sshd_t tcontext=webadmin:httpd_admin_r:httpd_admin_t tclass=process

I cannot solve this neither with:
allow sshd_t httpd_admin_t:process { transition };

nor with
domain_trans(sshd_t, shell_exec_t, httpd_admin_t)

(Login as user_t and newrole -r httpd_admin_r works)

Any solutions?

Thanks in advance.
______________________________________________________________________________
Die witzigsten E-Mail-Adressen der Welt! Schon ab 2 Zeichen! Jetzt auswahlen unter http://digitaledienste.web.de/MyAdress/?mc=021101

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 9 lines · Mark Müller

I can't login directly as httpd_admin_r. The default_context is set properly, but the following error occurs:

Local login:

avc: denied { transition } for pid=2178 exe=/bin/login path=/bin/bash dev=08:07 ino=46120 scontext=system_u:system_r:local_login_t tcontext=webadmin:httpd_admin_r:httpd_admin_t tclass=process

Quoted 7 lines

I cannot solve this neither with:
allow sshd_t httpd_admin_t:process { transition };

nor with
domain_trans(sshd_t, shell_exec_t, httpd_admin_t)

(Login as user_t and newrole -r httpd_admin_r works)

Do you have the following in your rbac file?
allow system_r httpd_admin_r;

I think that the SE Linux log messages should be more verbose in such situations, they should mention when it's a constraint or role issue rather than the usual domain/type issues.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 3 lines · Russell Coker

I think that the SE Linux log messages should be more verbose in such situations, they should mention when it's a constraint or role issue rather than the usual domain/type issues.

This has come up previously. Unfortunately, it isn't that simple. The AVC has no knowledge of the policy logic. It only knows that a particular permission for a particular (SID, SID, class) triple wasn't set in the allowed access vector cached from the security server. In the common case where the access vector is already in the cache due to a prior check on the same (SID, SID, class) triple, the security server is not involved at all in the permission check processing.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
In reply to Mark Müller
Quoted 9 lines · On Wed, 28 Aug 2002, [iso-8859-1] Mark M�ller wrote:

I can't login directly as httpd_admin_r. The default_context is set properly, but the following error occurs:

Local login:

avc: denied { transition } for pid=2178 exe=/bin/login path=/bin/bash dev=08:07 ino=46120 scontext=system_u:system_r:local_login_t tcontext=webadmin:httpd_admin_r:httpd_admin_t tclass=process

SSH login:
avc: denied { transition } for pid=2183 exe=/usr/sbin/sshd path=/bin/bash dev=08:07 ino=46120 scontext=system_u:system_r:sshd_t tcontext=webadmin:httpd_admin_r:httpd_admin_t tclass=process

Quoted 7 lines

I cannot solve this neither with:
allow sshd_t httpd_admin_t:process { transition };

nor with
domain_trans(sshd_t, shell_exec_t, httpd_admin_t)

(Login as user_t and newrole -r httpd_admin_r works)

I think that the httpd_admin_r role and httpd_admin_t domain need some work to be truly useable. In addition to allowing the role transition in policy/rbac and the domain transitions in {ssh.te,login.te}, you need to work out how to deal with home directory types, terminal types, etc. If your web administrator uses a separate account for all web administration tasks, then you could set up a full user role via the full_user_role() macro, with its own home directory type, terminal type, etc.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.