![]() |
Icinga-core 1.4.0
next gen monitoring
|
00001 /***************************************************************************** 00002 * 00003 * CGIAUTH.H - Authorization utilities header file 00004 * 00005 * Copyright (c) 1999-2009 Ethan Galstad (egalstad@nagios.org) 00006 * Copyright (c) 2009-2011 Icinga Development Team (http://www.icinga.org) 00007 * 00008 * License: 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License version 2 as 00012 * published by the Free Software Foundation. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00022 * 00023 *****************************************************************************/ 00024 00025 #ifndef _AUTH_H 00026 #define _AUTH_H 00027 00028 #include "common.h" 00029 #include "objects.h" 00030 00031 00032 #ifdef __cplusplus 00033 extern "C" { 00034 #endif 00035 00036 typedef struct authdata_struct{ 00037 char *username; 00038 int authorized_for_all_hosts; 00039 int authorized_for_all_host_commands; 00040 int authorized_for_all_services; 00041 int authorized_for_all_service_commands; 00042 int authorized_for_system_information; 00043 int authorized_for_system_commands; 00044 int authorized_for_configuration_information; 00045 int authorized_for_read_only; 00046 int authenticated; 00047 int number_of_authentication_rules; 00048 char **authentication_rules; 00049 }authdata; 00050 00051 00052 00053 int get_authentication_information(authdata *); /* gets current authentication information */ 00054 00055 int parse_authorization_config_file(char *,authdata *); /* parsing authorization configuration file */ 00056 int set_authz_permissions(char *,authdata *); /* set default authz permissions */ 00057 00058 int is_authorized_for_host(host *,authdata *); 00059 int is_authorized_for_service(service *,authdata *); 00060 00061 int is_authorized_for_all_hosts(authdata *); 00062 int is_authorized_for_all_services(authdata *); 00063 00064 int is_authorized_for_system_information(authdata *); 00065 int is_authorized_for_system_commands(authdata *); 00066 int is_authorized_for_host_commands(host *,authdata *); 00067 int is_authorized_for_service_commands(service *,authdata *); 00068 00069 int is_authorized_for_hostgroup(hostgroup *,authdata *); 00070 int is_authorized_for_servicegroup(servicegroup *,authdata *); 00071 00072 int is_authorized_for_configuration_information(authdata *); 00073 00074 int is_authorized_for_read_only(authdata *); 00075 #ifdef __cplusplus 00076 } 00077 #endif 00078 00079 #endif