libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-718) gce_libcloud_auth credentials file world-readable
Date Fri, 18 Dec 2015 23:45:46 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064985#comment-15064985
] 

ASF subversion and git services commented on LIBCLOUD-718:
----------------------------------------------------------

Commit 59fec8e7a203ce95bca7a8b6c5c1744f4f718527 in libcloud's branch refs/heads/trunk from
[~erjohnso]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=59fec8e ]

[google] Minor security improvement for storing cached GCE credentials

Closes LIBCLOUD-718


> gce_libcloud_auth credentials file world-readable
> -------------------------------------------------
>
>                 Key: LIBCLOUD-718
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-718
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Siim P├Áder
>
> I noticed a suspicious-looking world-readable file on a VM that talks to Google Compute
Engine API via libcloud: 
> {noformat}
> -rw-r--r--  1 root root      164 Jun 27 21:21 .gce_libcloud_auth.wargame-engine
> {noformat}
> It contains a "Bearer" access token so presumably should not be readable by other users
on a shared system. I suspect this (untested) patch might maybe fix this in git head:
> {noformat}
> diff --git a/libcloud/common/google.py b/libcloud/common/google.py
> index 694cf93..7a658c8 100644
> --- a/libcloud/common/google.py
> +++ b/libcloud/common/google.py
> @@ -715,7 +715,7 @@ class GoogleBaseConnection(ConnectionUserAndKey, PollingConnection):
>          """
>          filename = os.path.realpath(os.path.expanduser(self.credential_file))
>          data = json.dumps(self.token_info)
> -        with open(filename, 'w') as f:
> +        with os.open(filename, os.O_WRONLY, 0o600) as f:
>              f.write(data)
>  
>      def has_completed(self, response): 
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message