cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-8566: Filter sensitive details...
Date Tue, 30 Jun 2015 21:20:38 GMT
Github user jburwell commented on a diff in the pull request:
    --- Diff: api/src/org/apache/cloudstack/api/command/admin/host/ ---
    @@ -203,9 +201,22 @@ public void execute() {
                 response.setResponses(hostResponses, result.second());
    +        // Remove sensitive details from host response
    +        List<HostResponse> hostResponsesList = response.getResponses();
    +        for (HostResponse hostResponse: hostResponsesList) {
    +            Map<String, String> hostDetails = hostResponse.getDetails();
    +            if (hostDetails == null) continue;
    +            if (hostDetails.containsKey("username")) {
    +                hostDetails.remove("username");
    +            }
    +            if (hostDetails.containsKey("password")) {
    +                hostDetails.remove("password");
    +            }
    +            hostResponse.setDetails(hostDetails);
    --- End diff --
    @bhaisaab I incorrectly assumed the HostResponse was only be used to create the ListHostCmd
result to the client.  Based on the scope described, the location of this filtering is the
narrowest scope possible.  We should avoid assumptions about how the ``HostDetails`` object
is being consumed across threads, and make a defensive copy of it before modifying it.  Also,
the code can be simplified by to remove the ``containsKey`` if blocks.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message