# ------------------------------------------------------------------ # # Copyright (C) 2002-2005 Novell/SUSE # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License published by the Free Software Foundation. # # ------------------------------------------------------------------ # will need to revalidate this profile once we finish re-architecting # the change_hat patch. # # vim:syntax=apparmor #include /usr/sbin/sshd { #include #include #include #include #include capability sys_chroot, capability sys_resource, capability sys_tty_config, capability net_bind_service, capability chown, capability fowner, capability kill, capability setgid, capability setuid, /dev/ptmx rw, /dev/urandom r, /etc/default/locale r, /etc/environment r, /etc/hosts.allow r, /etc/hosts.deny r, /etc/modules.conf r, /etc/security/limits.d/* r, /etc/ssh/* r, /usr/sbin/sshd mrix, /var/run w, /var/run/sshd{,.init}.pid wl, @{PROC}/[0-9]*/fd/ r, @{PROC}/[0-9]*/loginuid w, # should only be here for use in non-change-hat openssh # duplicated from EXEC hat /bin/ash Ux, /bin/bash Ux, /bin/bash2 Ux, /bin/bsh Ux, /bin/csh Ux, /bin/dash Ux, /bin/ksh Ux, /bin/sh Ux, /bin/tcsh Ux, /bin/zsh* Ux, /sbin/nologin Ux, # Call passwd for password change when expired # /usr/bin/passwd Px, # stuff duplicated from PRIVSEP_MONITOR @{HOME}/.ssh/authorized_keys{,2} r, /dev/pts/[0-9]* rw, /etc/ssh/moduli r, @{PROC}/[0-9]*/mounts r, # duplicated from AUTHENTICATED /etc/motd r, /var/run/motd rw, /tmp/ssh-*/agent.[0-9]* rwl, /tmp/ssh-*[0-9]*/ w, # # default subprofile for when sshd has authenticated the user # ^EXEC { #include /bin/ash Ux, /bin/bash Ux, /bin/bash2 Ux, /bin/bsh Ux, /bin/csh Ux, /bin/ksh Ux, /bin/sh Ux, /bin/tcsh Ux, /bin/zsh* Ux, /sbin/nologin Ux, # for debugging # /dev/pts/[0-9]* rw, } # # subprofile for handling network input (privilege seperated child) # ^PRIVSEP { #include #include capability sys_chroot, capability setuid, capability setgid, # for debugging # /dev/pts/[0-9]* rw, } # # subprofile that handles authentication requests from the privilege # seperated child # ^PRIVSEP_MONITOR { #include #include #include #include capability setuid, capability setgid, capability chown, @{HOME}/.ssh/authorized_keys{,2} r, /dev/ptmx rw, /dev/pts/[0-9]* rw, /dev/urandom r, /etc/hosts.allow r, /etc/hosts.deny r, /etc/ssh/moduli r, @{PROC}/[0-9]*/mounts r, # for debugging # /dev/pts/[0-9]* rw, } # # subprofile for post-authentication period until the user's shell is spawned # ^AUTHENTICATED { #include #include #include #include capability sys_tty_config, capability setgid, capability setuid, /dev/log w, /dev/ptmx rw, /etc/default/passwd r, /etc/localtime r, /etc/login.defs r, /etc/motd r, /tmp/ssh-*/agent.[0-9]* rwl, /tmp/ssh-*[0-9]*/ w, # for debugging # /dev/pts/[0-9]* rw, } }