* Wietse Venema <[email protected]>:
> Patrick Ben Koetter:
> > SMTPD_POLICY_README says:
> > 
> >   The "sasl_*" attributes (Postfix 2.2 and later) specify information about
> >   how the client was authenticated via SASL. These attributes are empty in
> >   case of no SASL authentication.
> > 
> > I read that as:
> > 
> > - I will know when SASL AUTH was successful
> > - I will know when SASL AUTH did not take place
> 
> The policy protocol can, by definition, only provide the current
> state of the SMTP server. It does not, for example, provide a list
> of recipients that the client issued previously. Only the current
> recipient is available, and only if that recipient was not already
> rejected before the policy protocol was invoked.

ACK

> As for information other than current state, the protocol can at
> most provide counters that summarize history but not the details
> of that history. For example it could report numbers of accepted
> or rejected recipients (for this session? for this mail transaction?)
> but not the details of those recipients.
> 
> > Would it be technically feasible to transmit the following states too?
> > 
> > - SASL login wasn't successful (e.g. SASL "Generic SASL failure")
> > - SASL login failed (SASL: "Authentication failed")
> > - SASL login attempted to use a non-permitted envelope-sender
> 
> This is information other than current state, about conditions that
> can happen multiple times during the same SMTP session. Therefore,
> the protocol can at most provide counters that summarize that
> history, but not the details of that history (what names were tried).

My primary goal would be to detect SASL login attacks/abuse and block the
client/temporarily disable the account. Catching envelope-sender abuse is
less important to me.

All this should take place without tailing the log. This has proven to be to
slow in some installations. At the moment my best guess to reduce the offset
is to detect potential SASL login abuse during an SMTP session. 

I understand - if such information existed - I might be able to detect
(repeated) login failures within an SMTP session, but I would only be able to
relate the login failure to the client IP of that session.

I would not be able to relate failures to the authid (sasl_login) if more than
one failure took place, since more than one login name could have been used
during AUTH attempts.

OTOH if I knew more than one login name had been used and more than one login
failed within the same session I think I would like to block that IP too.

Am I building on sand here?

p@rick


-- 
[*] sys4 AG
 
https://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
 

Reply via email to