WIP: Check audit logs

This commit is contained in:
Jose Gonzalez 2022-01-20 10:55:23 +01:00
parent 49bf10f0f8
commit 3252832cc7
217 changed files with 1280 additions and 1088 deletions

View File

@ -89,7 +89,11 @@ if (isset($_GET['loginhash']) === true) {
$config['id_user'] = $loginhash_user;
} else {
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed (loginhash', '', 'system');
db_pandora_audit(
AUDIT_LOG_USER_REGISTRATION,
'Loginhash failed',
'system'
);
while (ob_get_length() > 0) {
ob_end_flush();
}
@ -111,8 +115,8 @@ if (class_exists($auth_class) === false || $public_hash === false) {
} else {
if ($auth_class::validatePublicHash($public_hash) === false) {
db_pandora_audit(
'Invalid public hash',
'Trying to access public dashboard'
AUDIT_LOG_USER_REGISTRATION,
'Trying to access public dashboard (Invalid public hash)'
);
include 'general/noaccess.php';
exit;

View File

@ -284,7 +284,7 @@ function mainAgentsModules()
// ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent view (Grouped)'
);
include 'general/noaccess.php';
@ -304,7 +304,10 @@ function mainAgentsModules()
db_process_sql_update('tagente_modulo', ['flag' => 1], $where);
} else {
db_pandora_audit('ACL Violation', 'Trying to set flag for groups');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to set flag for groups'
);
include 'general/noaccess.php';
exit;
}

View File

@ -63,7 +63,7 @@ function extension_api_checker()
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Profile Management'
);
include 'general/noaccess.php';

View File

@ -32,7 +32,7 @@ function extension_db_status()
if (!is_user_admin($config['id_user'])) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access db status'
);
include 'general/noaccess.php';

View File

@ -89,7 +89,10 @@ function dbmgr_extension_main()
global $config;
if (!is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}

View File

@ -16,7 +16,10 @@ function load_matrix_console()
global $config;
if (! check_acl($config['id_user'], 0, 'ER')) {
db_pandora_audit('ACL Violation', 'Trying to access event viewer');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access event viewer'
);
include 'general/noaccess.php';
return;
}

View File

@ -17,7 +17,7 @@ function extension_uploader_extensions()
if (!check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';
@ -61,7 +61,10 @@ function extension_uploader_extensions()
}
if ($result) {
db_pandora_audit('Extension manager', 'Upload extension '.$_FILES['extension']['name']);
db_pandora_audit(
AUDIT_LOG_EXTENSION_MANAGER,
'Upload extension '.$_FILES['extension']['name']
);
}
ui_print_result_message(

View File

@ -106,7 +106,10 @@ function pandora_files_repo_godmode()
// ACL Check
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access to Files repository');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access to Files repository'
);
include 'general/noaccess.php';
return;
}

View File

@ -58,7 +58,10 @@ function mainInsertData()
ui_print_page_header(__('Insert data'), 'images/extensions.png', false, '', true, '');
if (! check_acl($config['id_user'], 0, 'AW') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}

View File

@ -15,7 +15,10 @@ global $config;
if (is_ajax()) {
if (! check_acl($config['id_user'], 0, 'ER')) {
db_pandora_audit('ACL Violation', 'Trying to access event viewer');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access event viewer'
);
return;
}

View File

@ -33,7 +33,7 @@ check_login();
// ACL Check.
if (!check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Module Groups view'
);
include 'general/noaccess.php';

View File

@ -56,7 +56,10 @@ function pandoralogs_extension_main()
global $config;
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}

View File

@ -46,7 +46,7 @@ function quickShell()
if (check_acl($config['id_user'], 0, 'PM') === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Profile Management'
);
include 'general/noaccess.php';

View File

@ -29,7 +29,10 @@ if (isset($_GET['get_ptr'])) {
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}
@ -404,7 +407,10 @@ function resource_exportation_extension_main()
check_login();
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}

View File

@ -143,14 +143,14 @@ function process_upload_xml_report($xml, $group_filter=0)
if ($id_report) {
db_pandora_audit(
'Report management',
AUDIT_LOG_REPORT_MANAGEMENT,
'Create report '.$id_report,
false,
false
);
} else {
db_pandora_audit(
'Report management',
AUDIT_LOG_REPORT_MANAGEMENT,
'Fail to create report',
false,
false
@ -554,7 +554,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
);
if ($id_visual_map !== false) {
db_pandora_audit('CREATE VISUAL CONSOLE', $id_visual_map, $config['id_user']);
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Create Visual Console #%s', $id_visual_map),
$config['id_user']
);
} else {
break;
}
@ -716,7 +720,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
);
if ($id_item !== false) {
db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']);
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']),
$config['id_user']
);
}
} else {
foreach ($agents_in_item as $id => $agent) {
@ -725,7 +733,7 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
$id_item = db_process_sql_insert('tlayout_data', $values);
if (isset($item->other_id)) {
if (isset($item->other_id) === true) {
$relation_other_ids[(string) $item->other_id] = $id_item;
}
@ -736,9 +744,14 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
);
if ($id_item !== false) {
db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']);
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']),
$config['id_user']
);
}
} else {
// TODO: Review this else.
foreach ($agent['modules'] as $id_module => $module) {
$values['id_agent'] = $id;
$values['id_agente_modulo'] = $id_module;
@ -752,7 +765,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
);
if ($id_item !== false) {
db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']);
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']),
$config['id_user']
);
}
}
}
@ -1063,7 +1080,10 @@ function resource_registration_extension_main()
global $config;
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}

View File

@ -26,7 +26,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access HA cluster'
);
include 'general/noaccess.php';

View File

@ -17,7 +17,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Inventory'
);
include 'general/noaccess.php';

View File

@ -27,7 +27,7 @@ $group = $id_grupo;
if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent manager'
);
include 'general/noaccess.php';

View File

@ -154,7 +154,10 @@ ui_require_javascript_file('openlayers.pandora');
$new_agent = (empty($id_agente)) ? true : false;
if (! isset($id_agente) && ! $new_agent) {
db_pandora_audit('ACL Violation', 'Trying to access agent manager witout an agent');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent manager witout an agent'
);
include 'general/noaccess.php';
return;
}

View File

