]> jfr.im git - irc/quakenet/snircd.git/blame - doc/readme.iauth
import of 2.10.12.07
[irc/quakenet/snircd.git] / doc / readme.iauth
CommitLineData
189935b1 1OVERVIEW
2========
3
9f8856e9 4The iauth protocol used here is based on the one in irc2.11.1, with
5minor changes to support challenge-response protocols and
6login-on-connect. Reference to that version's iauth-internals.txt and
7source code may be useful. For clarity, this document uses "server"
8to refer to any IRC server implementing this protocol, "ircu" to refer
9to Undernet ircd, and "ircd" to refer to IRCnet ircd.
10
11Certain messages are relayed to interested operators. ircu implements
12this by using the 131072 (SNO_AUTH) server notice mask. ircd
13implements this by using the &AUTH local channel.
14
15STARTING IAUTH
16==============
17
18The path to the iauth program is specified in the server configuration
19file. The server spawns that program when reading the configuration
20file or when the previous iauth instance terminates. To protect
21against a series of crashes, the server will refuse to restart an
22iauth instance that it spawned in the last five seconds. A rehash
23operation will clear this behavior. The server and iauth instance
24communicate over the iauth instance's stdin and stdout.
25
26Every message from the server to the iauth instance is a single line.
27The line starts with an integer client identifier. This may be -1 to
28indicate no particular client or a non-negative number to indicate a
29client connected to the server.
30
31When the server starts the iauth instance, it sends a line formatted
32like "-1 M irc.example.org 20000" to indicate its name and an
33exclusive upper bound on valid client identifiers. In that example,
34possible client identifiers would be from 0 through 19999 inclusive.
35This upper bound is called MAXCONNECTIONS in the server code.
36
37When the iauth instance starts, it sends a V message to indicate its
38version.
39
40The server should provide /stats subcommands that report the iauth
41instance's version, configuration and statistics.
42
43Line formats in both direction are IRC-like in format: space
44characters separate arguments and a colon at the start of an argument
45indicates that the remainder of the line is one argument. To avoid
46problems, IPv6 address arguments with a leading colon may have to be
47prefixed with a 0 -- for example, ::1 sent as 0::1.
48
49When the iauth instance sends messages that relate to a particular
50client, that client is identified by three parameters from the
51server's Client Introduction message (<id>, <remoteip> and
52<remoteport>). If any of these disagree with the server's current
53user tables, it is an error.
54
55CLIENT STATES
56=============
57
58Each client is conceptually in one of four states: GONE, REGISTER,
59HURRY or NORMAL. Each client starts in the GONE state. Certain
60messages from the server signal a client's transition from one state
61to another, and certain messages from the iauth instance cause a state
62transition.
63
64To be pedantic, the REGISTER state is a collection of sub-states since
65certain commands must occur at most and/or at least one time during
66the REGISTER state. The distinctions between these sub-states are
67distracting and not important, so they are described as one state and
68the repetition limitations are described for each command.
69
70The rationale for the HURRY state is to give explicit input to the
71iauth instance as to when the server believes it has sent the complete
72set of data for the client. Rather than defining the complete set of
73information in this protocol document, that is left to the server.
74ircd does not indicate this state.
75
76POLICIES AND USE CASES
77======================
78
79The historical application of iauth has been to block users that
80appear to be drones early, before they have a chance to disrupt the
81network, and without affecting other users on the same host (which
82K-lines do). This protocol extends that application by adding the n
83server message and by allowing challenge-response exchanges with the
84client.
85
86Eventually it would be nice to move the DNS and ident lookups into
87iauth, and remove that code from the IRC server. ircd already does
88this; since ircu does not, it adds the u server message.
89
90For trusted proxies, this protocol gives the capability for clients
91connecting through those proxies to be displayed with their actual
92username, IP address and hostname. The same functions allow other
93clients to use iauth-assigned spoofs, for example to hide the IP
94addresses used by operators.
95
96This protocol allows login-on-connect, for example by clients that
97send their account name and password in PASS, through the R iauth
98message.
99
100This protocol allows iauth to assign a client to a particular class by
101specifying a class name in the D or R iauth message.
102
103SERVER MESSAGES
104===============
105
106X - Example Message Description
107Syntax: <id> X <several> <arguments>
108Example: 5 X arguments vary
109States: REGISTER(1), HURRY, NORMAL
110Next State: -
111Comments: This is an example message description. Each message is a
112 single character. The States field indicates which states the
113 message may occur in and any restrictions on how many times the
114 message may be sent during those states (restrictions only make
115 sense when Next State is -). The Next State field indicates which
116 new state is implied by the message; a hyphen indicates no state
117 change is implied. The X (Example) message is not a real message
118 type.
119Compatibility: If we believe ircu behavior is different than ircd's,
120 this describes ircd's behavior or expectations.
121
122C - Client Introduction
123Syntax: <id> C <remoteip> <remoteport> <localip> <localport>
124Example: 5 C 192.168.1.10 23367 192.168.0.1 6667
125States: GONE
126Next State: REGISTER
127Comments: Indicates that <localport> on <localip> accepted a client
128 connection from <remoteport> on <remoteip>.
129
130D - Client Disconnect
131Syntax: <id> D
132Example: 5 D
133States: REGISTER, HURRY, NORMAL
134Next State: GONE
135Comments: Indicates that a client is disconnecting from the server.
136
137N - Hostname Received
138Syntax: <id> N <hostname>
139Example: 5 N host-1-10.example.org
140States: REGISTER(1)
141Next State: -
142Comments: Indicates that the server received hostname information for
143 a client. Only one of 'N' and 'd' is sent.
189935b1 144
9f8856e9 145d - Hostname Timeout
146Syntax: <id> d
147Example: 5 d
148States: REGISTER(1)
149Next State: -
150Comments: Indicates that the server did not receive hostname
151 information for a client in a timely fashion. Only one of 'N' and
152 'd' is sent.
189935b1 153
9f8856e9 154P - Client Password
155Syntax: <id> P :<password ...>
156Example: 5 P :buddha n1rvan4
157States: REGISTER
158Next State: -
159Comments: Indicates the client's password information. This may be a
160 traditional client password, an account and pass phrase pair, or the
161 response to a challenge (see the iauth C message). This message is
162 enabled by requesting the A policy.
163
164U - Client Username
165Syntax: <id> U <username> :<userinfo ...>
166Example: 5 U buddha :Gautama Siddhartha
167States: REGISTER(1+)
168Next State: -
169Comments: Indicates the client's claimed username and "GECOS"
170 information. This information is not reliable. This message is
171 enabled by requesting the A policy.
172Compatibility: ircd does not include the <userinfo> data.
173
174u - Client Username
175Syntax: <id> u <username>
176Example: 5 u notbuddha
177States: REGISTER(1)
178Next State: -
179Comments: Indicates a more reliable username for the client.
180Compatibility: This is an Undernet extension and ircd does not send
181 it. It is enabled by the iauth instance requesting the U policy.
182
183n - Client Nickname
184Syntax: <id> n <nickname>
185Example: 5 n Buddha
186States: REGISTER(1+), HURRY
187Next State: -
188Comments: Indicates the client's requested nickname.
189Compatibility: This is an Undernet extension and ircd does not send
190 it. It is enabled by the iauth instance requesting the U policy.
191
192H - Hurry Up
193Syntax: <id> H <class>
194Example: 5 H Others
195States: REGISTER
196Next State: HURRY
197Comments: Indicates that the server is ready to register the client
198 except for needing a response from the iauth server. <class> is
199 a tentative connection class for the user, which will be used unless
200 iauth overrides it in a D or R message.
201Compatibility: This is an Undernet extension and ircd does not send
202 it. It is enabled by the iauth instance requesting the U policy.
203
204T - Client Registered
205Syntax: <id> T
206Example: 5 T
207States: HURRY
208Next State: NORMAL
209Comments: Indicates the server got tired of waiting for iauth to
210 finish and the client is being accepted. This message should
211 never be sent when the R policy is in effect.
212Compatibility: ircd allows this message for clients in the REGISTER
213 state.
214
215E - Error
216Syntax: <id> E <type> :<additional text>
217Example: 5 E Gone
218States: N/A
219Next State: -
220Comments: Indicates that a message received from the iauth instance
221 could not be rationally interpreted. This may be because the client
222 could not be found, the client was in an inappropriate state for the
223 message, or for other reasons. The <type> argument specifies the
224 general type of error and <additional text> provides details. <id>
225 may be -1.
226
227M - Server Name and Capacity
228Syntax: <id> M <servername> <capacity>
229Example: -1 M irc.example.org 20000
230States: GONE(1)
231Next State: -
232Comments: Indicates the server's name and upper bound on client
233 identifiers.
234Compatibility: ircd does not include the <capacity> information.
235 The <id> should be ignored: ircd sends 0 and ircu sends -1.
236
237IAUTH MESSAGES
189935b1 238==============
239
9f8856e9 240X - Example Message Description
241Syntax: X <arguments>
242Example: X something
243Notify: yes
244States: N/A
245Next State: N/A
246Comments: This is an example message description. Each message is a
247 single character. If the Notify field is present and says yes,
248 interested operators (with SNO_AUTH set) should be notified of the
249 message. The States field, where present, indicate which states
250 accept this message. Clients in other states should ignore the
251 message or treat it as an error. The Next State field, where
252 present, indicates what the next state should be for the client.
253Compatibility: If we believe ircu behavior is different than ircd's,
254 this describes ircd's behavior or expectations.
255
256> - Operator Notification
257Syntax: > :<message text>
258Example: > :Hello Operators!
259Notify: yes
260Comments: Contains a message that the iauth instance wants to send to
261 interested operators.
262
263G - Set Debug Level
264Syntax: G <level>
265Example: G 1
266Notify: yes
267Comments: Sets a debug level for the server's end of the iauth
268 conversation. When enabled, debug messages should be sent to the
269 same channel (group, mask, etc) as other iauth notifications.
270 Debug level 0 suppresses iauth-related debug output, and positive
271 integers enable iauth debugging messages.
272
273O - Set Policy Options
274Syntax: O <options>
275Example: O RTAWU
276Notify: yes
277Comments: Sets policy options for the iauth conversation. Old policy
278 options should be forgotten. Valid policy options are:
279 A - Send username and password information.
280 This causes the server to send the U and P messages.
281 R - Require clients to be approved before registering them.
282 When this policy is in effect, it affects the behavior
283 of a registration timeout; for details, see the documentation
284 for the T server message.
285 T - When the R policy is in effect and the iauth service does not
286 respond for a client, this causes the server to count the number
287 of clients refused, to send a warning message to interested
288 operators periodically, and to send the count of rejected users
289 to interested operators when the iauth instance responds again.
290 U - Send nickname, confirmed username and hurry information.
291 This causes the server to send the n, u and H messages.
292 W - Allow extra time for iauth to respond based on hostname.
293 When this policy is in effect and a DNS message (N or d) is
294 sent for a client, that client's registration timeout is
295 extended or reset.
296Compatibility: The U policy is an Undernet extension and is not
297 recognized by ircd.
298
299V - iauth Program Version
300Syntax: V :<version string>
301Example: V :Undernet-iauthu v1.0
302Notify: yes
303Comments: Indicates the iauth program version. This should only be
304 used in diagnostic messages, and must not change protocol behavior.
305
306a - Start of new configuration
307Syntax: a
308Example: a
309Notify: yes
310Comments: Indicates that a new configuration is being loaded by the
311 iauth instance. Any cached configuration records should be cleared.
312
313A - Configuration Information
314Syntax: A <hosts?> <module> :<options>
315Example: A * rfc931
316Notify: yes
317Comments: Indicates new configuration information.
318
319s - Start of new statistics
320Syntax: s
321Example: s
322Notify: yes
323Comments: Indicates a new set of statistics will be sent. Any cached
324 statistics records should be cleared.
325
326S - Statistics Information
327Syntax: S <module> :<module information>
328Example: S rfc931 connected 0 unix 0 other 0 bad 0 out of 0
329Notify: yes
330Comments: Indicates new or additional statistics information.
331
332o - Forced Username
333Syntax: o <id> <remoteip> <remoteport> <username>
334Example: o 5 192.168.1.10 23367 bubba
335States: REGISTER, HURRY
336Next State: -
337Comments: Indicates that the username should be used for the specified
338 client even if the normal sanity-checking would prohibit the
339 username.
340
341U - Trusted Username
342Syntax: U <id> <remoteip> <remoteport> <username>
343Example: U 5 192.168.1.10 23367 buddha
344States: REGISTER, HURRY
345Next State: -
346Comments: Indicates that the iauth instance believes <username> is
347 accurate for the specified client.
348
349u - Untrusted Username
350Syntax: u <id> <remoteip> <remoteport> <username>
351Example: u 5 192.168.1.10 23367 enlightened_one
352States: REGISTER, HURRY
353Next State: -
354Comments: Indicates that the iauth instance does not strongly trust
355 <username> to be accurate, but has no more trusted username.
356
357N - Client Hostname
358Syntax: N <id> <remoteip> <remoteport> <hostname>
359Example: N 5 192.168.1.10 23367 buddha.example.org
360States: REGISTER, HURRY
361Next State: -
362Comments: Indicates that the iauth instance believes the specified
363 client should use the hostname given.
364Compatibility: This is an Undernet extension and ircd does not support
365 this message.
366
367I - Client IP Address
368Syntax: N <id> <currentip> <remoteport> <newip>
369Example: N 5 192.168.1.10 23367 127.128.129.130
370States: REGISTER, HURRY
371Next State: -
372Comments: Indicates that the iauth instance wants the server to
373 present and treat the client as using <newip>. This means that
374 future iauth messages relating to the client must use <newip>
375 as the <remoteip> parameter.
376Compatibility: This is an Undernet extension and ircd does not support
377 this message.
378
379C - Challenge User
380Syntax: C <id> <remoteip> <remoteport> :<challenge string>
381Example: C 5 192.168.1.10 23367 :In which year did Columbus sail the ocean blue?
382States: REGISTER, HURRY
383Next State: -
384Comments: Indicates that the challenge string should be sent to the
385 specified user, for example via NOTICE AUTH :*** <challenge string>.
386 The client responds by sending PASS :<response>, which should be
387 relayed via the P server message. This requires that the A policy
388 be in effect.
389Compatibility: This is an Undernet extension and ircd does not support
390 this message.
391
392k - Quietly Kill Client
393Syntax: k <id> <remoteip> <remoteport> :<reason>
394Example: k 5 192.168.1.10 23367 :Open proxy found.
395States: REGISTER, HURRY, NORMAL
396Next State: GONE
397Comments: Indicates that the specified client should be disconnected
398 for the reason given without notifying operators.
399Compatibility: ircu does not use the same notification mechanism as
400 ircd, so operators are notified using SNO_CONNEXIT anyway.
401
402K - Kill Client
403Syntax: K <id> <remoteip> <remoteport> :<reason>
404Example: K 5 192.168.1.10 23367 :We don't like you.
405States: REGISTER, HURRY, NORMAL
406Next State: GONE
407Comments: Indicates that the specified client should be disconnected
408 for the reason given. Operators should be notified.
409
410D - Done Checking
411Syntax: D <id> <remoteip> <remoteport> [class]
412Example: D 5 192.168.1.10 23367
413States: REGISTER, HURRY
414Next State: NORMAL
415Comments: Indicates that the iauth instance believes the specified
416 client should be allowed onto the network. If a class parameter is
417 given, the client should be assigned to that class.
418Compatibility: Specifying the class is an Undernet extension and ircd
419 does not support that parameter.
420
421R - Registered User
422Syntax: R <id> <remoteip> <remoteport> <account> [class]
423Example: R 5 192.168.1.10 23367 Buddha
424States: REGISTER, HURRY
425Next State: NORMAL
426Comments: Indicates that the iauth instance believes the specified
427 client should be allowed onto the network, pre-authenticated to
428 the account listed. If a class parameter is given, the client
429 should be assigned to that class.
430Compatibility: This is an Undernet extension and ircd does not support
431 this message.