1NAMESPACE.CONF(5)              Linux-PAM Manual              NAMESPACE.CONF(5)
2
3
4

NAME

6       namespace.conf - the namespace configuration file
7

DESCRIPTION

9       The pam_namespace.so module allows setup of private namespaces with
10       polyinstantiated directories. Directories can be polyinstantiated based
11       on user name or, in the case of SELinux, user name, sensitivity level
12       or complete security context. If an executable script
13       /etc/security/namespace.init exists, it is used to initialize the
14       namespace every time an instance directory is set up and mounted. The
15       script receives the polyinstantiated directory path and the instance
16       directory path as its arguments.
17
18       The /etc/security/namespace.conf file specifies which directories are
19       polyinstantiated, how they are polyinstantiated, how instance
20       directories would be named, and any users for whom polyinstantiation
21       would not be performed.
22
23       When someone logs in, the file namespace.conf is scanned. Comments are
24       marked by # characters. Each non comment line represents one
25       polyinstantiated directory. The fields are separated by spaces but can
26       be quoted by " characters also escape sequences \b, \n, and \t are
27       recognized. The fields are as follows:
28
29       polydir instance_prefix method list_of_uids
30
31       The first field, polydir, is the absolute pathname of the directory to
32       polyinstantiate. The special string $HOME is replaced with the user´s
33       home directory, and $USER with the username. This field cannot be
34       blank.
35
36       The second field, instance_prefix is the string prefix used to build
37       the pathname for the instantiation of <polydir>. Depending on the
38       polyinstantiation method it is then appended with "instance
39       differentiation string" to generate the final instance directory path.
40       This directory is created if it did not exist already, and is then bind
41       mounted on the <polydir> to provide an instance of <polydir> based on
42       the <method> column. The special string $HOME is replaced with the
43       user´s home directory, and $USER with the username. This field cannot
44       be blank.
45
46       The third field, method, is the method used for polyinstantiation. It
47       can take these values; "user" for polyinstantiation based on user name,
48       "level" for polyinstantiation based on process MLS level and user name,
49       "context" for polyinstantiation based on process security context and
50       user name, "tmpfs" for mounting tmpfs filesystem as an instance dir,
51       and "tmpdir" for creating temporary directory as an instance dir which
52       is removed when the user´s session is closed. Methods "context" and
53       "level" are only available with SELinux. This field cannot be blank.
54
55       The fourth field, list_of_uids, is a comma separated list of user names
56       for whom the polyinstantiation is not performed. If left blank,
57       polyinstantiation will be performed for all users. If the list is
58       preceded with a single "~" character, polyinstantiation is performed
59       only for users in the list.
60
61       The method field can contain also following optional flags separated by
62       : characters.
63
64       create=mode,owner,group - create the polyinstantiated directory. The
65       mode, owner and group parameters are optional. The default for mode is
66       determined by umask, the default owner is the user whose session is
67       opened, the default group is the primary group of the user.
68
69       iscript=path - path to the instance directory init script. The base
70       directory for relative paths is /etc/security/namespace.d.
71
72       noinit - instance directory init script will not be executed.
73
74       shared - the instance directories for "context" and "level" methods
75       will not contain the user name and will be shared among all users.
76
77       The directory where polyinstantiated instances are to be created, must
78       exist and must have, by default, the mode of 0000. The requirement that
79       the instance parent be of mode 0000 can be overridden with the command
80       line option ignore_instance_parent_mode
81
82       In case of context or level polyinstantiation the SELinux context which
83       is used for polyinstantiation is the context used for executing a new
84       process as obtained by getexeccon. This context must be set by the
85       calling application or pam_selinux.so module. If this context is not
86       set the polyinstatiation will be based just on user name.
87
88       The "instance differentiation string" is <user name> for "user" method
89       and <user name>_<raw directory context> for "context" and "level"
90       methods. If the whole string is too long the end of it is replaced with
91       md5sum of itself. Also when command line option gen_hash is used the
92       whole string is replaced with md5sum of itself.
93

EXAMPLES

95       These are some example lines which might be specified in
96       /etc/security/namespace.conf.
97
98                 # The following three lines will polyinstantiate /tmp,
99                 # /var/tmp and user´s home directories. /tmp and /var/tmp
100                 # will be polyinstantiated based on the security level
101                 # as well as user name, whereas home directory will be
102                 # polyinstantiated based on the full security context and user name.
103                 # Polyinstantiation will not be performed for user root
104                 # and adm for directories /tmp and /var/tmp, whereas home
105                 # directories will be polyinstantiated for all users.
106                 #
107                 # Note that instance directories do not have to reside inside
108                 # the polyinstantiated directory. In the examples below,
109                 # instances of /tmp will be created in /tmp-inst directory,
110                 # where as instances of /var/tmp and users home directories
111                 # will reside within the directories that are being
112                 # polyinstantiated.
113                 #
114                 /tmp     /tmp-inst/               level      root,adm
115                 /var/tmp /var/tmp/tmp-inst/       level      root,adm
116                 $HOME    $HOME/$USER.inst/inst- context
117
118
119       For the <service>s you need polyinstantiation (login for example) put
120       the following line in /etc/pam.d/<service> as the last line for session
121       group:
122
123       session required pam_namespace.so [arguments]
124
125       This module also depends on pam_selinux.so setting the context.
126

SEE ALSO

128       pam_namespace(8), pam.d(5), pam(8)
129

AUTHORS

131       The namespace.conf manual page was written by Janak Desai
132       <janak@us.ibm.com>. More features added by Tomas Mraz
133       <tmraz@redhat.com>.
134
135
136
137Linux-PAM Manual                  03/02/2009                 NAMESPACE.CONF(5)
Impressum