flower icon indicating copy to clipboard operation
flower copied to clipboard

Censor all information from worker options tab

Open themanifold opened this issue 2 years ago • 3 comments

Flower will be default expose all objects in a celery worker in its config tab. See for example this worker:

import os
import time
from datetime import datetime

from celery import Celery

app = Celery("tasks",
             broker=os.environ.get('CELERY_BROKER_URL', 'pyamqp://0.0.0.0:5672'),
             )
app.conf.accept_content = ['pickle', 'json', 'msgpack', 'yaml']
app.conf.worker_send_task_events = True
app.conf.config = {"aaa":"bbbb"}

@app.task
def add(x, y):
    return x + y

if __name__ == "__main__":
    app.start()

image

By default, there is some censoring of information so that the password for the amqp broker is replaced with stars, though this is no perfect. In practice, you can "smuggle" sensitive information out by using non standard key names (also, I don't know what is doing this fuzzy censoring, so if anyone could point that out, it would be appreciated).

This pull request adds complete censoring of all values in the config tab, but will still display the keys (objects).

Running flower with the --censor-config flag will produce the following config tab: image

themanifold avatar Jul 11 '23 16:07 themanifold

Is anyone available to review this?

themanifold avatar Aug 10 '23 06:08 themanifold

Just bumping this

themanifold avatar Sep 13 '23 08:09 themanifold

Bumping this again!

themanifold avatar Mar 18 '24 10:03 themanifold