@ -70,7 +70,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
if (!$access_granted) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent manager'
);
include 'general/noaccess.php';
@ -198,7 +198,10 @@ if ($create_agent) {
$grupo = (int) get_parameter_post('grupo');
if ((bool) check_acl($config['id_user'], $grupo, 'AW') === false) {
db_pandora_audit('ACL Violation', 'Trying to access agent manager');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent manager'
);
include $config['homedir'].'/general/noaccess.php';
return;
}
@ -352,7 +355,7 @@ if ($create_agent) {
$unsafe_alias = io_safe_output($alias);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Created agent '.$unsafe_alias,
false,
true,
@ -1243,7 +1246,7 @@ if ($update_agent) {
ui_print_success_message(__('Successfully updated'));
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Updated agent '.io_safe_output($alias),
false,
false,
@ -1259,7 +1262,10 @@ if ($id_agente) {
// This has been done in the beginning of the page, but if an agent was created, this id might change.
$id_grupo = agents_get_agent_group($id_agente);
if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && !check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) {
db_pandora_audit('ACL Violation', 'Trying to admin an agent without access');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to admin an agent without access'
);
include 'general/noaccess.php';
exit;
}
@ -1319,7 +1325,7 @@ if ($update_module || $create_module) {
if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to create a module without admin rights'
);
include 'general/noaccess.php';
@ -1803,7 +1809,7 @@ if ($update_module) {
$edit_module = true;
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Fail to try update module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
);
} else {
@ -1827,7 +1833,7 @@ if ($update_module) {
$agent = db_get_row('tagente', 'id_agente', $id_agente);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Updated module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']),
false,
false,
@ -1989,7 +1995,7 @@ if ($create_module) {
$edit_module = true;
$moduletype = $id_module;
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
);
} else {
@ -2014,7 +2020,7 @@ if ($create_module) {
$agent = db_get_row('tagente', 'id_agente', $id_agente);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']),
false,
true,
@ -2049,12 +2055,12 @@ if ($enable_module) {
$success_action = $result;
if ($result === NOERR) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
);
} else {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
);
}
@ -2084,12 +2090,12 @@ if ($disable_module) {
if ($result === NOERR) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
);
} else {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
);
}
@ -2133,7 +2139,7 @@ if ($delete_module) {
if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to delete a module without admin rights'
);
include 'general/noaccess.php';
@ -2143,7 +2149,7 @@ if ($delete_module) {
if (empty($module_data) || $id_borrar_modulo < 1) {
db_pandora_audit(
'HACK Attempt',
AUDIT_LOG_HACK_ATTEMPT,
'Expected variable from form is not correct'
);
include 'general/noaccess.php';
@ -2165,7 +2171,7 @@ if ($delete_module) {
$agent = db_get_row('tagente', 'id_agente', $id_agente);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Deleted module '".io_safe_output($module_data['nombre'])."' for agent ".io_safe_output($agent['alias'])
);
}
@ -2206,12 +2212,12 @@ if (!empty($duplicate_module)) {
if ($result) {
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Duplicate module '".$id_duplicate_module."' for agent ".$agent['alias'].' with the new id for clon '.$result
);
} else {
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
"Fail to try duplicate module '".$id_duplicate_module."' for agent ".$agent['alias']
);
}
@ -2225,9 +2231,15 @@ if ($enable_module) {
if ($result === NOERR) {
enterprise_hook('config_agents_enable_module_conf', [$id_agente, $enable_module]);
db_pandora_audit('Module management', 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
db_pandora_audit(
AUDIT_LOG_MODULE_MANAGEMENT,
'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']
);
} else {
db_pandora_audit('Module management', 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
db_pandora_audit(
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']
);
}
ui_print_result_message(
@ -2244,9 +2256,15 @@ if ($disable_module) {
if ($result === NOERR) {
enterprise_hook('config_agents_disable_module_conf', [$id_agente, $disable_module]);
db_pandora_audit('Module management', 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
db_pandora_audit(
AUDIT_LOG_MODULE_MANAGEMENT,
'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']
);
} else {
db_pandora_audit('Module management', 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
db_pandora_audit(
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']
);
}
ui_print_result_message(

View File

@ -16,7 +16,10 @@ global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access Group Management2');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';
return;
}

View File

@ -18,7 +18,7 @@ check_login();
if (!check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';

View File

@ -58,7 +58,7 @@ if (! check_acl(
)
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent manager'
);
include 'general/noaccess.php';
@ -158,7 +158,7 @@ if ($agent_to_delete) {
} else {
// NO permissions.
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
"Trying to delete agent \'".agents_get_name($id_agente)."\'"
);
include 'general/noaccess.php';
@ -219,12 +219,12 @@ if ($enable_agent) {
]
);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Enable '.$alias
);
} else {
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Fail to enable '.$alias
);
}
@ -262,12 +262,12 @@ if ($disable_agent) {
);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Disable '.$alias
);
} else {
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Fail to disable '.$alias
);
}

View File

@ -261,7 +261,7 @@ if ($module_action === 'delete') {
if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to delete a module without admin rights'
);
include 'general/noaccess.php';

View File

@ -549,7 +549,7 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) {
);
db_pandora_audit(
'Agent management',
AUDIT_LOG_AGENT_MANAGEMENT,
'Re-link module '.$id_agent_module
);
}
@ -562,7 +562,10 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) {
__('Module will be unlinked in the next application')
);
db_pandora_audit('Agent management', 'Unlink module '.$id_agent_module);
db_pandora_audit(
AUDIT_LOG_AGENT_MANAGEMENT,
'Unlink module '.$id_agent_module
);
}
}
@ -582,7 +585,7 @@ if ($__code_from !== 'policies') {
if (!$tag_acl) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent manager'
);
include 'general/noaccess.php';

View File

@ -73,7 +73,7 @@ if ($edit_networkmap) {
if (!$networkmap_write && !$networkmap_manage) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access networkmap'
);
include 'general/noaccess.php';

View File

