From 08c6d782a4bfc1b463ebf31ce4daa5e3ac4e9639 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 20 Feb 2019 18:24:32 +0100 Subject: [PATCH] Add menuentry discovery Former-commit-id: bc40f0bda89947a88a912484642aa3c89ded64f8 --- pandora_console/godmode/menu.php | 21 +++++++++++++----- pandora_console/images/discovery-100.png | Bin 0 -> 1403 bytes .../images/discovery_green-100.png | Bin 0 -> 1493 bytes pandora_console/images/gm_discovery.menu.png | Bin 0 -> 311 bytes .../images/gm_discovery_green.menu.png | Bin 0 -> 381 bytes pandora_console/include/styles/menu.css | 3 +++ .../lib/PandoraFMS/DiscoveryServer.pm | 14 +++++++++++- 7 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 pandora_console/images/discovery-100.png create mode 100644 pandora_console/images/discovery_green-100.png create mode 100644 pandora_console/images/gm_discovery.menu.png create mode 100644 pandora_console/images/gm_discovery_green.menu.png diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 1c369db688..0ed041d680 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -21,6 +21,21 @@ require_once 'include/functions_menu.php'; $menu_godmode = []; $menu_godmode['class'] = 'godmode'; + +if (check_acl($config['id_user'], 0, 'PM')) { + $sub = []; + $sub['godmode/servers/discovery']['text'] = __('Discover'); + $sub['godmode/servers/discovery']['id'] = 'Discover'; + $sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery']; + + // Add to menu. + $menu_godmode['discover']['text'] = __('Discovery'); + $menu_godmode['discover']['sec2'] = 'godmode/servers/discovery'; + $menu_godmode['discover']['id'] = 'god-discovery'; + $menu_godmode['discover']['sub'] = $sub; +} + + $sub = []; if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) { $sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents'); @@ -200,18 +215,12 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, ' $menu_godmode['gservers']['id'] = 'god-servers'; $sub = []; - if (check_acl($config['id_user'], 0, 'PM')) { - $sub['godmode/servers/discovery']['text'] = __('Discover'); - $sub['godmode/servers/discovery']['id'] = 'Discover'; - } if (check_acl($config['id_user'], 0, 'AW')) { $sub['godmode/servers/modificar_server']['text'] = __('Manage servers'); $sub['godmode/servers/modificar_server']['id'] = 'Manage servers'; } - - // This subtabs are only for Pandora Admin if (check_acl($config['id_user'], 0, 'PM')) { enterprise_hook('ha_cluster'); diff --git a/pandora_console/images/discovery-100.png b/pandora_console/images/discovery-100.png new file mode 100644 index 0000000000000000000000000000000000000000..7ec755e7eb6e72b7367a0e04122f49cc7248cffb GIT binary patch literal 1403 zcmV->1%&#EP)#DY#GL>-L7WMw)XH~`gRy@5y=Q%QK3@{Y!us^RUzS81 z5ybI$Ot60Tm>?Mwc6w#!VHD6g8AEow9slDo^ho!FY>yu?3%$}E8QJkO-Z1+U?1b!( zr|}$|x_>g3?9`+LuAD^}vK~X+iX(3V8q-BVA!~NDg}6g;T|ftp{2V5s*W42Fsz}H_ zm@Ic>@Ejvm{I^5|009m&a#etK@K_bHXmR94i-W%l!`iPp))GodfiDhLR8IH(siN;Ss~XN|5GQV@YF7C zLPVmbGgALpaPXZvcc=={wdHk%yc+})fsjh5JF!H_!SjG1sgQ|ksOx}`q^tTCL_)Mj z=ZW_qhb}$`8A8OU)E$|H1VO4w?Y%-wMrAHblx*hS#Z1Q-kUEBjqq0yWN(NVbR)~o+ z=XjBH^x(}F6oou$&O%(bl{>iU5zF0lW;;&$NJgSa!dADVG|1WZk&uOC=U7|rEC#_| zW&re&kXJ>8EOm(yL~MiEvSY5aiP0pYe`ZU;T%99k($dD#w2eN6y{7LUKD~G6kyq`S zk!c&gYFlyF=E|T{ax(c7OQ07H?EZBh6k@B>-YeODIjL@4@h>kH+Q|Aqh^$W??FBZ`D%hzZGD zPNefrhzLWI2sbiH3ZYQS9#JA>M1T-d3dsl%l9C`ql(0$cIPGd3NgUJx>sfpg0?B{y z?0y&N&)XUWg_wgEA#d4nIT#GSv4fXEF8R;w*g)|k-tv!QcX*bu`FvfY;(b%h3h6=} z+#HRC5_WADvuhp{m4cd(@1Dt6adV_vnPu1CM)EJTtoxBK1Qo)a_0+ILK4r&VB1A{6 z5Fbu(Cmgm38Rc#eQ?e$@(_;LM@D+uPn+Z}^zMm~7qK>(+{Z_&5xs2Ku{G=EOxp3$& zeu(JE8QDIA70e1LL)zTs2N(B0XSx!MNuh0c{aQS+n|9+`5>yItFxxK|$|!shBHEgt zdBzlz$x1MjQH#2EuAk8dAsKcuBpf^{giEE+!YqViqApWf!A2N($LHE}^@`Pn%BN_2}96VIPso zb7s&L(w4#IOd0bCKkjX*q)U^?yH literal 0 HcmV?d00001 diff --git a/pandora_console/images/discovery_green-100.png b/pandora_console/images/discovery_green-100.png new file mode 100644 index 0000000000000000000000000000000000000000..bcda80e4dd59f97c041d7377194ace1635ab5c08 GIT binary patch literal 1493 zcmV;`1uFW9P)tf;+&Ec`~lRN*aJv5ZpoT#&#; zyL)?kG9eM#_n%)ftmoc~5XO{l-srZUfcS^OApD>&u}wfc+ls?rHl={(*e>8KB6Z|+ z^HTZqk-o0Jef@n%3UP0zTogLj)r&+O4|G$PS>^Qo+vKv`rnqmV*m26xxULu!vTA`L zT-Pco#7`h^vKdv$HYvoeI&AKrfGDVgjWLFbAIo?GkX)995&2#scAyLJSQTRVOGFafcv4%tjg*i8bWHtv`! zd_*T}3T9k_K_R-6OR8XQ5)hbCd0m#Jqmq6C(()q_#R4K7gBubNI)i;v}cx0|h2Mh;suUH;&wyxwX02nInN*jzO2D88;ye$7i}~Q!oYOCf;ZmHd|Z>0 zpsw*qa2;E7cLRCe52XFkP@of5y-3utfQG@9@<7@b{D5AYDAuSVsvh7rLK0saxQ%j(Ah zqml+6ZDd+jffzIbh>C59FzQs&$D$A&7-Izgm9wgn90QPC6Gjm@455W;*1OVb_#SG~Pa1@Q)z6d^05Y%>Ja+aSy)5K;YHhW0

