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       polydirinstance_prefixmethodlist_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       mntopts=value - value of this flag is passed to the mount call when the
78       tmpfs mount is done. It allows for example the specification of the
79       maximum size of the tmpfs instance that is created by the mount call.
80       See mount(8) for details.
81
82       The directory where polyinstantiated instances are to be created, must
83       exist and must have, by default, the mode of 0000. The requirement that
84       the instance parent be of mode 0000 can be overridden with the command
85       line option ignore_instance_parent_mode
86
87       In case of context or level polyinstantiation the SELinux context which
88       is used for polyinstantiation is the context used for executing a new
89       process as obtained by getexeccon. This context must be set by the
90       calling application or pam_selinux.so module. If this context is not
91       set the polyinstatiation will be based just on user name.
92
93       The "instance differentiation string" is <user name> for "user" method
94       and <user name>_<raw directory context> for "context" and "level"
95       methods. If the whole string is too long the end of it is replaced with
96       md5sum of itself. Also when command line option gen_hash is used the
97       whole string is replaced with md5sum of itself.
98

EXAMPLES

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

SEE ALSO

133       pam_namespace(8), pam.d(5), pam(8)
134

AUTHORS

136       The namespace.conf manual page was written by Janak Desai
137       <janak@us.ibm.com>. More features added by Tomas Mraz
138       <tmraz@redhat.com>.
139
140
141
142Linux-PAM Manual                  05/18/2017                 NAMESPACE.CONF(5)
Impressum