@ -38,7 +38,7 @@ $agent_w = check_acl($config['id_user'], 0, 'AW');
$access = ($agent_d == true) ? 'AD' : (($agent_w == true) ? 'AW' : 'AD');
if (!$agent_d && !$agent_w) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -169,7 +169,7 @@ if ($delete_downtime_agent === 1) {
|| !in_array($downtime_group, $user_groups_ad)
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -188,7 +188,7 @@ if ($delete_downtime_agent === 1) {
|| !in_array($agent_group, $user_groups_ad)
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -265,7 +265,7 @@ if ($create_downtime || $update_downtime) {
// Check AD permission on new downtime.
if (!in_array($id_group, $user_groups_ad)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -323,7 +323,7 @@ if ($create_downtime || $update_downtime) {
// Check AD permission on OLD downtime.
if (empty($old_downtime) || !in_array($old_downtime['id_group'], $user_groups_ad)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -333,7 +333,7 @@ if ($create_downtime || $update_downtime) {
// Check AD permission on NEW downtime group.
if (!in_array($id_group, $user_groups_ad)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -487,7 +487,7 @@ if ($id_downtime > 0) {
// Permission check for the downtime with the AD user groups
if (empty($result) || !in_array($result['id_group'], $user_groups_ad)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -1082,7 +1082,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|| !in_array($downtime_group, $user_groups_ad)
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';

View File

@ -23,7 +23,10 @@ require_once '../../include/functions_reporting.php';
$config['id_user'] = $_SESSION['id_usuario'];
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit('ACL Violation', 'Trying to access downtime scheduler');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
return;
}

View File

@ -23,7 +23,7 @@ $access = ($read_permisson == true) ? 'AR' : (($write_permisson == true) ? 'AD'
if (! $read_permisson && !$manage_permisson) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -70,7 +70,7 @@ if ($stop_downtime) {
// Check AD permission on the downtime
if (empty($downtime) || (! check_acl($config['id_user'], $downtime['id_group'], 'AD') && ! check_acl($config['id_user'], $downtime['id_group'], 'AW'))) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';
@ -94,7 +94,7 @@ if ($delete_downtime) {
// Check AD permission on the downtime
if (empty($downtime) || (! check_acl($config['id_user'], $downtime['id_group'], 'AD') && ! check_acl($config['id_user'], $downtime['id_group'], 'AW'))) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access downtime scheduler'
);
include 'general/noaccess.php';

View File

@ -20,7 +20,7 @@ if (! check_acl($config['id_user'], 0, 'AR')
&& ! check_acl($config['id_user'], 0, 'AM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Management'
);
include 'general/noaccess.php';

View File

@ -42,7 +42,7 @@ enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert actions'
);
include 'general/noaccess.php';
@ -104,7 +104,7 @@ if ($copy_action) {
// Then action group have to be in his own groups.
if (!$is_in_group) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -117,12 +117,12 @@ if ($copy_action) {
if ($result) {
db_pandora_audit(
'Command management',
AUDIT_LOG_COMMAND_MANAGEMENT,
'Duplicate alert action '.$id.' clone to '.$result
);
} else {
db_pandora_audit(
'Command management',
AUDIT_LOG_COMMAND_MANAGEMENT,
'Fail try to duplicate alert action '.$id
);
}
@ -145,7 +145,7 @@ if ($delete_action) {
if (!check_acl_restricted_all($config['id_user'], $al_action['id_group'], 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -158,7 +158,7 @@ if ($delete_action) {
// Then must have "PM" access privileges.
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -182,7 +182,7 @@ if ($delete_action) {
// Then action group have to be in his own groups.
if (!$is_in_group) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -196,12 +196,12 @@ if ($delete_action) {
if ($result) {
db_pandora_audit(
'Command management',
AUDIT_LOG_COMMAND_MANAGEMENT,
'Delete alert action #'.$id
);
} else {
db_pandora_audit(
'Command management',
AUDIT_LOG_COMMAND_MANAGEMENT,
'Fail try to delete alert action #'.$id
);
}

View File

@ -21,7 +21,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -538,9 +538,20 @@ if ($create_command) {
}
if ($result) {
db_pandora_audit('Command management', 'Create alert command #'.$result, false, false, $info);
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Create alert command #'.$result,
false,
false,
$info
);
} else {
db_pandora_audit('Command management', 'Fail try to create alert command', false, false);
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Fail try to create alert command',
false,
false
);
}
// Show errors.
@ -570,7 +581,7 @@ if ($delete_command) {
// Internal commands cannot be deleted.
if (alerts_get_alert_command_internal($id)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -580,9 +591,9 @@ if ($delete_command) {
$result = alerts_delete_alert_command($id);
if ($result) {
db_pandora_audit('Command management', 'Delete alert command #'.$id);
db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Delete alert command #'.$id);
} else {
db_pandora_audit('Command management', 'Fail try to delete alert command #'.$id);
db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Fail try to delete alert command #'.$id);
}
ui_print_result_message(

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'LW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';

View File

@ -22,7 +22,7 @@ if (! check_acl($config['id_user'], 0, 'LW')
&& ! check_acl($config['id_user'], 0, 'LM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';

View File

@ -21,7 +21,7 @@ if (! check_acl($config['id_user'], 0, 'LW')
&& ! check_acl($config['id_user'], 0, 'LM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -146,7 +146,7 @@ if ($create_alert) {
$unsafe_agent_alias = io_safe_output($agent_alias);
if ($id) {
db_pandora_audit(
'Alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
"Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'",
false,
false,
@ -154,7 +154,7 @@ if ($create_alert) {
);
} else {
db_pandora_audit(
'Alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
"Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'"
);
}
@ -217,12 +217,12 @@ if ($delete_alert) {
if ($result) {
db_pandora_audit(
'Alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
"Deleted alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'"
);
} else {
db_pandora_audit(
'Alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
"Fail to deleted alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'"
);
}
@ -255,9 +255,9 @@ if ($add_action) {
$result = alerts_add_alert_agent_module_action($id_alert_module, $id_action, $values);
if ($result) {
db_pandora_audit('Alert management', 'Add action '.$id_action.' in alert '.$id_alert_module);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Add action '.$id_action.' in alert '.$id_alert_module);
} else {
db_pandora_audit('Alert management', 'Fail to add action '.$id_action.' in alert '.$id_alert_module);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to add action '.$id_action.' in alert '.$id_alert_module);
}
$messageAction = ui_print_result_message(
@ -290,9 +290,9 @@ if ($update_action) {
$result = alerts_update_alert_agent_module_action($id_module_action, $values);
if ($result) {
db_pandora_audit('Alert management', 'Update action '.$id_action.' in alert '.$id_alert_module);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Update action '.$id_action.' in alert '.$id_alert_module);
} else {
db_pandora_audit('Alert management', 'Fail to updated action '.$id_action.' in alert '.$id_alert_module);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to updated action '.$id_action.' in alert '.$id_alert_module);
}
$messageAction = ui_print_result_message(
@ -311,9 +311,9 @@ if ($delete_action) {
$result = alerts_delete_alert_agent_module_action($id_action);
if ($result) {
db_pandora_audit('Alert management', 'Delete action '.$id_action.' in alert '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Delete action '.$id_action.' in alert '.$id_alert);
} else {
db_pandora_audit('Alert management', 'Fail to delete action '.$id_action.' in alert '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to delete action '.$id_action.' in alert '.$id_alert);
}
$messageAction = ui_print_result_message(
@ -332,9 +332,9 @@ if ($enable_alert) {
$result = alerts_agent_module_disable($id_alert, false);
if ($result) {
db_pandora_audit('Alert management', 'Enable '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Enable '.$id_alert);
} else {
db_pandora_audit('Alert management', 'Fail to enable '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to enable '.$id_alert);
}
$messageAction = ui_print_result_message(
@ -353,9 +353,9 @@ if ($disable_alert) {
$result = alerts_agent_module_disable($id_alert, true);
if ($result) {
db_pandora_audit('Alert management', 'Disable '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Disable '.$id_alert);
} else {
db_pandora_audit('Alert management', 'Fail to disable '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to disable '.$id_alert);
}
$messageAction = ui_print_result_message(
@ -374,9 +374,9 @@ if ($standbyon_alert) {
$result = alerts_agent_module_standby($id_alert, true);
if ($result) {
db_pandora_audit('Alert management', 'Standby '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Standby '.$id_alert);
} else {
db_pandora_audit('Alert management', 'Fail to standby '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to standby '.$id_alert);
}
$messageAction = ui_print_result_message(
@ -395,9 +395,9 @@ if ($standbyoff_alert) {
$result = alerts_agent_module_standby($id_alert, false);
if ($result) {
db_pandora_audit('Alert management', 'Standbyoff '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Standbyoff '.$id_alert);
} else {
db_pandora_audit('Alert management', 'Fail to standbyoff '.$id_alert);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail to standbyoff '.$id_alert);
}
$messageAction = ui_print_result_message(

View File

@ -108,7 +108,7 @@ if (is_ajax()) {
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -118,12 +118,7 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
$update_template = (bool) get_parameter('update_template');
$delete_template = (bool) get_parameter('delete_template');
$pure = get_parameter('pure', 0);
if (defined('METACONSOLE')) {
$sec = 'advanced';
} else {
$sec = 'galertas';
}
$sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
// This prevents to duplicate the header in
// case delete_templete action is performed.
@ -175,7 +170,7 @@ if ($delete_template) {
if ($al_template['id_group'] == 0) {
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -217,7 +212,7 @@ if ($delete_template) {
}
} else {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -242,12 +237,12 @@ if ($delete_template) {
if ($result) {
db_pandora_audit(
'Template alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
'Delete alert template #'.$id
);
} else {
db_pandora_audit(
'Template alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
'Fail try to delete alert template #'.$id
);
}

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert View (In management section)'
);
include 'general/noaccess.php';

View File

@ -23,7 +23,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -96,7 +96,7 @@ if ($al_action !== false) {
}
if (!$is_in_group && $al_action['id_group'] != 0) {
db_pandora_audit('ACL Violation', 'Trying to access unauthorized alert action configuration');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access unauthorized alert action configuration');
include 'general/noaccess.php';
exit;
}

View File

@ -23,7 +23,7 @@ enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -52,7 +52,7 @@ if ($id > 0) {
$alert = alerts_get_alert_command($id);
if ($alert['internal'] || !check_acl_restricted_all($config['id_user'], $alert['id_group'], 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access Alert Management');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management');
include 'general/noaccess.php';
exit;
}
@ -110,9 +110,9 @@ if ($update_command) {
}
if ($result) {
db_pandora_audit('Command management', 'Update alert command #'.$id, false, false, $info);
db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Update alert command #'.$id, false, false, $info);
} else {
db_pandora_audit('Command management', 'Fail to update alert command #'.$id, false, false);
db_pandora_audit(AUDIT_LOG_COMMAND_MANAGEMENT, 'Fail to update alert command #'.$id, false, false);
}
ui_print_result_message(

View File

@ -26,7 +26,7 @@ enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -109,7 +109,7 @@ if ($a_template !== false) {
}
} else {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
include 'general/noaccess.php';
@ -153,9 +153,9 @@ if ($duplicate_template) {
$id = alerts_duplicate_alert_template($source_id, $a_template['id_group']);
if ($id) {
db_pandora_audit('Template alert management', 'Duplicate alert template '.$source_id.' clone to '.$id);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Duplicate alert template '.$source_id.' clone to '.$id);
} else {
db_pandora_audit('Template alert management', 'Fail try to duplicate alert template '.$source_id);
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to duplicate alert template '.$source_id);
}
ui_print_result_message(
@ -364,9 +364,9 @@ function update_template($step)
}
if ($result) {
db_pandora_audit('Template alert management', 'Update alert template #'.$id, false, false, json_encode($values));
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Update alert template #'.$id, false, false, json_encode($values));
} else {
db_pandora_audit('Template alert management', 'Fail try to update alert template #'.$id, false, false, json_encode($values));
db_pandora_audit(AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to update alert template #'.$id, false, false, json_encode($values));
}
return $result;
@ -491,7 +491,7 @@ if ($create_template) {
if ($result) {
db_pandora_audit(
'Template alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
'Create alert template #'.$result,
false,
false,
@ -499,7 +499,7 @@ if ($create_template) {
);
} else {
db_pandora_audit(
'Template alert management',
AUDIT_LOG_ALERT_MANAGEMENT,
'Fail try to create alert template',
false,
false,

View File

@ -32,7 +32,10 @@ if (!isset($_SESSION['id_usuario'])) {
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access audit CSV export');
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access audit CSV export'
);
include 'general/noaccess.php';
exit;
}

View File

@ -35,7 +35,7 @@ check_login();
enterprise_hook('open_meta_frame');
if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Categories Management');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Categories Management');
include 'general/noaccess.php';
return;
}
@ -113,10 +113,10 @@ if (is_management_allowed() === false) {
if ($is_management_allowed === true && $delete != 0) {
$return_delete = categories_delete_category($delete);
if (!$return_delete) {
db_pandora_audit('Category management', 'Fail try to delete category #'.$delete);
db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, 'Fail try to delete category #'.$delete);
ui_print_error_message(__('Error deleting category'));
} else {
db_pandora_audit('Category management', 'Delete category #'.$delete);
db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, 'Delete category #'.$delete);
ui_print_success_message(__('Successfully deleted category'));
}
}

View File

@ -19,7 +19,7 @@ enterprise_hook('open_meta_frame');
require_once $config['homedir'].'/include/functions_categories.php';
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Edit Category');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Edit Category');
include 'general/noaccess.php';
return;
@ -85,10 +85,10 @@ if ($update_category && $id_category != 0) {
}
if ($result === false) {
db_pandora_audit('Category management', "Fail try to update category #$id_category");
db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, "Fail try to update category #$id_category");
ui_print_error_message(__('Error updating category'));
} else {
db_pandora_audit('Category management', "Update category #$id_category");
db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, "Update category #$id_category");
ui_print_success_message(__('Successfully updated category'));
}
}
@ -107,12 +107,12 @@ if ($create_category) {
}
if ($return_create === false) {
db_pandora_audit('Category management', 'Fail try to create category');
db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, 'Fail try to create category');
ui_print_error_message(__('Error creating category'));
$action = 'new';
// If create action ends successfully then current action is update
} else {
db_pandora_audit('Category management', "Create category #$return_create");
db_pandora_audit(AUDIT_LOG_CATEGORY_MANAGEMENT, "Create category #$return_create");
ui_print_success_message(__('Successfully created category'));
$id_category = $return_create;
$action = 'update';

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'DM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Database Management'
);
include 'general/noaccess.php';

View File

@ -17,7 +17,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Custom events Management'
);
include 'general/noaccess.php';

View File

@ -21,7 +21,7 @@ $access = ($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'EW');
if (!$event_w && !$event_m) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access events filter editor'
);
include 'general/noaccess.php';

View File

@ -22,7 +22,7 @@ $access = ($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'EW');
if (!$event_w && !$event_m) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access events filter editor'
);
include 'general/noaccess.php';
@ -43,7 +43,7 @@ if ($delete) {
&& !check_acl_restricted_all($config['id_user'], $filter_group, 'EM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access events filter editor'
);
include 'general/noaccess.php';

View File

@ -17,7 +17,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';
@ -43,7 +43,7 @@ if ($event_response_id > 0) {
// ACL check for event response edition.
if (!check_acl_restricted_all($config['id_user'], $event_response['id_group'], 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';

View File

@ -19,7 +19,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';

View File

@ -19,7 +19,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';

View File

@ -20,7 +20,7 @@ enterprise_hook('open_meta_frame');
if (!check_acl($config['id_user'], 0, 'EW') && !check_acl($config['id_user'], 0, 'EM') && ! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access event manage'
);
include 'general/noaccess.php';

View File

@ -17,7 +17,7 @@ global $config;
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access extensions list'
);
include 'general/noaccess.php';

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit('ACL Violation', 'Trying to access Group Management2');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management2');
include 'general/noaccess.php';
return;
}

View File

@ -18,7 +18,7 @@ check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access Group Management2');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management2');
include 'general/noaccess.php';
return;
}

View File

@ -47,7 +47,7 @@ if (is_metaconsole() === true) {
if (is_ajax() === true) {
if ((bool) check_acl($config['id_user'], 0, 'AR') === false) {
db_pandora_audit('ACL Violation', 'Trying to access Group Management');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management');
include 'general/noaccess.php';
return;
}
@ -74,7 +74,7 @@ if (is_ajax() === true) {
if ((bool) check_acl($config['id_user'], $id_group, 'AR') === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
echo json_encode(false);
@ -116,7 +116,7 @@ if (is_ajax() === true) {
if ((bool) check_acl($config['id_user'], $id_group, 'AR') === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
echo json_encode(false);
@ -270,7 +270,7 @@ if ($tab !== 'credbox'
&& (bool) check_acl($config['id_user'], 0, 'AW') === false
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';
@ -280,7 +280,7 @@ if ($tab !== 'credbox'
&& (bool) check_acl($config['id_user'], 0, 'PM') === false
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Credential Store'
);
include 'general/noaccess.php';

View File

@ -32,7 +32,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Group Management'
);
include 'general/noaccess.php';
@ -48,7 +48,7 @@ if (is_ajax() === true) {
if (! check_acl($config['id_user'], $id_group, 'AR')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Alert Management'
);
echo json_encode(false);

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive agent deletion section'
);
include 'general/noaccess.php';
@ -150,7 +150,7 @@ if ($add) {
'Fires_max' => $fires_max,
'Actions' => implode(',', $actions),
];
db_pandora_audit('Massive management', 'Add alert action '.json_encode($id_agents), false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Add alert action '.json_encode($id_agents), false, false, json_encode($info));
ui_print_result_message($results, __('Successfully added'), __('Could not be added'));
}
} else {

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive alert deletion'
);
include 'general/noaccess.php';
@ -139,16 +139,16 @@ function process_manage_add($id_alert_template, $id_agents, $module_names)
$success = alerts_create_alert_agent_module($module, $id_alert_template);
if ($success) {
$contsuccess ++;
$contsuccess++;
}
$conttotal ++;
$conttotal++;
}
if ($contsuccess > 0) {
db_pandora_audit('Massive management', 'Add alert', false, false, 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Add alert', false, false, 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id));
} else {
db_pandora_audit('Massive management', 'Fail try to add alert', false, false, 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to add alert', false, false, 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id));
}
ui_print_result_message(

View File

@ -31,7 +31,7 @@ check_login();
if (!check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive profile addition'
);
include 'general/noaccess.php';
@ -80,7 +80,7 @@ if ($create_profiles) {
// If the profile doesnt exist, we create it
if ($profile_data === false) {
db_pandora_audit(
'User management',
AUDIT_LOG_USER_MANAGEMENT,
'Added profile for user '.io_safe_input($user)
);
$return = profile_create_user_profile($user, $profile, $group);
@ -95,7 +95,7 @@ if ($create_profiles) {
if ($n_added > 0) {
db_pandora_audit(
'Massive management',
AUDIT_LOG_MASSIVE_MANAGEMENT,
'Add profiles',
false,
false,
@ -103,7 +103,7 @@ if ($create_profiles) {
);
} else {
db_pandora_audit(
'Massive management',
AUDIT_LOG_MASSIVE_MANAGEMENT,
'Fail to try add profiles',
false,
false,

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Config Management Admin section'
);
include 'general/noaccess.php';
@ -66,7 +66,7 @@ if ($do_operation) {
];
if ($result) {
db_pandora_audit(
'Massive management',
AUDIT_LOG_MASSIVE_MANAGEMENT,
'Copy modules',
false,
false,
@ -74,7 +74,7 @@ if ($do_operation) {
);
} else {
db_pandora_audit(
'Massive management',
AUDIT_LOG_MASSIVE_MANAGEMENT,
'Fail to try copy modules',
false,
false,

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive agent deletion section'
);
include 'general/noaccess.php';
@ -148,9 +148,9 @@ if ($delete) {
];
if ($results) {
db_pandora_audit('Massive management', 'Delete alert action', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete alert action', false, false, json_encode($info));
} else {
db_pandora_audit('Massive management', 'Fail try to delete alert action', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to delete alert action', false, false, json_encode($info));
}
ui_print_result_message(

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive agent deletion section'
);
include 'general/noaccess.php';
@ -104,9 +104,9 @@ if ($delete) {
$info = '{"Agent":"'.implode(',', $id_agents).'"}';
if ($result) {
db_pandora_audit('Massive management', 'Delete agent ', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete agent ', false, false, $info);
} else {
db_pandora_audit('Massive management', 'Fail try to delete agent', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to delete agent', false, false, $info);
}
}

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive alert deletion'
);
include 'general/noaccess.php';
@ -190,10 +190,10 @@ function process_manage_delete($id_alert_template, $id_agents, $module_names)
);
if ($success) {
$contsuccess ++;
$contsuccess++;
}
$conttotal ++;
$conttotal++;
}
ui_print_result_message(
@ -223,9 +223,9 @@ if ($delete) {
];
if ($result) {
db_pandora_audit('Massive management', 'Delete alert ', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete alert ', false, false, json_encode($info));
} else {
db_pandora_audit('Massive management', 'Fail try to delete alert', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to delete alert', false, false, json_encode($info));
}
}

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access agent massive deletion'
);
include 'general/noaccess.php';
@ -230,7 +230,7 @@ if ($delete) {
foreach ($module_name as $mod_name) {
$result = process_manage_delete($mod_name['nombre'], $id_agent['id_agente'], $modules_selection_mode);
$count ++;
$count++;
$success += (int) $result;
}
}
@ -267,9 +267,9 @@ if ($delete) {
'Module' => implode(',', $modules_),
];
if ($result) {
db_pandora_audit('Massive management', 'Delete module ', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete module ', false, false, json_encode($info));
} else {
db_pandora_audit('Massive management', 'Fail try to delete module', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to delete module', false, false, json_encode($info));
}
}

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive profile deletion'
);
include 'general/noaccess.php';
@ -96,7 +96,7 @@ if ($delete_profiles) {
} else {
foreach ($users as $user) {
db_pandora_audit(
'User management',
AUDIT_LOG_USER_MANAGEMENT,
'Deleted profile for user '.io_safe_input($user)
);
@ -111,9 +111,9 @@ if ($delete_profiles) {
];
if ($result) {
db_pandora_audit('Massive management', 'Delete profile ', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete profile ', false, false, json_encode($info));
} else {
db_pandora_audit('Massive management', 'Fail try to delete profile', false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to delete profile', false, false, json_encode($info));
}
ui_print_result_message(

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive agent deletion section'
);
include 'general/noaccess.php';
@ -56,7 +56,7 @@ if (is_ajax()) {
$name = agents_get_name($id_agent);
$agent_md5 = md5($name);
if (file_exists($config['remote_config'].'/md5/'.$agent_md5.'.md5')) {
$cont ++;
$cont++;
}
}
@ -189,9 +189,9 @@ if ($update_agents) {
if ($n_deleted > 0) {
db_pandora_audit('Massive management', 'Delete conf file '.$id_agent);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete conf file '.$id_agent);
} else {
db_pandora_audit('Massive management', 'Try to delete conf file '.$id_agent);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Try to delete conf file '.$id_agent);
}
@ -383,10 +383,10 @@ if ($update_agents) {
if ($result !== false) {
db_pandora_audit('Massive management', 'Update agent '.$id_agent, false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Update agent '.$id_agent, false, false, json_encode($info));
} else {
if (isset($id_agent)) {
db_pandora_audit('Massive management', 'Try to update agent '.$id_agent, false, false, json_encode($info));
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Try to update agent '.$id_agent, false, false, json_encode($info));
}
}

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive module update'
);
include 'general/noaccess.php';
@ -187,9 +187,9 @@ if ($update) {
$info = '{"Modules":"'.implode(',', $modules_).'","Agents":"'.implode(',', $agents_).'"}';
if ($success > 0) {
db_pandora_audit('Massive management', 'Edit module', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Edit module', false, false, $info);
} else {
db_pandora_audit('Massive management', 'Fail try to edit module', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to edit module', false, false, $info);
}
}

View File

@ -33,7 +33,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive plugin edition section'
);
include 'general/noaccess.php';

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive alert deletion'
);
include 'general/noaccess.php';
@ -103,9 +103,9 @@ switch ($action) {
$info = '{"Alert":"'.implode(',', $id_disabled_alerts).'"}';
if ($result) {
db_pandora_audit('Massive management', 'Enable alert', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Enable alert', false, false, $info);
} else {
db_pandora_audit('Massive management', 'Fail try to enable alert', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to enable alert', false, false, $info);
}
break;
@ -121,9 +121,9 @@ switch ($action) {
$info = '{"Alert":"'.implode(',', $id_enabled_alerts).'"}';
if ($result) {
db_pandora_audit('Massive management', 'Disable alert', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Disable alert', false, false, $info);
} else {
db_pandora_audit('Massive management', 'Fail try to Disable alert', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to Disable alert', false, false, $info);
}
break;

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive operation section'
);
include 'general/noaccess.php';

View File

@ -31,7 +31,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access massive alert deletion'
);
include 'general/noaccess.php';
@ -103,9 +103,9 @@ switch ($action) {
$info = '{"Alert":"'.implode(',', $id_standby_alerts).'"}';
if ($result) {
db_pandora_audit('Massive management', 'Set off standby alerts', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Set off standby alerts', false, false, $info);
} else {
db_pandora_audit('Massive management', 'Fail try to set off standby alerts', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to set off standby alerts', false, false, $info);
}
break;
@ -121,9 +121,9 @@ switch ($action) {
$info = '{"Alert":"'.implode(',', $id_not_standby_alerts).'"}';
if ($result) {
db_pandora_audit('Massive management', 'Set on standby alerts', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Set on standby alerts', false, false, $info);
} else {
db_pandora_audit('Massive management', 'Fail try to set on standby alerts', false, false, $info);
db_pandora_audit(AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to set on standby alerts', false, false, $info);
}
break;

View File

@ -32,7 +32,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'AR')) {
// Doesn't have access to this page.
db_pandora_audit('ACL Violation', 'Trying to access Module Library View');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Module Library View');
include 'general/noaccess.php';
exit;
}

View File

@ -25,7 +25,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Network Profile Management'
);
include 'general/noaccess.php';

View File

@ -20,7 +20,7 @@ enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access SNMP Group Management'
);
include 'general/noaccess.php';
@ -73,9 +73,9 @@ if ($create) {
]
);
if ($result) {
db_pandora_audit('Module management', "Create component group #$result");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Create component group #$result");
} else {
db_pandora_audit('Module management', 'Fail try to create component group');
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, 'Fail try to create component group');
}
ui_print_result_message(
@ -102,9 +102,9 @@ if ($update) {
['id_sg' => $id]
);
if ($result) {
db_pandora_audit('Module management', "Update component group #$id");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Update component group #$id");
} else {
db_pandora_audit('Module management', "Fail try to update component group #$id");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Fail try to update component group #$id");
}
ui_print_result_message(
@ -132,9 +132,9 @@ if ($delete) {
}
if ($result) {
db_pandora_audit('Module management', "Delete component group #$id");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Delete component group #$id");
} else {
db_pandora_audit('Module management', "Fail try to delete component group #$id");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Fail try to delete component group #$id");
}
ui_print_result_message(
@ -170,12 +170,12 @@ if ($multiple_delete) {
$str_ids = implode(',', $ids);
if ($result) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
"Multiple delete component group: $str_ids"
);
} else {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
"Fail try to delete component group: $str_ids"
);
}

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access SNMO Groups Management'
);
include 'general/noaccess.php';

View File

@ -34,7 +34,7 @@ enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Management'
);
include 'general/noaccess.php';
@ -415,7 +415,7 @@ if ($is_management_allowed === true && $create_component) {
if ($id === false || !$id) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail try to create remote component'
);
@ -431,7 +431,7 @@ if ($is_management_allowed === true && $create_component) {
return;
}
db_pandora_audit('Module management', 'Create network component #'.$id);
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, 'Create network component #'.$id);
ui_print_success_message(__('Created successfully'));
$id = 0;
}
@ -516,7 +516,7 @@ if ($is_management_allowed === true && $update_component) {
if ($result === false || !$result) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail try to update network component #'.$id
);
ui_print_error_message(__('Could not be updated'));
@ -524,7 +524,7 @@ if ($is_management_allowed === true && $update_component) {
return;
}
db_pandora_audit('Module management', 'Update network component #'.$id);
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, 'Update network component #'.$id);
ui_print_success_message(__('Updated successfully'));
$id = 0;
@ -537,12 +537,12 @@ if ($is_management_allowed === true && $delete_component) {
if ($result) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Delete network component #'.$id
);
} else {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail try to delete network component #'.$id
);
}
@ -569,12 +569,12 @@ if ($is_management_allowed === true && $multiple_delete) {
$str_ids = implode(',', $ids);
if ($result) {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Multiple delete network component:'.$str_ids
);
} else {
db_pandora_audit(
'Module management',
AUDIT_LOG_MODULE_MANAGEMENT,
'Fail try to delete network component:'.$str_ids
);
}

View File

@ -33,7 +33,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Management'
);
include 'general/noaccess.php';

View File

@ -18,7 +18,7 @@ include_javascript_d3();
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Management'
);
include 'general/noaccess.php';

View File

@ -33,7 +33,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Management'
);
include 'general/noaccess.php';

View File

@ -19,7 +19,7 @@ include_javascript_d3();
if (!check_acl($config['id_user'], 0, 'PM')
&& !check_acl($config['id_user'], 0, 'AW')
) {
db_pandora_audit('ACL Violation', 'Trying to access Agent Management');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management');
include 'general/noaccess.php';
return;
}

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent Management'
);
include 'general/noaccess.php';

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Network Profile Management'
);
include 'general/noaccess.php';
@ -67,9 +67,9 @@ if ($delete_profile) {
$result = network_profiles_delete_network_profile($id);
if ($result) {
db_pandora_audit('Module management', "Delete module template #$id");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Delete module template #$id");
} else {
db_pandora_audit('Module management', "Fail try to delete module template #$id");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Fail try to delete module template #$id");
}
ui_print_result_message(
@ -92,9 +92,9 @@ if ($multiple_delete) {
$str_ids = implode(',', $ids);
if ($result) {
db_pandora_audit('Module management', "Multiple delete module template: $str_ids");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Multiple delete module template: $str_ids");
} else {
db_pandora_audit('Module management', "Fail try to delete module template: $str_ids");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Fail try to delete module template: $str_ids");
}
ui_print_result_message(

View File

@ -19,7 +19,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Network Profile Management'
);
include 'general/noaccess.php';
@ -97,9 +97,9 @@ if (isset($_GET['create']) || isset($_GET['update'])) {
$result = db_process_sql_update('tnetwork_profile', $values, ['id_np' => $id_np]);
if ($result) {
db_pandora_audit('Module management', "Update module template #$id_np");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Update module template #$id_np");
} else {
db_pandora_audit('Module management', "Fail try to update module template #$id_np");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Fail try to update module template #$id_np");
}
ui_print_result_message(
@ -116,9 +116,9 @@ if (isset($_GET['create']) || isset($_GET['update'])) {
$result = db_process_sql_insert('tnetwork_profile', $values);
if ($result) {
db_pandora_audit('Module management', "Create module template #$result");
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, "Create module template #$result");
} else {
db_pandora_audit('Module management', 'Fail try to create module template');
db_pandora_audit(AUDIT_LOG_MODULE_MANAGEMENT, 'Fail try to create module template');
}
ui_print_result_message(

View File

@ -17,7 +17,7 @@ global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access module management');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to access module management');
include 'general/noaccess.php';
exit;
}

View File

@ -23,7 +23,7 @@ enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access event viewer'
);
include 'general/noaccess.php';
@ -73,7 +73,7 @@ if ($id > 0) {
if (!check_acl_restricted_all($config['id_user'], $filter_group, 'AW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access events filter editor'
);
include 'general/noaccess.php';

View File

@ -25,7 +25,7 @@ enterprise_hook('open_meta_frame');
// Fix: Netflow have to check RW ACL
if (! check_acl($config['id_user'], 0, 'RW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access event viewer'
);
include $config['homedir'].'/general/noaccess.php';

View File

@ -18,7 +18,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'RW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Inventory Module Management'
);
include 'general/noaccess.php';

View File

@ -20,7 +20,7 @@ $report_m = check_acl($config['id_user'], 0, 'RM');
if (!$report_w && !$report_m) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access graph builder'
);
include 'general/noaccess.php';

View File

@ -66,7 +66,7 @@ if (! check_acl($config['id_user'], 0, 'RW')
&& ! check_acl($config['id_user'], 0, 'RM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access graph builder'
);
include 'general/noaccess.php';

View File

@ -65,7 +65,7 @@ if (! check_acl($config['id_user'], 0, 'RW')
&& ! check_acl($config['id_user'], 0, 'RM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access graph builder'
);
include 'general/noaccess.php';
@ -90,7 +90,7 @@ if ($id_graph > 0) {
&& !check_acl_restricted_all($config['id_user'], $graph_group, 'RM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access graph builder'
);
include 'general/noaccess.php';
@ -146,9 +146,9 @@ if ($add_graph === true) {
if (trim($name) != '') {
$id_graph = db_process_sql_insert('tgraph', $values);
if ($id_graph !== false) {
db_pandora_audit('Report management', 'Create graph #'.$id_graph);
db_pandora_audit(AUDIT_LOG_REPORT_MANAGEMENT, 'Create graph #'.$id_graph);
} else {
db_pandora_audit('Report management', 'Fail try to create graph');
db_pandora_audit(AUDIT_LOG_REPORT_MANAGEMENT, 'Fail try to create graph');
}
} else {
$id_graph = false;
@ -199,12 +199,12 @@ if ($update_graph) {
);
if ($success !== false) {
db_pandora_audit(
'Report management',
AUDIT_LOG_REPORT_MANAGEMENT,
'Update graph #'.$id_graph
);
} else {
db_pandora_audit(
'Report management',
AUDIT_LOG_REPORT_MANAGEMENT,
'Fail try to update graph #'.$id_graph
);
}

View File

@ -34,7 +34,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'RR') || enterprise_installed() === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Graph container'
);
include 'general/noaccess.php';

View File

@ -40,7 +40,7 @@ $report_m = check_acl($config['id_user'], 0, 'RM');
if (!$report_r && !$report_w && !$report_m) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Inventory Module Management'
);
include 'general/noaccess.php';
@ -155,17 +155,19 @@ if ($delete_graph) {
$result = db_process_sql_delete('tgraph', ['id_graph' => $id]);
if ($result) {
db_pandora_audit('Report management', "Delete graph #$id");
$result = ui_print_success_message(__('Successfully deleted'));
} else {
db_pandora_audit('Report management', "Fail try to delete graph #$id");
$result = ui_print_error_message(__('Not deleted. Error deleting data'));
}
$auditMessage = ($result === true) ? 'Delete graph' : 'Fail try to delete graph';
ui_print_result_message(
$result,
__('Successfully deleted'),
__('Not deleted. Error deleting data')
);
db_pandora_audit(AUDIT_LOG_REPORT_MANAGEMENT, sprintf('%s #%s', $auditMessage, $id));
echo $result;
} else {
db_pandora_audit('ACL Violation', 'Trying to delete a graph from access graph builder');
db_pandora_audit(AUDIT_LOG_ACL_VIOLATION, 'Trying to delete a graph from access graph builder');
include 'general/noaccess.php';
exit;
}
@ -191,12 +193,11 @@ if ($multiple_delete) {
$result = false;
}
$auditMessage = ($result === true) ? 'Multiple delete graph' : 'Fail try to delete graphs';
$str_ids = implode(',', $ids);
if ($result) {
db_pandora_audit('Report management', "Multiple delete graph: $str_ids");
} else {
db_pandora_audit('Report management', "Fail try to delete graphs: $str_ids");
}
db_pandora_audit(AUDIT_LOG_REPORT_MANAGEMENT, sprintf('%s: %s', $auditMessage, $str_ids));
ui_print_result_message(
$result,

View File

@ -41,7 +41,7 @@ $is_metaconsole = is_metaconsole();
if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access map builder'
);
include 'general/noaccess.php';
@ -157,7 +157,7 @@ if ($delete_layout || $copy_layout) {
// Visual console required
if (empty($id_layout)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access map builder'
);
include 'general/noaccess.php';
@ -167,7 +167,7 @@ if ($delete_layout || $copy_layout) {
$group_id = db_get_value('id_group', 'tlayout', 'id', $id_layout);
if ($group_id === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access map builder'
);
include 'general/noaccess.php';
@ -181,7 +181,7 @@ if ($delete_layout || $copy_layout) {
if (!$vconsole_write && !$vconsole_manage) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access map builder'
);
include 'general/noaccess.php';
@ -197,22 +197,20 @@ if ($delete_layout || $copy_layout) {
'tlayout',
['id' => $id_layout]
);
if ($result) {
db_pandora_audit(
'Visual console builder',
"Delete visual console #$id_layout"
);
ui_print_success_message(__('Successfully deleted'));
db_clean_cache();
} else {
db_pandora_audit(
'Visual console builder',
"Fail try to delete visual console #$id_layout"
);
ui_print_error_message(
__('Not deleted. Error deleting data')
);
}
$auditMessage = ((bool) $result === true) ? 'Delete visual console' : 'Fail try to delete visual console';
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('%s #%s', $auditMessage, $id_layout)
);
ui_print_result_message(
(bool) $result,
__('Successfully deleted'),
__('Not deleted. Error deleting data')
);
db_clean_cache();
$id_layout = 0;
}

View File

@ -40,7 +40,7 @@ if (! check_acl($config['id_user'], 0, 'RW')
&& ! check_acl($config['id_user'], 0, 'RM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';

View File

@ -33,7 +33,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'RW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';

View File

@ -27,7 +27,7 @@ check_login();
if (! check_acl($config['id_user'], 0, 'RW')) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';

View File

@ -64,7 +64,7 @@ function dialog_message(message_id) {
.addClass('checkselected');
$(".check_delete").prop("checked", true);
$('.check_delete').each(function(){
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
});
}
else{
@ -128,7 +128,7 @@ $report_m = check_acl($config['id_user'], 0, 'RM');
$access = ($report_r == true) ? 'RR' : (($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RR'));
if (!$report_r && !$report_w && !$report_m) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';
@ -172,7 +172,7 @@ if ($action === 'edit' && $idReport > 0) {
&& ! check_acl_restricted_all($config['id_user'], $report_group, 'RM')
) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';
@ -263,7 +263,7 @@ if ($idReport != 0) {
if (!$delete_report_bypass) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';
@ -625,7 +625,7 @@ switch ($action) {
$delete = true;
// Owner can delete.
} else {
$delete = check_acl(
$delete = (bool) check_acl(
$config['id_user'],
$report['id_group'],
'RM'
@ -646,9 +646,9 @@ switch ($action) {
break;
}
if (! $delete && !empty($type_access_selected)) {
if ($delete === false && empty($type_access_selected) === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder deletion'
);
include 'general/noaccess.php';
@ -656,17 +656,12 @@ switch ($action) {
}
$result = reports_delete_report($idReport);
if ($result !== false) {
db_pandora_audit(
'Report management',
'Delete report #'.$idReport
);
} else {
db_pandora_audit(
'Report management',
'Fail try to delete report #'.$idReport
);
}
$auditMessage = ($result !== false) ? 'Delete report' : 'Fail try to delete report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
sprintf('%s #%s', $auditMessage, $idReport)
);
ui_print_result_message(
$result,
@ -721,9 +716,9 @@ switch ($action) {
break;
}
if (! $copy && !empty($type_access_selected)) {
if (! $copy && empty($type_access_selected) === false) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder copy'
);
include 'general/noaccess.php';
@ -731,17 +726,11 @@ switch ($action) {
}
$result = reports_copy_report($idReport);
if ($result !== false) {
db_pandora_audit(
'Report management',
'Copy report #'.$idReport
);
} else {
db_pandora_audit(
'Report management',
'Fail try to copy report #'.$idReport
);
}
$auditMessage = ((bool) $result === true) ? 'Copy report' : 'Fail try to copy report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
sprintf('%s #%s', $auditMessage, $idReport)
);
ui_print_result_message(
$result,
@ -1421,23 +1410,17 @@ switch ($action) {
['id_report' => $idReport]
);
if ($resultOperationDB !== false) {
db_pandora_audit(
'Report management',
'Update report #'.$idReport
);
} else {
db_pandora_audit(
'Report management',
'Fail try to update report #'.$idReport
);
}
$auditMessage = ($resultOperationDB === true) ? 'Update report' : 'Fail try to update report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
sprintf('%s #%s', $auditMessage, $idReport)
);
} else {
$resultOperationDB = false;
}
$action = 'edit';
} else if ($action == 'save') {
} else if ($action === 'save') {
if ($reportName != '' && $idGroupReport != '') {
// This flag allow to differentiate
// between normal console and metaconsole reports.
@ -1482,17 +1465,11 @@ switch ($action) {
]
);
if ($idOrResult !== false) {
db_pandora_audit(
'Report management',
'Create report #'.$idOrResult
);
} else {
db_pandora_audit(
'Report management',
'Fail try to create report'
);
}
$auditMessage = ((bool) $idOrResult === true) ? sprintf('Create report #%s', $idOrResult) : 'Fail try to create report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
$auditMessage
);
} else {
$idOrResult = false;
}

View File

@ -41,7 +41,7 @@ if (empty($idVisualConsole)) {
if (!$vconsole_write && !$vconsole_manage) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';

View File

@ -18,7 +18,7 @@ check_login();
// Visual console required
if (empty($visualConsole)) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';
@ -40,7 +40,7 @@ if (!isset($vconsole_manage)) {
if (!$vconsole_write && !$vconsole_manage) {
db_pandora_audit(
'ACL Violation',
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
);
include 'general/noaccess.php';

Some files were not shown because too many files have changed in this diff Show More