public inbox for gentoo-hardened@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-hardened] SELinux (strict policy) and ssh
@ 2010-11-14 12:40 luc nac
  2010-11-14 12:54 ` klondike
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: luc nac @ 2010-11-14 12:40 UTC (permalink / raw
  To: gentoo-hardened

Hi everybody, I'm learning how to use SELinux and I'm experiencing
some difficulties. I write here hoping that someone can help me.

I just installed SELinux (strict policy) in a Gentoo-based
distribution (Linux kernel version 2.6.24) following the handbook's
instructions http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml

Is it right that I can still login (or switch to the sysadm_r role)
via ssh to that machine even if the boolean "ssh_sysadm_login" is set
"off"?
What tests can I do to confirm that SELinux is correctly working?

lucnac@plgd:~$ ssh root@192.168.1.203
Password:
Last login: Sun Nov 14 13:54:26 2010 from unknown
Could not chdir to home directory /root: Permission denied
-bash: /root/.bash_profile: Permission denied
localhost / # id -Z
root:staff_r:staff_t
localhost / # newrole -r sysadm_r
Authenticating root.
Password:
localhost / # id -Z
root:sysadm_r:sysadm_t


This is the output of "sestatus -v":
localhost / # sestatus -v
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        strict

Process contexts:
Current context:                root:staff_r:staff_t
Init context:                   unknown (Permission denied)

File contexts:
Controlling term:               root:object_r:staff_devpts_t
/sbin/init                      system_u:object_r:init_exec_t
/sbin/agetty                    system_u:object_r:getty_exec_t
/bin/login                      system_u:object_r:login_exec_t
/sbin/rc                        system_u:object_r:initrc_exec_t
/sbin/runscript.sh              system_u:object_r:initrc_exec_t
/usr/sbin/sshd                  system_u:object_r:sshd_exec_t
/sbin/unix_chkpwd               system_u:object_r:chkpwd_exec_t
/etc/passwd                     system_u:object_r:etc_t
/bin/sh                         system_u:object_r:bin_t ->
system_u:object_r:shell_exec_t
/bin/bash                       system_u:object_r:shell_exec_t
/usr/bin/newrole                system_u:object_r:newrole_exec_t
/lib/libc.so.6                  system_u:object_r:lib_t ->
system_u:object_r:shlib_t
/lib/ld-linux.so.2              system_u:object_r:lib_t ->
system_u:object_r:ld_so_t


...and this is the output of "getsebool -a" (everything is off):
localhost / # getsebool -a
allow_execheap --> off
allow_execmem --> off
allow_execmod --> off
allow_execstack --> off
allow_java_execstack --> off
allow_mplayer_execstack --> off
allow_polyinstantiation --> off
allow_ptrace --> off
allow_rsync_anon_write --> off
allow_ssh_keysign --> off
allow_user_mysql_connect --> off
allow_user_postgresql_connect --> off
allow_write_xshm --> off
allow_ypbind --> off
cron_can_relabel --> off
fcron_crond --> off
global_ssp --> off
mail_read_content --> off
mozilla_read_content --> off
nfs_export_all_ro --> off
nfs_export_all_rw --> off
read_default_t --> off
read_untrusted_content --> off
secure_mode --> off
secure_mode_insmod --> off
secure_mode_policyload --> off
ssh_sysadm_login --> off
use_nfs_home_dirs --> off
use_samba_home_dirs --> off
user_direct_mouse --> off
user_dmesg --> off
user_ping --> off
user_rw_noexattrfile --> off
user_tcp_server --> off
user_ttyfile_stat --> off
write_untrusted_content --> off
xdm_sysadm_login --> off



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-15  1:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-14 12:40 [gentoo-hardened] SELinux (strict policy) and ssh luc nac
2010-11-14 12:54 ` klondike
2010-11-14 20:23 ` Sven Vermeulen
2010-11-15  0:26 ` Chris Richards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox