Bug #286
Bug Acl : Définition d'une ressource access avec Hosts Groups et Services Groups
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | - | |||
| Target version: | - | |||
| Resolution: |
Description
Bonjour,
J'ai défini un hostgroup contenant des équipements puis pour ces mêmes équipements un service group contenant une vue de certains services.
Problème: Si dans la définition d'une ressource access, j'ajoute mon hostgroups et mon service groups, dans ce cas, mon utilisateur voit uniquement les services définis dans le service groups. Si j'ajoute uniquement le hostgroup et pas le service group, l'utilisateur voit bien mes hosts et les services associés et inversement si j'ajoute seulement mon service groups
Merci
Version de centreon: RC7
History
#1
Updated by Julien Mathis over 4 years ago
Bonjour,
Je viens de faire le test. Pas de problem à ce niveau la. Tu ne confond pas avec la catégorie de service ??
#2
Updated by Maxime Peccoux over 4 years ago
J'ai cette erreur dans les logs de centAcl
DB Error : DELETE FROM centreon_acl WHERE group_id = '18' [nativecode=1053 * Server shutdown in progress]<br />PHP Fatal error: Call to undefined method DB_Error::fetchRow() in /usr/local/centreon/cron/centAcl.php on line 64
*
Ps: la table centreon_acl existe !
#3
Updated by Julien Mathis over 4 years ago
tu as modifié le code ? ligne 64 ce n'est pas cette requète...
#4
Updated by Maxime Peccoux over 4 years ago
Non je n'ai rien modifié
#5
Updated by Maxime Peccoux over 4 years ago
Ligne 64 :
while ($res2 =& $DBRESULT2->fetchRow()){
#6
Updated by Julien Mathis over 4 years ago
la ligne d'avant ?
#7
Updated by Maxime Peccoux over 4 years ago
$Host = array();
62:$DBRESULT2 =& $pearDB->query("SELECT @acl_res_id@ FROM @acl_res_group_relations@ WHERE @acl_group_id@ = '".$acl_group_id."'");
//$time_start = microtime_float2();
while ($res2 =& $DBRESULT2->fetchRow()){
#8
Updated by Maxime Peccoux over 4 years ago
Désolé pour le 62, c'est une erreur de frappe de ma part en faisant le copier collr
#9
Updated by Julien Mathis over 4 years ago
es tu sur que ton server marche bien ?
=> Server shutdown in progress
#10
Updated by Maxime Peccoux over 4 years ago
Oui il marche cependant, il est vrai que j'ai fait un centcore stop et centstorage stop puis j'ai redémarrer les services. Je pensais que cette ligne avait quelque chose avoir avec mon problème...
En tout cas, j'ai toujours le même problème quand j'ajoute un servicegroups (pas une catégorie)
#11
Updated by Julien Mathis over 4 years ago
je ne comprend vraiment pas. Le code ne peut renvoyer normalement cette erreur. Ce n'est pas la même requete.
je peux avoir la ligne 50 à 75 ?
Merci
#12
Updated by Maxime Peccoux over 4 years ago
/*
********* Purge datas
*/
$strBegin = "INSERT INTO @centreon_acl@ ( @host_name@ , @service_description@ , @group_id@ ) VALUES ";
foreach ($tabGroups as $acl_group_id => $acl_res_id){
$tabElem = array();
/*
***************** Delete old datas for this groups
*/
$DBRESULT =& $pearDBndo->query("DELETE FROM @centreon_acl@ WHERE @group_id@ = '".$acl_group_id."'");
if (PEAR::isError($DBRESULT))
print "DB Error : ".$DBRESULT->getDebugInfo()."<br />";
/*
***************** Select
*/
$Host = array();
$DBRESULT2 =& $pearDB->query("SELECT @acl_res_id@ FROM @acl_res_group_relations@ WHERE @acl_group_id@ = '".$acl_group_id."'");
//$time_start = microtime_float2();
while ($res2 =& $DBRESULT2->fetchRow()){
/* ------------------------------------------------------------------ */
/*
************************* Get all Hosts
*/
$DBRESULT3 =& $pearDB->query("SELECT host_id, host_name FROM @host@, @acl_resources_host_relations@ WHERE acl_res_id = '".$res2[[acl_res_id]]."' AND acl_resources_host_relations.host_host_id = host.host_id AND host.host_register = '1' AND host.host_activate = '1'");
while ($h = $DBRESULT3->fetchRow())
$Host[$h[[host_id"]] = $h["host_name]];
#13
Updated by Julien Mathis over 4 years ago
et le fichier cette fois ci car je ne vois vraiment pas.
je vais le tester chez moi.
Merci.
#14
Updated by Julien Mathis over 4 years ago
peux tu tester avec celui ci ?
http://trac.centreon.com/browser/branches/centreon-2.0/cron/centAcl.php
Merci
#15
Updated by Julien Mathis over 4 years ago
- Status changed from New to Closed
- Resolution set to Fixed
je n'arrive pas du tout a reproduire le promblem de l'acL. Je pense qu'avec le fichier ca sera bon.
#16
Updated by Maxime Peccoux over 4 years ago
- Status changed from Closed to Comment
- Resolution deleted (
Fixed)
J'ai toujours le problème
J'ai refait une installation from scratch et le résultat est exactement le même (en utilisant ou non le fichier que vous avez posté)
#17
Updated by Julien Mathis over 4 years ago
j'ai testé et retesté et a aucun moment ce pb...
je peux avoir un acces à ce server ?
ou alors je te donne un acces à un server pour faire le test...
contact moi
#18
Updated by Maxime Peccoux over 4 years ago
Même problème en RC8
#19
Updated by Maxime Peccoux over 4 years ago
Avez-vous reçu mon email ?
#20
Updated by Julien Mathis over 4 years ago
- Status changed from Comment to Closed
- Resolution set to Fixed
Pour la 2.1, les ACL ont été complètement refaites et testées au maximum sur des archies assez volumineuses. Le problèmes n'est pas constaté.
#21
Updated by Maxime Peccoux about 4 years ago
Je réouvre ce problème car avec Centreon 2.1 RC3, le problème est de nouveau présent
#22
Updated by Nikolaus Filus about 4 years ago
- Category deleted (
CentWeb) - Target version deleted (
Centreon-2.1)
Hello Maxime,
please define a small test suite here to understand the relations in you config better. Use something like:
host group hgA: host1, host2
host1 services: ping, pong, telnet
service group sgA: host1-ping, host1-pong
service group sgB: ....
I will try to reproduce and fix (or give better hints otherwise).
#23
Updated by Maxime Peccoux about 4 years ago
About my config :
I have a hostgroup1 with host1, host2....
Host1 has several services: service1, service2, service3
Host2 has several services: service1, service2, service3
...and I have a servicegroups1 that contains all services2.
Then I define acl like this:
User can see hostgroup1 (host1+host2+...) and can see serviceGroups1 (all services2).
When I put both (in ressources access), Hostgroups1 and servicegroups1, user is allowed to see host1+host2+... but only with services2.
When I put only Hostgroups1 (in ressources access), user is allowed to see host1+host2 with service1, service2, service3 so it works correctly
Good luck
Regards
#24
Updated by Nikolaus Filus about 4 years ago
Sorry, I don't have the right to change status of this report, but ...
from my point of view the current (and described by you) behavior sounds mostly correct to me as
only the host part should be adjusted to the policy of DEFAULT DENY. I opened a similar
request in http://forge.centreon.com/issues/show/318, which would enable a finer control.
- only host A (its status), No services
- host A AND all related services
- host A AND (service_1...service_n)
if not controlled by the engine as you may want to define:
- sg1: serviceA, serviceB, serviceC
- sg2: serviceA, serviceD, serviceE
and ACL: - allow: host A AND sg1 AND NOT sg2
- DEFAULT DENY AND allow(object1, object2, object3) or
- DEFAULT ALLOW AND deny(object1, object2, object3)
ACLs can get very fast very messy ... I know this as I analyzed several firewall engines, where
some of them allow a lot of unreadable and obscure rule sets.
#25
Updated by Nikolaus Filus about 4 years ago
Desirable would be to allow:
- only host A (its status), No services
- host A AND all related services
- host A AND (service_1...service_n)
argh, case1 == case3
DEFAULT DENY : host A AND ()
