I'm requested by my customer to implement this certain mechanism:
The SNMP manager will add to every SNMP message some "magic key".
My agent (I'll use agentX) shall pass or drop the message according to the
"magic key".
I shall calculate and add the same key to every message that I send to the
manager.
The manager will perform the same check of the key.
The "magic key" can be "sum" of some fields of the SNMP header (requestID
for example)
and values from the passed vbl.
The idea is that the manager(WinSnmp) calculate the key and put it to vbl of
each request (like multiple get/set).
My problem is that
        1.I can't retrieve header fields
        2.my subagent(agentX) can register its handlers only for certain
OIDs,
           so at multiple get/set I'll be called number of times (per each
OID). 

I think about the following solution:
I catch the incoming manager's packets before entrance to the NET-SNMP.
I'll traverse the packets, pull out the header fields that I need and vbl
values (the key will be at last position),
 calculate the key, and if it is OK, pass packet to the NET-SNMP in regular
way.
For the outgoing packets: I'll catch the SNMP packet before it passed to IP,
perform the same calculations,
put the key to the packet as last vbl member and pass the packet in regular
way.
I think to catch the packets somewhere within NET-SNMP code nearly to
send/receive of the socket (tell me where please).

I now that is crazy, but I required to do it...

Do you have some another idea how to secure my SNMP flow?
My agentX run on Linux, the manager run on Windows (WinSnmp package). No
open source of manager, no drivers that can catch packets at IP level...
The functions that calculate the "magic key" SHALL be my own and
non-standard
(other difficult mechanism involved here).

Thank for you time of reading my long story. The help will be blessed..
______________________
Oleg Kodel
---------------------------------


> -----Original Message-----
> From: Wes Hardaker [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 19, 2005 7:36 PM
> To: Kodel Oleg
> Cc: [email protected]
> Subject: Re: Retrieving SNMP header fields in the handler
> 
> 
> >>>>> On Mon, 18 Apr 2005 07:53:46 +0200, Kodel Oleg 
> <[EMAIL PROTECTED]> 
> >>>>> said:
> 
> Kodel> In my subagent, in the get/set handlers I need to reach the 
> Kodel> fields of the SNMPv2 header, such as RequestID, AgentAddress, 
> Kodel> Community.  Is it possible to retrieve these fields 
> using regular 
> Kodel> APIs from the registered handler (registered with
> Kodel> netsnmp_register_instance) ?
> 
> generally you should never do this.  If you're doing it then 
> you'd probably be best rethinking what you're trying to do in 
> a different way.  What exactly are you trying to do?
> 
> now, having said that, you can access the information through the
> asp->pdu pointer found in the netsnmp_agent_request_info structure.
> However, if you do so your code could fail in the future 
> because you suddenly decided to use SNMPv3 or agentx or some 
> other mechanism which the above will make non-portable.  I 
> urge you not to do what you're thinking about if it can be avoided.
> 
> -- 
> Wes Hardaker
> Sparta, Inc.
> 

This e-mail message has been sent by Elbit Systems Ltd.
and is for the use of the intended recipients only.
The message may contain privileged or commercial confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
and notify the sender immediately.


-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to