[SNMP4J] How to lock snmp agent if server is trying to connect with invalid credential(3 times)

Frank Fock fock at agentpp.com
Fri Dec 5 18:09:05 CET 2014


Hi Smurti,

The MessageDispatcherImpl class has the method
http://www.snmp4j.org/doc/org/snmp4j/MessageDispatcherImpl.html#addAuthenticationFailureListener(org.snmp4j.event.AuthenticationFailureListener)
to register a listener for authentication failure requests.

Since locking the agent can be used by to run denial of service attacks,
you should be carefully check the source IP and only lock the agent
for that IP.
The locking itself is best implemented as transport listener. Such a 
listener
must be added to the TransportMapping before any other listener. It will 
then
act as a proxy to the real transport listener (the MessageDispatcherImpl).
Then when the source IP matches the blocked IP, you can simply not forward
the message to the MessageDispatcherImpl and log something to you log
system.

Hope this helps.

Best regards,
Frank

Am 05.12.2014 17:13, schrieb smruti sagar panda:
> Hello,
>
> My application is a snmp agent which is using SNMP4J . By default, all
> validation of user name/password is done by SNMP4J . So if any server is
> trying to connect with wrong credential to my application , it will fail by
> SNMP4J .
>
>
>
> But I need locking mechanism to support by my application .Means if any
> server tried  3 times with wrong credential , then user should lock for 30
> min.
>
>
>
> As validation is done by SNMP4J itself , My application is not able to find
> when some user trying with wrong credential because processpdu(call back
> method) never calls if validation is failed by SNMP4J itself.
>
>
>
> Is there any api provided by SNMP4J which supports locking mechanism in
> case of wrong credentials.
>
>
>
> Or is there any other way , My application can know when validation failed
> by SNMP4J , so My application can implement locking mechanism.
>
>
>
> Regards
> Smruti
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list