| 1 |
<html> |
| 2 |
<body> |
| 3 |
<h1>CVM: Credential Validation Module</h1> |
| 4 |
|
| 5 |
<p><a href="protocol-1.html">CVM Protocol Version 1 Description</a> |
| 6 |
<br><a href="protocol-2.html">CVM Protocol Version 2 Description</a> |
| 7 |
<br><a href="credentials.html">CVM Credential Definitions</a> |
| 8 |
<br><a href="facts.html">CVM Fact Definitions</a> |
| 9 |
<br><a href="v1client.html">CVM Version 1 Client Library</a> |
| 10 |
<br><a href="v2client.html">CVM Version 2 Client Library</a> |
| 11 |
<br><a href="module.html">CVM Module Library</a> |
| 12 |
<br><a href="sasl.html">CVM SASL Library</a> |
| 13 |
<br><a href="errors.html">CVM Error Values</a> |
| 14 |
<br><a href="rationale.html">CVM Design Rationale</a> |
| 15 |
</p> |
| 16 |
|
| 17 |
<p><a href="cvm-checkpassword.html">The cvm-checkpassword Program</a> |
| 18 |
<br><a href="cvm-testclient.html">The cvm-testclient Program</a> |
| 19 |
<br><a href="cvm-benchclient.html">The cvm-benchclient Program</a> |
| 20 |
</p> |
| 21 |
|
| 22 |
<p><a href="cvm-unix.html">The cvm-unix Module</a> |
| 23 |
<br><a href="cvm-pwfile.html">The cvm-pwfile Module</a> |
| 24 |
<br><a href="cvm-vmailmgr.html">The cvm-vmailmgr Module</a> |
| 25 |
<br><a href="cvm-qmail.html">The cvm-qmail Module</a> |
| 26 |
<br><a href="cvm-mysql.html">The cvm-mysql Module</a> |
| 27 |
<br><a href="cvm-pgsql.html">The cvm-pgsql Module</a> |
| 28 |
<br><a href="cvm-chain.html">The cvm-chain Module</a> |
| 29 |
</p> |
| 30 |
|
| 31 |
<hr> |
| 32 |
|
| 33 |
<p>CVM is a framework for validating a set of credentials against a |
| 34 |
database using a filter program. The modules act as a filter, taking |
| 35 |
a set of credentials as input and writing a set of facts as output if |
| 36 |
those credentials are valid. Optional input is given to the module |
| 37 |
through environment variables.</p> |
| 38 |
|
| 39 |
<p>Some of the ideas for CVM came from experience with PAM (pluggable |
| 40 |
authentication modules), the <a |
| 41 |
http="http://cr.yp.to/checkpwd.html">checkpassword</a> interface used |
| 42 |
by <tt>qmail-pop3d</tt>, and the "authmod" interface used by Courier |
| 43 |
IMAP and POP3. This framework places fewer restrictions on the |
| 44 |
invoking client than checkpassword does, and is much simpler to |
| 45 |
implement on both sides than PAM and the authmod framework.</p> |
| 46 |
|
| 47 |
<h2>Contact Modes</h2> |
| 48 |
|
| 49 |
<p>CVM modules may be contacted by one of three modes:</p> |
| 50 |
|
| 51 |
<ol> |
| 52 |
|
| 53 |
<li>Command execution: Use a module name of |
| 54 |
<tt>cvm-command:/path/to/command</tt>. The <tt>cvm-command:</tt> |
| 55 |
prefix is optional.</li> |
| 56 |
|
| 57 |
<li>UNIX (or local) domain socket: Use a module name of |
| 58 |
<tt>cvm-local:/path/to/socket</tt>.</li> |
| 59 |
|
| 60 |
<li>UDP: Use a module name of <tt>cvm-udp:hostname:port</tt>.</li> |
| 61 |
|
| 62 |
</ol> |
| 63 |
|
| 64 |
<p>Modules may be chained in the client. To do so, specify the list of |
| 65 |
modules separated by a comma. For example:</p> |
| 66 |
|
| 67 |
<pre>cvm-local:/path/to/socket,cvm-command:/path/to/module</pre> |
| 68 |
|
| 69 |
<p>The first module to either report success, a temporary failure, or |
| 70 |
permanent failure with an in-scope result terminates the chain.</p> |
| 71 |
|
| 72 |
<h2>Module Invocation</h2> |
| 73 |
|
| 74 |
<p>CVM modules are invoked using a similar syntax to the above:</p> |
| 75 |
|
| 76 |
<ol> |
| 77 |
|
| 78 |
<li>UNIX (or local) domain server: Use a command-line argument of |
| 79 |
<tt>cvm-local:/path/to/socket</tt>. If <tt>$CVM_SOCKET_MODE</tt> is |
| 80 |
set, the created socket will have this mode (in octal, defaults to |
| 81 |
<tt>777</tt>). If <tt>$CVM_SOCKET_OWNER</tt> or |
| 82 |
<tt>$CVM_SOCKET_GROUP</tt> are set, the created socket will have its |
| 83 |
UID/GID set appropriately. The module will wait a maximum of 1000ms for |
| 84 |
complete input to be received from the client or to completely send the |
| 85 |
response. This value may be overridden by <tt>$CVM_IO_TIMEOUT</tt>.</li> |
| 86 |
|
| 87 |
<li>UDP socket server: Use a command-line argument of |
| 88 |
<tt>cvm-udp:hostname:port</tt>. The <tt>hostname</tt> argument |
| 89 |
specifies the IP to bind the socket to. Normally this will be |
| 90 |
<tt>0</tt> to bind to all IPs.</li> |
| 91 |
|
| 92 |
</ol> |
| 93 |
|
| 94 |
<p>If <tt>$CVM_LOOKUP_SECRET</tt> is set, the module operates in "lookup |
| 95 |
mode". In this mode, the authentication function provided by the module |
| 96 |
will not be called. Instead, the module library will handle |
| 97 |
authentication internally, <em>before</em> the lookup happens. If the |
| 98 |
secret is empty, the module will expect no credentials to be passed to |
| 99 |
the module, otherwise one must be passed and it must match the |
| 100 |
secret.</p> |
| 101 |
|
| 102 |
</body> |
| 103 |
</html> |