Repository navigation
Conversation
There was a problem hiding this comment.
Add an check before setting the keys to check that keys has a length = 2 to avoid an ArrayIndexOutOfBoundsException. If the length is not equal to 2, throw an IllegalStateException.
|
@jburwell Sure!! Will look into these. Adding the test cases and some UI changes for this to work. Will update the PR. |
|
@kansal looking forward to your update. your intended change makes sense |
410045a to
5b86014
Compare
|
@jburwell @DaanHoogland @kishankavala Have included some changes related to the UI. Now after generating the keys from UI, after ListUserCmd() api, listKeysCmd() will be called to fill the secret key as I have removed it from the response value of other API's. |
There was a problem hiding this comment.
how about using LOGGER as a name for this static final? would be more in line with standards
|
@kansal looks good, but for a change like this I would like a marvin test to prove it and guarantee it's continued functioning/functionality Do you see chance to add that? |
|
@DaanHoogland Sure will try. Will take some time as I have to go through the documentation first. |
…s Included and Test Case added
5b86014 to
aae00b9
Compare
|
Have updated this PR. Instead of directly removing the secret key from response, I have deprecated that as many regressions were using the secret key from those APIs for authentication. Maybe from next major release we can remove that. @DaanHoogland marvin test cases on the way!!! |
There was a problem hiding this comment.
default should be false! this is a security issue.
There was a problem hiding this comment.
Agree with @DaanHoogland, it is easy enough to enable again should people need it. Is this setting available to the user or does it need to be added to the database as well?
There was a problem hiding this comment.
@remibergsma It is a part of global config and the admin can change it.
There was a problem hiding this comment.
@kansal I agree with @DaanHoogland and @remibergsma -- it's about reasonable and secure defaults. We should not configure a management server insecurely by default.
|
@kansal when you say 'I have deprecated that as many regressions were using the secret key from those APIs for authentication', I think we should adjust those regression test to set the setting to true. Let's not do consessions to security for the sake of testing. |
|
@DaanHoogland Agreed with that point. But its not only about the testing. I'm sure many people will be using it in their own integration. I think we should not change the response immediately like this without informing or making a noise about it. And it is because of this concern only, I added a flag for enabling/disabling the secret key in response. |
|
@kansal I don't agree that making noise first is the way to go. We should disable the return of the key first and document it. Security demands that we play it that way. We can allow users to enable this insecure bahaviour by setting a flag somewhere but it should not be default and catch the unaware users of guard. It will be work in the integration tests but that just will have to happen. |
|
@DaanHoogland I complete agree with you regarding exposing credential information. The best practice when credentials are lost is to require that they be changed. This approach makes the access to the sensitive information obvious to all users -- making it impossible for an attacker to hide such a breach. In the past, we have removed sensitive data from existing API responses. For example, for CVE-2015-3251, we removed exposure of KVM credentials from the listHosts call. Therefore, as a project, we have previously determined that security should trump API backwards compatibility. It should most certainly be prioritized over making the task of integration testing easier. |
|
cc @DaanHoogland @jburwell Okay. Agreed with that. So I am setting the default value to false but for running tests and maybe some other existing integration we will have to make that value to true. Is that fine? Of course we need to fix the existing test cases so that maybe from the next release we can get away with this thing completely? |
|
@kansal did you get to this yet? |
|
@DaanHoogland I am not sure of the amount of work that needs to be done for fixing all the existing test cases. Will revisit this and update. I still personally think that going with the optional parameter presently and assuming( and making sure) that the new test cases are written in compliance with this API will be a good way to go forward. Your views? |
|
@kansal as the complexity is unknown I would just go ahead and update the pr. We'll see the damage and think of fixes as we go. As for setting the value to true for existing tests, fine. as long as the default is false. the fix (setting it to true for some test cases) is trivial and will probably not be needed very often. Who is going to check a response for a private key unless they really need it. |
|
@kansal can you rebase against latest master and share state of your PR, thanks @DaanHoogland @jburwell do we still have outstanding issues on PR; do we want this or not? thanks |
|
@kansal please go ahead and remove the key from the response. We'll test run it and add fixes to tests if needed. (cc @rhtyd my last comment is still valid) |
|
@DaanHoogland sure. Will rebase and keep the default value to false. |
| description = "This command allows the user to query the seceret and API keys for the account", | ||
| responseObject = RegisterResponse.class, | ||
| requestHasSensitiveInfo = false, | ||
| responseHasSensitiveInfo = true) |
There was a problem hiding this comment.
Please add the version annotation to indicate that this command was added for 4.9.
The current implementation of User and account management API (in general) return the secret key as a user or account response.
Fix: Added a new API to explicitly return the secretKey and removed it from the user and account response.