diff --git a/files/0001-icingaweb2-module-audit-remote-ip-logging.patch b/files/0001-icingaweb2-module-audit-remote-ip-logging.patch deleted file mode 100644 index 88385b5..0000000 --- a/files/0001-icingaweb2-module-audit-remote-ip-logging.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 3bf6f47910834e4ddd9c7fb4bf085daed5ab515a Mon Sep 17 00:00:00 2001 -From: airbone95 -Date: Mon, 25 May 2020 08:37:14 +0200 -Subject: [PATCH] added ip-logging - ---- - application/controllers/LogController.php | 1 + - application/views/scripts/log/index.phtml | 3 +++ - library/Audit/ProvidedHook/AuditLog.php | 3 ++- - library/Audit/ProvidedHook/AuditStream.php | 3 ++- - 4 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/application/controllers/LogController.php b/application/controllers/LogController.php -index cc0d110..d0d2c4d 100644 ---- a/application/controllers/LogController.php -+++ b/application/controllers/LogController.php -@@ -36,6 +36,7 @@ public function indexAction() - 'fields' => '/(?[0-9]{4}(?:-[0-9]{2}){2}' // date - . 'T[0-9]{2}(?::[0-9]{2}){2}(?:[\+\-][0-9]{2}:[0-9]{2})?)' // time -+ . ' - (?.+)' // remoteip - . ' - (?.+)' // identity - . ' - (?.+)' // type - . ' - (?.+)' // message -diff --git a/application/views/scripts/log/index.phtml b/application/views/scripts/log/index.phtml -index 79b9239..80140a7 100644 ---- a/application/views/scripts/log/index.phtml -+++ b/application/views/scripts/log/index.phtml -@@ -19,6 +19,9 @@ -
- escape($value->type) ?> - -+ -+ escape($value->remoteip) ?> -+ - - escape($value->identity) ?> - -diff --git a/library/Audit/ProvidedHook/AuditLog.php b/library/Audit/ProvidedHook/AuditLog.php -index 39ae592..909c350 100644 ---- a/library/Audit/ProvidedHook/AuditLog.php -+++ b/library/Audit/ProvidedHook/AuditLog.php -@@ -14,8 +14,9 @@ public function logMessage($time, $identity, $type, $message, array $data = null - { - $logConfig = Config::module('audit')->getSection('log'); - if ($logConfig->type === 'file') { -+ $remoteip = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; - $file = new File($logConfig->get('path', '/var/log/icingaweb2/audit.log'), 'a'); -- $file->fwrite(date('c', $time) . ' - ' . $identity . ' - ' . $type . ' - ' . $message . PHP_EOL); -+ $file->fwrite(date('c', $time) . ' - ' . $remoteip . ' - ' . $identity . ' - ' . $type . ' - ' . $message . PHP_EOL); - $file->fflush(); - } elseif ($logConfig->type === 'syslog') { - openlog( -diff --git a/library/Audit/ProvidedHook/AuditStream.php b/library/Audit/ProvidedHook/AuditStream.php -index 869464f..863e93e 100644 ---- a/library/Audit/ProvidedHook/AuditStream.php -+++ b/library/Audit/ProvidedHook/AuditStream.php -@@ -16,7 +16,8 @@ public function logMessage($time, $identity, $type, $message, array $data = null - 'activity_time' => $time, - 'activity' => $type, - 'message' => $message, -- 'identity' => $identity -+ 'identity' => $identity, -+ 'remoteip' => $remoteip - ]; - if (! empty($data)) { - $activityData['data'] = $data;