Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks are not encrypted, only signed #300

Closed
asedeno opened this issue Apr 2, 2018 · 1 comment · Fixed by #429
Closed

Tasks are not encrypted, only signed #300

asedeno opened this issue Apr 2, 2018 · 1 comment · Fixed by #429

Comments

@asedeno
Copy link
Contributor

asedeno commented Apr 2, 2018

The documentation says that tasks are encryped [1], but they are only base64 encoded, optionally compressed, and signed.

>>> from django_q.tasks import async
>>> async('secret.function', 'top-secret-args-that-should-be-encrypted')
'1e5bd61734bb4368bbd6fe205c707615'
>>> import base64, pickle, redis
>>> r = redis.StrictRedis()
>>> payload, salt, sig = r.lindex('django_q:default:q', 0).split(b':')
>>> pickled_data = base64.urlsafe_b64decode(payload)
>>> pickle.loads(pickled_data)
{'args': ('top-secret-args-that-should-be-encrypted',),
 'func': 'secret.function',
 'id': '1e5bd61734bb4368bbd6fe205c707615',
 'kwargs': {},
 'name': 'mars-one-princess-freddie',
 'started': datetime.datetime(2018, 4, 2, 18, 11, 40, 296734, tzinfo=<UTC>)}

No key is required to find out what is in a task, so the docs shouldn't say that tasks are encrypted, only that they are signed.

"Tasks are signed. When a worker encounters a task it can not verify, it will be discarded for failed"

[1] http://django-q.readthedocs.io/en/latest/configure.html?highlight=encrypted#name

@mm-matthias
Copy link

I was also expecting things to be encrypted after I read the docs. If they are not encrypted I'd really like to be able to see the payload in django-admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants