Re: SMTP-SASL auth failure caching.
- This is a resubmission, apparently the patch plus my preamble is over
the 40k character limit. The patch is short enough, so it must be all
my waffle at the beginning! I will post the patch in the next mail.
Well, this is V2.1 I guess. I went with most of the changes suggested,
and I modified the interface to cache_client. Now you pass in the
"service name" and "CLNT_STREAM**", so the cache client is stateless,
and can be used from many places in the same process at the same time.
This coupled with the ability to change the serivce name in the
"master.cf" file, and override the cache file with "-o cache_map"
allows the cache service to really provide multiple caches to multiple
services at the same time. For good measure, I added a
"smtp_sasl_auth_cache_service" conf variable to allow you to set the
name of the auth_cache service to something else.
I have tested the patch with both soft_bounce disabled and enabled,
and all is behaving as required.
Also, using the little cache_client test program at the end of
cache_client.c I notice the memory based hash table (dict_ht) does not
support delete. This should not affect funtionality, as an expired or
corrupt cache entry will just be ignored, but it does mean warnings
are generated evey time an attempt is made to delete a cache entry in
the "volatile" mode. This affects verify.c as well. I assume it is not
worth disabling the delete call for this mode, just incate dict_ht
gains this functionality in the future.
The patch includes adding the service to master.cf (although I run
pretty much everything in a chroot jail, which I believe is not the
default... so that one may not apply). Also I haven't made any changes
to the main.cf, and the patch was generated after the soft_bounce
patch, and the comments there may be slightly different.
Keean Schupke, Fry-IT Ltd.
On 02/12/2007, Wietse Venema <wietse@...> wrote:
> Victor Duchovni:
> > On Sat, Dec 01, 2007 at 10:43:53PM +0000, Keean Schupke wrote:
> > > have added a dsn_valid() check, and swapped to using strtoul, along
> > > with unsigned long for all time values... no negative times.
> > In http://tools.ietf.org/html/rfc4954#section-6, the enhanced status
> > code for AUTH failures is defined as:
> > 535 5.7.8 Authentication credentials invalid
> > which extends:
> > http://tools.ietf.org/html/rfc3463#section-3.8
> > which only defines 5.7.0-5.7.7
> > It may be appropriate to further check the enhanced status code (if
> > present) and skip responses where 535 is accompanied by an enhanced
> > status code other than 5.7.8. On the other hand, the 535 response is not
> > currently supposed to be accompanied by any other enhanced status code,
> > so this may be too pedantic.
> As long as Postfix recognizes the 535 SMTP status in this very
> specific context (AUTH request) there should be no need to require
> a specific enhanced status code.
> It is the SMTP client's job to translate protocol-specific server
> replies (535 5.7.8 yadda yadda) into something meaningful (suspend
> all further usage of this password for this user and server).
> Is there a need for the SMTP client to make a sanitized version of
> the server reply available to other software? If not, then why
- On Tue, Dec 04, 2007 at 09:04:19PM +0000, Keean Schupke wrote:
> How about we make the key iterations a config variable, and let theYes, that's the idea. Also CPUs have historically gotten faster
> user make the balance between speed and security?
year-by-year. Moore's law is looking a bit more feeble lately, we are
getting the feature-size scaling (more cores per die) but the clock-rate
seems to have stalled for a bit.
Finally, the table will not be in the chroot jail, proxymap/proxywrite
won't be chrooted even when other processes are. So some "postfix"
processes will have less access to the table than others.
Anyway this is all coverging to something sensible. The question for
the smtp(8) side is whether making the password hash the key is the
best choice. We could make "nexthop user" the key, and stick the
password hash in the result. That way deletion will actually work.
Otherwise, new passwords will be set before the fail map entry expires,
and the table entry becomes orphaned.
If this change is made, the entry is valid only if not expired, and the
password hash matches. Looks a lot an /etc/shadow entry with a user name
and PKCS#5 v2 password hash, only it perversely records invalid passwords!
Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.
To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.