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

use "application.statusKey" instead of "application.secret" … #1144

Conversation

asolntsev
Copy link
Contributor

…for /@status requests

@asolntsev asolntsev requested a review from xael-fry May 22, 2017 12:30
@asolntsev asolntsev self-assigned this May 22, 2017
@asolntsev asolntsev added this to the 1.5.0 milestone May 22, 2017
@@ -25,8 +25,8 @@
~
~ --secret:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we're trying to introduce a different key for the purposes of getting status, should we change the flag from --secret to --status-key to avoid confusion?

@asolntsev
Copy link
Contributor Author

asolntsev commented May 22, 2017 via email

@asolntsev asolntsev force-pushed the allow-status-request-only-with-status-key branch from 7dffd07 to ffe61bc Compare May 22, 2017 17:17
@asolntsev
Copy link
Contributor Author

Thank you @theo ! I renamed --status to --status-key.
Additionally, I extracted "/@status" and "/@Kill" part of CorePlugin to a dedicated class PlayStatusPlugin (single responsibility principle). And renamed CorePlugin to EnhancerPlugin because now it's the only job of this plugin.

@xael-fry Please also review the changes.

* these 2 plugins have totally different responsibilities and priorities
* splitting them allows users to easily override/disable/reorder any of them
@asolntsev asolntsev force-pushed the allow-status-request-only-with-status-key branch from c0c180c to 15874d0 Compare May 22, 2017 18:02
@asolntsev
Copy link
Contributor Author

@xael-fry @flybyray Please review this pull request. I would like to merge it.

@xael-fry xael-fry merged commit 40f5135 into playframework:master Jun 3, 2017
@xael-fry
Copy link
Member

xael-fry commented Jun 3, 2017

Merged thanks

@asolntsev asolntsev deleted the allow-status-request-only-with-status-key branch June 4, 2017 05:28
xael-fry added a commit that referenced this pull request Jun 5, 2017
…h-status-key

use "application.statusKey" instead of "application.secret" …
@sbeigel
Copy link
Contributor

sbeigel commented Nov 20, 2017

How ist this supposed to work? Why did you remove the signing part in the plugin (-> server side)? I thought your goal was to not re-use the app secret but a distinct key. But I think we need to keep the signing to check the message "@status" signed w/ the "new" statusKey?!

@xael-fry
Copy link
Member

@asolntsev I let you answer this question

@asolntsev
Copy link
Contributor Author

@sbeigel @xael-fry Sorry for the long replay.
We removed the signing part because it was a potential security problem. It allowed hacker to bruteforce secretKey/statusKey.

@sbeigel
Copy link
Contributor

sbeigel commented Nov 28, 2017

But the play status command signs the string "@status" with the application.statusKey property. Then, on the server-side, this signed message is compared to the application.statusKey property. How should this work? This will never be equal :)
To make this work right now, you have to sign the message "@status" by yourself, set this signed message as statusKey in the app.conf and pass your signing key as an explicit argument to the play status command... The default case in play status is useless (as it doesn't work).

@asolntsev
Copy link
Contributor Author

asolntsev commented Nov 28, 2017 via email

@sbeigel
Copy link
Contributor

sbeigel commented Nov 28, 2017

Yes, that's what I thought :)

But this change effectively renders the play status command useless, as this command (look at the python code) signs the string "@status", either with the given secret or (that is the default) with the app.conf's property statusKey.

I understand that you want a "classic" API/secret key style. But then the play status command has to be converted to this approach as well, i.e. remove the singing part and take the passed argument or the app.conf's statusKey as auth message.

@asolntsev
Copy link
Contributor Author

asolntsev commented Nov 28, 2017 via email

@sbeigel
Copy link
Contributor

sbeigel commented Nov 28, 2017

Yes, I do :)

I can fix the status command (in the way just described) and make a PR if you want...

@asolntsev
Copy link
Contributor Author

asolntsev commented Nov 28, 2017 via email

@sbeigel
Copy link
Contributor

sbeigel commented Nov 28, 2017

see #1209

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

Successfully merging this pull request may close these issues.

4 participants