Repository navigation
Conversation
|
@jayapalu this is a useful security fix for 4.9 as well, can you please rebase against the 4.9 branch and edit the base branch of the PR to 4.9? |
|
@rhtyd Once this PR got the LGTMs, I can rebase it on 4.9. Can you please review this PR |
| "Advanced", | ||
| Boolean.class, | ||
| "use.secret.key.in.response", | ||
| "true", |
There was a problem hiding this comment.
As per discussion in PR # 1152, default value should be false. Any failing tests due to this change have to be fixed.
|
It seems there is issue in CI due to that test are failing. |
|
@jayapalu can you push -f to kick Travis? |
| responseObject = RegisterResponse.class, | ||
| requestHasSensitiveInfo = false, | ||
| responseHasSensitiveInfo = true, | ||
| authorized = {RoleType.User}) |
There was a problem hiding this comment.
Can you add the 'since' parameter?
| response.setSecretKey(keys.get(1)); | ||
| } | ||
|
|
||
| response.setObjectName("listkeys"); |
There was a problem hiding this comment.
Should this be 'userKeys'?
| @Inject | ||
| private VpcManager vpcMgr; | ||
| @Inject | ||
| private AccountManager accountManager; |
There was a problem hiding this comment.
Why there is a need to inject AccountManager? If the config key is a static it can be accessed as AccountManager.
|
@koushik-das I have updated for your review comments. |
|
In the travis ci the tests are failing it could be because of timeout. But when I run some of the test locally it is passing. The same test test_invalid_gw_nm is failing in travis ci. =====my local xenserver setup test run ========== ==== Marvin Init Started ==== === Marvin Parse Config Successful === === Marvin Setting TestData Successful=== ==== Log Folder Path: /tmp//MarvinLogs//Apr_14_2017_10_30_49_WKRPUW. All logs will be available here ==== === Marvin Init Logging Successful=== ==== Marvin Init Successful ==== Ran 1 test in 5.837s OK https://travis-ci.org/apache/cloudstack/jobs/221647779 The command ./tools/travis/script.sh component/test_cpu_max_limits component/test_cpu_project_limits component/test_deploy_vm_userdata_multi_nic component/test_egress_fw_rules component/test_invalid_gw_nm component/test_ip_reservation component/test_lb_secondary_ip exited with 1 ContextSuite context=TestIsolatedNetw | exceptions.T | 0 | test_invalid_gw_nm | |
|
Code changes LGTM |
|
When I run the few tests failed here run manually are passed in my local setup. There is setup issue in the travis CI. |
|
sure @jayapalu |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-657 |
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1014)
|
|
@borisstoyanov In this PR the secretkey is removed from the user apis (list, create, disable, enable, get, lock and updateuser) and (list, disable, enable and updateaccount) response. Can you please check confirm Is this the reason for failure. |
|
@borisstoyanov Can you please look into my previous comment on test failures. |
|
@borisstoyanov |
|
Hi @jayapalu, sorry I didn't come back to you earlier, please let me know when you have the fix so we could retest again. |
|
@borisstoyanov Can you upload the your "mgtSvr" section from the marvin config file. I am getting the error when port is 8080 and apikey and secretkey is empty. I want to confirm that your/trillian has the same configuration. |
|
@borisstoyanov In marvin config with port 8080 and without keys, Is this valid configuration test ? Because with port 8080 and with out keys there is no way to get the keys first time unless it uses 8096 for the first time and then fall back to 8080 |
|
Hi @jayapalu, sorry for the delay, |
|
@borisstoyanov With 8096, I did not get see any test failures in my local setup. But in Trillian it seems the test setup itself is failing. |
|
Previously Travis CI is failed. Now Travis CI is passed. |
|
Hi @jayapalu, |
|
@borisstoyanov Now Travis CI is passed can you please trigger the Trillian. |
|
@blueorangutan package |
| responseObject = RegisterResponse.class, | ||
| requestHasSensitiveInfo = false, | ||
| responseHasSensitiveInfo = true, | ||
| authorized = {RoleType.User}, |
There was a problem hiding this comment.
If you're allowing users, please allow all the role types.
There was a problem hiding this comment.
One doubt here, if user is allowed why need to allow admin explicitly.
There was a problem hiding this comment.
@jayapalu the authorized field gets all the roles that need to be authorized (default) when the rules are not defined in commands.properties or in the dynamic roles (role_permissions) table.
There was a problem hiding this comment.
@jayapalu I still don't see the change, please update or force push your branch?
| private Long id; | ||
|
|
||
| public static final Logger s_logger = Logger.getLogger(RegisterCmd.class.getName()); | ||
| public static final String s_name = "getuserkeysresponse"; |
There was a problem hiding this comment.
@jayapalu can we get rid of archai way of variable declaration and API implementation, for example see this API: https://github.com/apache/cloudstack/blob/master/api/src/org/apache/cloudstack/api/command/admin/acl/ListRolesCmd.java#L46
|
|
||
| public static UserResponse newUserResponse(UserAccountJoinVO usr, Long domainId) { | ||
| UserResponse response = s_userAccountJoinDao.newUserResponse(usr); | ||
| if(AccountManager.UseSecretKeyInResponse.value() == false){ |
| return _accountDao.findUserAccountByApiKey(apiKey); | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
Instead of a list should this be a Pair (keypair) of string, and rename the method as getUserKeyPair() ?
| if(s_logger.isDebugEnabled()){ | ||
| s_logger.debug("Access granted to " + user + "to " + entity + "by " + checker.getName()); | ||
| } | ||
| return; |
There was a problem hiding this comment.
@jayapalu is it assumed that checkAccess throws no exception? Can such a case happen where depending on the sequence of security checkers, we might allow an entity that may be failed by some other checker, i.e. should we return here?
There was a problem hiding this comment.
I am not sure about it. But if you look at all the checkAccess methods in this file has the same pattern.
|
|
||
| accountManager.getKeys(_listkeyscmd); | ||
|
|
||
| } |
|
With this PR, the user keypair (api key and secret key) which used to be in listUsers API response will now be returned by new getUserKeys API response that is allowed for User role type only (qq - we should allow all role types, if we're allowing the RoleType.User) -- does this beat the purpose of exposing user keypair? I do see the value of exposing this as a separate API though. |
|
@jayapalu I still don't see the change, please update or force push your branch? |
|
@rhtyd Updated check now. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-730 |
|
@blueorangutan test centos7 vmware-55u3 |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests |
|
Trillian test result (tid-1102)
|
|
@rhtyd Can you please review the changes. |
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0 Failed tests:
Skipped tests: Passed test suits: |
|
@rhtyd can you review the changes I have made for your review comments. |
|
@rhtyd ping |
|
I have made the changes changes suggested @rhtyd . |
|
@jayapalu can you fix the regression, test failure in |
This PR closes the PR #1152