Misp: redis requirepass not supported by worker start script?

Created on 7 Jul 2018  路  2Comments  路  Source: MISP/MISP

Automated install with https://github.com/juju4/ansible-MISP/tree/master.
recently added some redis security options including requirepass
https://github.com/juju4/ansible-MISP/blob/master/tasks/redis-secure.yml

I added it to MISP config.php

Work environment

| Questions | Answers
|---------------------------|--------------------
| Type of issue | Bug
| OS version (server) | CentOS
| OS version (client) | 7
| PHP version | 7.2-remi
| MISP version / git hash | 2.4.93

Expected behavior

starting start.sh without error

Actual behavior

all worker start returns

Error: NOAUTH Authentication required

Strangely, that does not affect script exit code (but shell script)

If disabling redis requirepass, restarting redis and reexecute start.sh, it works fine.

Steps to reproduce the behavior

use redis requirepass

Logs, screenshots, configuration dump, ...

https://travis-ci.org/juju4/ansible-MISP/jobs/399995248
take raw log and look for

TASK [juju4.MISP : start MISP worker] ******************************************
[...]
               "Error: NOAUTH Authentication required.", 
               "#0 /var/www/MISP/app/Vendor/kamisama/resque-status/src/ResqueStatus/ResqueStatus.php(56): Redis->hSet('ResqueWorker', '21388', 'a:10:{s:8:\"inte...')", 
               "#1 /var/www/MISP/app/Plugin/CakeResque/Console/Command/CakeResqueShell.php(578): ResqueStatus\\ResqueStatus->addWorker(21388, Array)", 
               "#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(459): CakeResqueShell->start()", 
               "#3 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/ShellDispatcher.php(219): Shell->runCommand('start', Array)", 
               "#4 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()", 
               "#5 /var/www/MISP/app/Console/cake.php(32): ShellDispatcher::run(Array)", 
               "#6 {main}", 
under investigation potential bug automation

All 2 comments

After adding the redis password to the following file, i could start the workers using the start.sh script:
/var/www/MISP/app/Plugin/CakeResque/Config/config.php

$config['CakeResque'] = array(
        'Redis' => array(
                'host' => 'localhost',          // Redis server hostname
                'port' => 6379,                         // Redis server port
                'database' => 0,                        // Redis database number
                'namespace' => 'resque',        // Redis keys namespace
                'password' => 'YOUR_REDIS_PW_HERE' // Redis password

However if i navigate to [BASE_URL]/servers/serverSettings/workers in the web-UI the workers aren't showing up and i can't restart them. Doing a tcpdump to i noticed there's the "NOAUTH Authentication required" error as well while trying to restart a worker or just F5-ing the page (configured the password in the MISP-Settings aswell).

I have not tested the background workers with an authenticated redis, but just a few things to also consider:

  1. Redis password authentication is not super useful. You should never open up your redis to anything besides localhost anyway.
  2. The only reason why you might want to have a password in the first place is as a safety net for yourself so that you don't accidentally hook additional services into your redis with default settings causing a potential clash (this way you have to actively configure the tool to use a password, forcing you to actually look at the settings) - thanks to @Rafiot for providing a legit use case for this ;)

If you wanted to have the password for 1. - reconsider how you're setting up your system and instead don't open up redis to your network. If it's for 2. - I don't think we'll have the cycles to work on this, but if you do, pull requests are most welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ufo0531 picture ufo0531  路  4Comments

fl0x2208 picture fl0x2208  路  4Comments

dspruell picture dspruell  路  4Comments

Rafiot picture Rafiot  路  3Comments

WakandaKing picture WakandaKing  路  5Comments