chg: [disable_seen_ips] enable by default, switch to opt-out

pull/9432/head
iglocska 2023-11-23 12:29:31 +01:00
parent 4f36105d56
commit 5b86f6a8d1
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
4 changed files with 6 additions and 6 deletions

View File

@ -189,7 +189,7 @@ class AuthKey extends AppModel
foreach ($possibleAuthkeys as $possibleAuthkey) {
if ($passwordHasher->check($authkey, $possibleAuthkey['AuthKey']['authkey'])) { // valid authkey
// store IP in db if not there yet
if(Configure::read("MISP.remember_seen_ips_authkeys")) {
if (!Configure::read("MISP.disable_seen_ips_authkeys")) {
$remote_ip = $this->_remoteIp();
$update_db_ip = true;
if (in_array($remote_ip, $possibleAuthkey['AuthKey']['unique_ips'])) {

View File

@ -5701,10 +5701,10 @@ class Server extends AppModel
'type' => 'boolean',
'null' => true
],
'remember_seen_ips_authkeys' => [
'disable_seen_ips_authkeys' => [
'level' => self::SETTING_RECOMMENDED,
'description' => __('Store IP addresses used to make API calls with an AuthKey against this AuthKey in the database.'),
'value' => true,
'description' => __('Disable the storing of IP addresses used to make API calls with an AuthKey against this AuthKey in the database.'),
'value' => false,
'test' => 'testBool',
'type' => 'boolean',
'null' => true

View File

@ -47,7 +47,7 @@
'data_path' => 'AuthKey.allowed_ips',
],
];
if(Configure::read("MISP.remember_seen_ips_authkeys")){
if(!Configure::read("MISP.disable_seen_ips_authkeys")){
$fields[] =[
'name' => __('Seen IPs'),
'data_path' => 'AuthKey.unique_ips',

View File

@ -80,7 +80,7 @@ $fields = [
'requirement' => isset($keyUsage),
],
];
if (Configure::read("MISP.remember_seen_ips_authkeys")) {
if (!Configure::read("MISP.disable_seen_ips_authkeys")) {
$fields[] =[
'key' => __('Seen IPs'),
'path' => 'AuthKey.unique_ips',