From 20cc6017d0472c33ffddfe496db9cf93f2e40fad Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 19 Jan 2022 09:04:10 +0100 Subject: [PATCH 1/4] fix: [localTool:CommonConnector] Ensure one logger per connector --- .../CommonConnectorTools.php | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/Lib/default/local_tool_connectors/CommonConnectorTools.php b/src/Lib/default/local_tool_connectors/CommonConnectorTools.php index 213db17..d01e9d9 100644 --- a/src/Lib/default/local_tool_connectors/CommonConnectorTools.php +++ b/src/Lib/default/local_tool_connectors/CommonConnectorTools.php @@ -24,21 +24,24 @@ class CommonConnectorTools public function __construct() { - Log::setConfig("LocalToolDebug", [ - 'className' => FileLog::class, - 'path' => LOGS, - 'file' => "{$this->connectorName}-debug", - 'scopes' => [$this->connectorName], - 'levels' => ['notice', 'info', 'debug'], - ]); - Log::setConfig("LocalToolError", [ - 'className' => FileLog::class, - 'path' => LOGS, - 'file' => "{$this->connectorName}-error", - 'scopes' => [$this->connectorName], - 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], - ]); - + if (empty(Log::getConfig("LocalToolDebug{$this->connectorName}"))) { + Log::setConfig("LocalToolDebug{$this->connectorName}", [ + 'className' => FileLog::class, + 'path' => LOGS, + 'file' => "{$this->connectorName}-debug", + 'scopes' => [$this->connectorName], + 'levels' => ['notice', 'info', 'debug'], + ]); + } + if (empty(Log::getConfig("LocalToolError{$this->connectorName}"))) { + Log::setConfig("LocalToolError{$this->connectorName}", [ + 'className' => FileLog::class, + 'path' => LOGS, + 'file' => "{$this->connectorName}-error", + 'scopes' => [$this->connectorName], + 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], + ]); + } } protected function logDebug($message) From 1d7fc00a650d08cc0a0f77dd4f8458edafd4736f Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 19 Jan 2022 09:33:57 +0100 Subject: [PATCH 2/4] chg: [layout:header-profile] Improved spacing --- templates/element/layouts/header/header-profile.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/element/layouts/header/header-profile.php b/templates/element/layouts/header/header-profile.php index 1f148d6..146aa3e 100644 --- a/templates/element/layouts/header/header-profile.php +++ b/templates/element/layouts/header/header-profile.php @@ -11,7 +11,10 @@ use Cake\Routing\Router;
SocialProvider->getIcon($this->request->getAttribute('identity')) ?> - [] request->getAttribute('identity')['username']) ?> + + [] + request->getAttribute('identity')['username']) ?> +
From 5a06a97c321437e6e99e7d94c1e58cc866ece319 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 19 Jan 2022 14:04:13 +0100 Subject: [PATCH 3/4] new: [doc] Added prerequisites document --- documentation/prerequisites.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 documentation/prerequisites.md diff --git a/documentation/prerequisites.md b/documentation/prerequisites.md new file mode 100644 index 0000000..98da39d --- /dev/null +++ b/documentation/prerequisites.md @@ -0,0 +1,17 @@ +# Prerequisites based on usecases + +This document list the requirements that have to be met in order to perform the desired usecase. + +## Connect a local tool to cerebrate +- **Networking**: The *cerebrate* application must be able to contact the local tool service. That means the address and the port of the local must be reachable by *cerebrate*. +- **User permissions**: Depends on the actions performed by Cerebrate on the local tool. + - Example: For a standard MISP configuration, a simple user with the `user` role is enough for Cerebrate to pass the health check. + +## Conect two cerebrate instances together +- **Networking**: The two *cerebrate* applications must be able to contact each others. That means the address and the port of both tools must be reachable by the other one. +- **User permissions**: No specific role or set of permission is required. Any user role can be used. + +## Connect two local tools through cerebrate +- **Networking**: The two *cerebrate* applications must be able to contact each others. That means the address and the port of both tools must be reachable by the other one. This also applies to both the local tools. +- **User permissions**: Depends on the actions performed by Cerebrate on the local tool. + - Example: For a standard MISP configuration, in order to have two instance connected, the API key used by *cebrate* to orchestrate the inter-connection must belong to a user having the `site-admin` permission flag. This is essential as only the `site-admin` permission allows to create synchronisation links between MISP instances. \ No newline at end of file From c7ccff5e1e22e279a460b0ef463d432da7080ab8 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 19 Jan 2022 14:19:55 +0100 Subject: [PATCH 4/4] fix: [doc] Typo in text --- documentation/prerequisites.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/prerequisites.md b/documentation/prerequisites.md index 98da39d..7b020ad 100644 --- a/documentation/prerequisites.md +++ b/documentation/prerequisites.md @@ -3,7 +3,7 @@ This document list the requirements that have to be met in order to perform the desired usecase. ## Connect a local tool to cerebrate -- **Networking**: The *cerebrate* application must be able to contact the local tool service. That means the address and the port of the local must be reachable by *cerebrate*. +- **Networking**: The *cerebrate* application must be able to contact the local tool service. That means the address and the port of the local tool must be reachable by *cerebrate*. - **User permissions**: Depends on the actions performed by Cerebrate on the local tool. - Example: For a standard MISP configuration, a simple user with the `user` role is enough for Cerebrate to pass the health check.