mirror of https://github.com/MISP/MISP
new: Add authorization header for Cortex 2 integration
parent
6e7def472b
commit
4e6f57dcf3
|
@ -160,6 +160,11 @@ class Module extends AppModel {
|
|||
'Content-Type' => 'application/json',
|
||||
)
|
||||
);
|
||||
if ($moduleFamily == 'Cortex') {
|
||||
if (!empty(Configure::read('Plugin.' . $moduleFamily . '_authkey'))) {
|
||||
$request['header']['Authorization'] = Configure::read('Plugin.' . $moduleFamily . '_authkey');
|
||||
}
|
||||
}
|
||||
try {
|
||||
if ($post) $response = $httpSocket->post($url . $uri, $post, $request);
|
||||
else $response = $httpSocket->get($url . $uri);
|
||||
|
|
|
@ -1517,6 +1517,15 @@ class Server extends AppModel {
|
|||
'test' => 'testBool',
|
||||
'type' => 'boolean'
|
||||
),
|
||||
'Cortex_authkey' => array(
|
||||
'level' => 1,
|
||||
'description' => 'Set an authentication key to be passed to Cortex',
|
||||
'value' => '',
|
||||
'errorMessage' => '',
|
||||
'test' => 'testForEmpty',
|
||||
'type' => 'string',
|
||||
'null' => true
|
||||
),
|
||||
'Cortex_timeout' => array(
|
||||
'level' => 1,
|
||||
'description' => 'Set a timeout for the import services',
|
||||
|
|
Loading…
Reference in New Issue