mirror of https://github.com/MISP/MISP
new: [CLI] admin configLint
parent
067e04fcf6
commit
613ac448da
|
@ -74,6 +74,9 @@ class AdminShell extends AppShell
|
||||||
$parser->addSubcommand('securityAuditTls', [
|
$parser->addSubcommand('securityAuditTls', [
|
||||||
'help' => __('Run security audit to test TLS connections.'),
|
'help' => __('Run security audit to test TLS connections.'),
|
||||||
]);
|
]);
|
||||||
|
$parser->addSubcommand('configLint', [
|
||||||
|
'help' => __('Check if settings has correct value.'),
|
||||||
|
]);
|
||||||
return $parser;
|
return $parser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1126,4 +1129,18 @@ class AdminShell extends AppShell
|
||||||
$this->out("$type: $result");
|
$this->out("$type: $result");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function configLint()
|
||||||
|
{
|
||||||
|
$serverSettings = $this->Server->serverSettingsRead();
|
||||||
|
foreach ($serverSettings as $setting) {
|
||||||
|
if (!isset($setting['error'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($setting['errorMessage'] === 'Value not set.') {
|
||||||
|
continue; // Skip not set values.
|
||||||
|
}
|
||||||
|
$this->out($setting['setting'] . ': ' . $setting['errorMessage']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue