Whamcloud - gitweb
land lustre part of b_hd_sec on HEAD.
[fs/lustre-release.git] / lustre / sec / doc / revoke_user_HLD.lyx
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 221
3 \textclass article
4 \language english
5 \inputencoding auto
6 \fontscheme times
7 \graphics default
8 \paperfontsize 12
9 \spacing single 
10 \papersize Default
11 \paperpackage a4
12 \use_geometry 0
13 \use_amsmath 0
14 \use_natbib 0
15 \use_numerical_citations 0
16 \paperorientation portrait
17 \secnumdepth 3
18 \tocdepth 3
19 \paragraph_separation skip
20 \defskip medskip
21 \quotes_language english
22 \quotes_times 2
23 \papercolumns 1
24 \papersides 1
25 \paperpagestyle default
26
27 \layout Title
28
29 High Level Design of User Revoke
30 \layout Author
31
32 Peter Braam, Eric Mei
33 \layout Date
34
35 Jan 31, 2005
36 \layout Section
37
38 Requirement
39 \layout Itemize
40
41 Be able to revoke a user, prevent it from accessing lustre immediately.
42 \layout Itemize
43
44 Be able to pass sub-test of HP acceptance 4.1.51.
45 \layout Itemize
46
47 user & mapping databases manipulation API.
48 \layout Section
49
50 Functional Specification
51 \layout Standard
52
53 A sub-command 
54 \begin_inset Quotes eld
55 \end_inset 
56
57 revoke
58 \begin_inset Quotes erd
59 \end_inset 
60
61  will be added into existing tool 'lctl'.
62  When system administrator want to kick somebody off from lustre filesystem
63  (e.g.
64  a certain user has known be malicious or an account be compromised), he
65  could use this functionality on MDS's to prevent the victim user from access
66  lustre filesystem right away.
67  The command format could be:
68 \layout LyX-Code
69
70 lctl revoke user|all
71 \layout Itemize
72
73 Here the 'user' format is: uid[@nid[.netid]]
74 \layout Itemize
75
76 option @nid.netid is only for remote users.
77  The uid is in term of local uid, thus 'uid@remote_nid.netid' means remote
78  users on node 'remote_nid.netid' who are mapped to local 'uid', it's not
79  intend to remove a certain user on specific node.
80 \layout Itemize
81
82 Specified uid without nid or netid means match all nid or netid.
83 \layout Itemize
84
85 'all' means revoke all users.
86 \layout Standard
87
88 Actually lctl only remove those in-kernel cache for the victim user, usually
89  there's many other configuration work need to be done by using other admin
90  tools:
91 \layout Itemize
92
93 Kerberos Database: For removing a user from kerberos principal database,
94  sysadmin must use kerberos admin tools.
95  And this change will not take effect right away if the victim user has
96  authenticated with MDS's before the removal (because of client side credential
97  cache).
98 \layout Itemize
99
100 User Database: For removing a user from user database, sysadmin also must
101  resort to other tools, usually standard unix tools.
102  This change will not take effect right away if this user had ever accessed
103  lustre before the removal (because of in-kernel LSD cache).
104 \layout Itemize
105
106 User Mapping Database: For removing a user from remote user mapping database,
107  sysadmin need edit the configure file manually.
108  This only affect certain user on certain remote client.
109  This change will not take effect right away if this user had ever acessed
110  lustre before the removal (because of in-kernel uid mapping cache).
111 \layout Standard
112
113 So when sysadmin actually revoke a user, he usually at first did one or
114  more steps of above according to requirement, then invoke lctl to finally
115  revoke the user.
116  In cases that user database or user mapping database are not centrally
117  managed by e.g.
118  LDAP, sysadmin must remove the user from all configure files on each MDS's,
119  this could be done by using 'pdsh', etc.
120 \layout Standard
121
122 What above described is the basic requirement.
123  There's an additional one: for user and mapping database, write a C API
124  library (probably later add python support), which can query, add, remove,
125  and enumerate users in each database.
126  'edit' could be implemented as remove + add.
127 \layout Standard
128
129 By using this API, we could provide much complete functionality.
130  Sysadmin could do everything about user account within single lctl tools;
131  Kernel upcall helper also could use this API to obtain information from
132  mapping database, etc.
133 \layout Section
134
135 Use Cases
136 \layout Subsection
137
138 Revoke Alice's access right on all clients, permanently
139 \layout Enumerate
140
141 Sysadmin remove Alice from user database on all MDS's.
142 \layout Enumerate
143
144 Sysadmin invoke 'lctl revoke alice_uid' on all MDS's.
145 \layout Enumerate
146
147 Alice from local clients will not be able to access lustre.
148 \layout Enumerate
149
150 Any remote users who are mapped to Alice will not be able to access lustre.
151 \layout Subsection
152
153 Revoke Alice's access right on remote client remote1
154 \layout Enumerate
155
156 Suppose alice@remote1 is mapped to local user Bob.
157 \layout Enumerate
158
159 Sysadmin remove mapping entry of 'alice_uid@remote1 -> bob' from user mapping
160  database.
161 \layout Enumerate
162
163 Sysadmin invoke 'lctl revoke bob_uid@remote1' on all MDS's.
164 \layout Enumerate
165
166 Alice will not be able to access lustre from remote1.
167 \layout Enumerate
168
169 Bob from an local client could still work fine.
170 \layout Section
171
172 Logic Specification
173 \layout Standard
174
175 There's several kinds of in-kernel cache for certain user: LSD, gss context,
176  and uid-mapping.
177  In the future we might add consideration of removing OSS access capability.
178 \layout Enumerate
179
180 LSD: On each MDS, each user (uid) correspond to at most one LSD entry.
181  There's already an existing interface to flush LSD for a certain user:
182  simply write an uid into '/proc/fs/lustre/mds/lsd_flush' (Note this is
183  subject to change).
184  Write in '-1' will flush all LSD entries.
185 \layout Enumerate
186
187 GSS Context: On each MDS, each user (principal) might correspond to several(even
188  many) gss contexts.
189  The gss module should export a proc entry.
190  When provided uid and remote nid/netid, it should be able to find out the
191  initiating/established gss contexts and destroy them.
192  Providing a special tag will flush all gss contexts.
193 \layout Enumerate
194
195 UID Mapping: Firstly found out per-client structure for specified nid/netid,
196  then destroy the mapping entries for specified uid.
197  Since this is strongly related to GSS context, we can use the export proc
198  entry for gss context to initiate this flush.
199  Thus when sysadmin trying to flush gss contexts for certain user, we also
200  flush associated uid-mapping.
201 \layout Standard
202
203 This work should be done after the completion of GSS and remote uid/gid
204  handling implementation.
205 \layout Standard
206
207 The user and mapping databases manipulation API could be simple not much
208  restriction, and the details is very much related to the actual database
209  structure.
210  we leave the details to the following DLD document.
211 \layout Section
212
213 State Management
214 \layout Standard
215
216 Since we'll flush several cache separately, we might have situation that
217  not strictly consistency.
218  For example, after we flushed alice from cache1, someone re-populate it
219  in cache1 while do it on cache2.
220  In fact, the inconsistency between LSD and gss context is perfectly allowed.
221  Only one thing need be sure is: since uid mapping is established after
222  that of gss context, thus we need flush uid mapping at first, and then
223  flush gss context.
224  This could prevent unnecessary error when doing 'revoke' while we don't
225  actually remote it from mapping database.
226 \layout Standard
227
228 No serious locking issues, no special recovery consideration.
229 \layout Section
230
231 Alternatives
232 \layout Standard
233
234 None.
235 \layout Section
236
237 Focus of Inspection
238 \layout Itemize
239
240 Is the lctl interface reasonably reflect the facts?
241 \layout Itemize
242
243 Could it pass acceptance test?
244 \the_end