sO>r literal 0 HcmV?d00001 diff --git a/pandora_console/images/gm_discovery.menu.png b/pandora_console/images/gm_discovery.menu.png new file mode 100644 index 0000000000000000000000000000000000000000..0f396c08c688a8b396bd2f6817ed999fa71774dc GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RYBuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrH1%-Sl*E45_%4l%OE==l}nDTLEc<0B#1};vf8s&sS!?`1_yZ zf&(wJ@V~`P-yL)ubi;#=Z_QYjqZA?>Clm#>#Hovg#Y+4)fs#he|H*gVLa==%*0pWpOffQ zVx93L literal 0 HcmV?d00001 diff --git a/pandora_console/images/gm_discovery_green.menu.png b/pandora_console/images/gm_discovery_green.menu.png new file mode 100644 index 0000000000000000000000000000000000000000..f4a387c201e5a8b4bdba6ee670bf1a5df143496d GIT binary patch literal 381 zcmV-@0fPRCP)Ixn)RBi~Vu?8?cEZ)r!rAPEN`UtT5`}n9*;_IFKS`W#o zz4)tE!iKsxDJ(Jy75P*W(pI%?O1I=W2ULKJ5Np^t>f5KKvg0zxts!vX5%t@12P!_53d^a7i0_@vjLr*?kmceM=NL-AQm2i~Wq^9a~ zN=VwQcEmeLrGv1vgYZJhxul78{"value"} . '"'; } } + + my $args = "$task->{'id_rt'} $task->{'id_group'} $task->{'create_incident'} $macros_parameters"; + + # Depending of the recon_script type (name) should be invoked + # in different ways: + if ($script->{'name'} =~ /Discovery.App/i) { + # Discovery Application recon script. Imported from heavy server plugins. + # Instantiate configuration file. + + + } if (-x $command) { - `$command $task->{'id_rt'} $task->{'id_group'} $task->{'create_incident'} $macros_parameters`; + `$command $args`; } else { logger ($pa_config, "Cannot execute recon task command $command."); }