Writing a Nagios Component for authentication
Posted: Tue Jul 31, 2012 11:46 am
I have been looking at the AD, LDAP, and a couple other components and it looks like they are stucutured very similarly. Right now I am trying to figure out the required sudo code for an authentication module that we need to write.
Our current systems have an authentication module that intergrates w/ Apache and IIS. When a user hits the web server, the webserver communicates with the policy servers to see if the site is protected. If the page is protected, then it redirects the user to a policy server, where they enter their username/password before being redirected back to the webserver (if their credentials are accepted). Right now if we do a normal security intergration and protect all of Nagios, then our users will be asked to login via our security system, then redirect them to the Nagios Login page.
The next step from here is writing the module. I am a bit rusty in PHP, though I am guessing I would use existing Nagios components as a guide and the XI_Component_Development.pdf to make one for our security system. I am guessing the big thing that our code would do is the following:
(sudo code)
-------------------
Note: This would be inside the authentication function in the component.
//pulls the user http header that would be set by our security application
$username = grab_request_var('SM_USER');
//Sets the security user to the Nagios XI user header
$_SESSION["username"]=$username;
//Sends the user on their way to access he application
$cbargs["login_ok"]=1;
return;
-----------------------
While the authentication is handled by our seperate security system, I am looking at writing this component to bridge Nagios Authorizatation to our Security Authentication.
I am hoping this would really be the only logic I would have to add to the component, in addition the minimum required component stuff. Please let me know if I am in the right ball park. Again thanks for the great help!
-Doron
Our current systems have an authentication module that intergrates w/ Apache and IIS. When a user hits the web server, the webserver communicates with the policy servers to see if the site is protected. If the page is protected, then it redirects the user to a policy server, where they enter their username/password before being redirected back to the webserver (if their credentials are accepted). Right now if we do a normal security intergration and protect all of Nagios, then our users will be asked to login via our security system, then redirect them to the Nagios Login page.
The next step from here is writing the module. I am a bit rusty in PHP, though I am guessing I would use existing Nagios components as a guide and the XI_Component_Development.pdf to make one for our security system. I am guessing the big thing that our code would do is the following:
(sudo code)
-------------------
Note: This would be inside the authentication function in the component.
//pulls the user http header that would be set by our security application
$username = grab_request_var('SM_USER');
//Sets the security user to the Nagios XI user header
$_SESSION["username"]=$username;
//Sends the user on their way to access he application
$cbargs["login_ok"]=1;
return;
-----------------------
While the authentication is handled by our seperate security system, I am looking at writing this component to bridge Nagios Authorizatation to our Security Authentication.
I am hoping this would really be the only logic I would have to add to the component, in addition the minimum required component stuff. Please let me know if I am in the right ball park. Again thanks for the great help!
-Doron