<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6249.1">
<TITLE>[Nagios-users] authentication & access limit</TITLE>
</HEAD>
<BODY dir=ltr>
<DIV> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT size=2>-----Original Message----- <BR><B>From:</B> Spyou
[mailto:spyou@club-internet.fr] <BR><B>Sent:</B> Sat 11/15/2003 8:53 AM
<BR><B>To:</B> nagios-users@lists.sourceforge.net <BR><B>Cc:</B>
<BR><B>Subject:</B> [Nagios-users] authentication & access
limit<BR><BR></FONT></DIV><BR><BR>
<P><FONT size=2>Hi,</FONT> </P><BR>
<P><FONT size=2>I'm playing with Nagios (and netsaint before) for a while ...
I have coded </FONT><BR><FONT size=2>some extra suffs, mainly some rrd
interfaces to graph almost every datas </FONT><BR><FONT size=2>collected by
nagios</FONT> </P>
<P><FONT size=2>I'd like to let customers access thoses graphs. The simplest
way to link </FONT><BR><FONT size=2>nagios states to thoses graphs is to use
the "service ext info" feature of </FONT><BR><FONT size=2>nagios. Each service
that has an rrd graph now had a little button that </FONT><BR><FONT
size=2>links to my cgis that displays the graphs</FONT> </P>
<P><FONT size=2>thoses CGI are called with an URL like</FONT> <BR><FONT
size=2><A
href="http://nagios.blabla.com/cgi-bin/mycgi.cgi?host=hostnameofthecustomer&service=servicename">http://nagios.blabla.com/cgi-bin/mycgi.cgi?host=hostnameofthecustomer&service=servicename</A></FONT>
</P>
<P><FONT size=2>Everything's fine ... but if a customer use </FONT><BR><FONT
size=2>"mycgi.cgi?host=mybox&service=httphealth" and change the URL
</FONT><BR><FONT size=2>"mycgi.cgi?host=neighborshost&service=httphealth"
he will access </FONT><BR><FONT size=2>informations from another host that
he's not supposed to be able to see</FONT> </P>
<P><FONT size=2>Has anyone an idea to limit access in mycgi.cgi so that people
can only see </FONT><BR><FONT size=2>hosts & service they are contact for
? (please note : i don't wanna parse </FONT><BR><FONT size=2>the whole nagios
config to get this info :)</FONT></P>
<P><FONT size=2></FONT> </P>
<P><FONT size=2>--------</FONT></P>
<P><FONT size=2>You've just eliminated the only sure way to know if they're
authorized for that host and service. If you wanted to be absolutely certain
that the user was supposed to able to see information for a specific host you
need to know if they're associated with the host and that information is
going to be in the nagios config files. An alternative would be to store a
simplified version of that information in a database for your scripts use and
just query that based on the value of HTTP_USER.</FONT></P>
<P><FONT size=2></FONT> </P>
<P><FONT size=2>If you have authentication properly set up and customers will
always be getting to your custom cgi through extinfo.cgi or status.cgi, you
can check to make sure that HTTP_REFERRER is one of those cgi's and deny or
redirect everything else. If they attempt to modify the URL as above then the
referrer will be blank. I believe that some browsers will let you control the
value of HTTP_REFERRER so an enterprising user could theoretically foil this
thin skin of security.</FONT></P>
<P><FONT size=2></FONT> </P>
<P><FONT size=2>--</FONT></P>
<P><FONT size=2>Marc</FONT></P></BLOCKQUOTE>
</BODY>
</HTML>