)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"0d062dce6491d8581e3ad77283845cae5ecedc50","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix for LV mounting issue in docker containers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Docker containers were previously started with insufficient"},{"line_number":10,"context_line":"privileges to successfully mount an LV created on host."},{"line_number":11,"context_line":"This change fixes this problem."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-Bug: 1613675"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3ac371cc_7459b48d","line":10,"range":{"start_line":10,"start_character":33,"end_line":10,"end_character":35},"updated":"2016-08-18 11:40:38.000000000","message":"a","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"812c6a5b24a038b2e8418faed915bd28c75f3956","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix for LV mounting issue in docker containers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Docker containers were previously started with insufficient"},{"line_number":10,"context_line":"privileges to successfully mount an LV created on host."},{"line_number":11,"context_line":"This change fixes this problem."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-Bug: 1613675"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3ac371cc_5a14a14b","line":10,"range":{"start_line":10,"start_character":33,"end_line":10,"end_character":35},"in_reply_to":"3ac371cc_7459b48d","updated":"2016-08-18 11:49:16.000000000","message":"Done","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"}],"manila/share/drivers/container/container_helper.py":[{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"cfe75cdeeb443c34f656e20428bf550ab2a6a8ec","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":43,"context_line":"               \"--cap-add\u003dALL\","},{"line_number":44,"context_line":"               \"--name\u003d%s\" % name, \u0027-v\u0027, \"/tmp/shares:/shares\","},{"line_number":45,"context_line":"               \"-v\", \"/dev:/dev\", image_name]"},{"line_number":46,"context_line":"        result \u003d self._inner_execute(cmd) or [\u0027\u0027, 1]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_20954e32","line":43,"range":{"start_line":43,"start_character":16,"end_line":43,"end_character":29},"updated":"2016-08-11 15:48:34.000000000","message":"I am no expert in linux capabilities, but isn\u0027t this a bit broad? Seems like a security problem to me, to enable all capabilities.\n\nWould;t it be possible to just add the required capabilities to mount LVs?","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"de683c13e0bcc3b3f5f49d24feb06473466fd0cc","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":43,"context_line":"               \"--cap-add\u003dALL\","},{"line_number":44,"context_line":"               \"--name\u003d%s\" % name, \u0027-v\u0027, \"/tmp/shares:/shares\","},{"line_number":45,"context_line":"               \"-v\", \"/dev:/dev\", image_name]"},{"line_number":46,"context_line":"        result \u003d self._inner_execute(cmd) or [\u0027\u0027, 1]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_2d25190a","line":43,"range":{"start_line":43,"start_character":16,"end_line":43,"end_character":29},"in_reply_to":"9ad45d7e_20954e32","updated":"2016-08-12 09:16:57.000000000","message":"Yes, please see my response below.","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"cfe75cdeeb443c34f656e20428bf550ab2a6a8ec","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":43,"context_line":"               \"--cap-add\u003dALL\","},{"line_number":44,"context_line":"               \"--name\u003d%s\" % name, \u0027-v\u0027, \"/tmp/shares:/shares\","},{"line_number":45,"context_line":"               \"-v\", \"/dev:/dev\", image_name]"},{"line_number":46,"context_line":"        result \u003d self._inner_execute(cmd) or [\u0027\u0027, 1]"},{"line_number":47,"context_line":"        if result[1] !\u003d \u0027\u0027:"},{"line_number":48,"context_line":"            raise exception.ManilaException("}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_a0d93ef5","line":45,"range":{"start_line":45,"start_character":15,"end_line":45,"end_character":32},"updated":"2016-08-11 15:48:34.000000000","message":"This seems like a bit security issue to me.\n\nMounting the whole /dev directory into the container would allow the container to access all devices of the host.\n\nThis would for example allow the container to access the disks of the host, which should probably not be accessible by containers.","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"14d045fc45e290c3a6cf93c5d11f92e526bcb091","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":43,"context_line":"               \"--cap-add\u003dALL\","},{"line_number":44,"context_line":"               \"--name\u003d%s\" % name, \u0027-v\u0027, \"/tmp/shares:/shares\","},{"line_number":45,"context_line":"               \"-v\", \"/dev:/dev\", image_name]"},{"line_number":46,"context_line":"        result \u003d self._inner_execute(cmd) or [\u0027\u0027, 1]"},{"line_number":47,"context_line":"        if result[1] !\u003d \u0027\u0027:"},{"line_number":48,"context_line":"            raise exception.ManilaException("}],"source_content_type":"text/x-python","patch_set":2,"id":"3ac371cc_bce07cfb","line":45,"range":{"start_line":45,"start_character":15,"end_line":45,"end_character":32},"in_reply_to":"3ac371cc_0716eda6","updated":"2016-08-17 12:03:12.000000000","message":"I\u0027ve tried to mount parts of /dev and it doesn\u0027t seem to work. But at least it is possible to avoid adding all capabilities. I\u0027ve provided a rather lengthy comment to this command in the next p.s. which I hope describes why this has to be done by mounting the entire /dev.","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"022ddee5c752e39a9fc74fe366f2b9eb03a3f03e","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":43,"context_line":"               \"--cap-add\u003dALL\","},{"line_number":44,"context_line":"               \"--name\u003d%s\" % name, \u0027-v\u0027, \"/tmp/shares:/shares\","},{"line_number":45,"context_line":"               \"-v\", \"/dev:/dev\", image_name]"},{"line_number":46,"context_line":"        result \u003d self._inner_execute(cmd) or [\u0027\u0027, 1]"},{"line_number":47,"context_line":"        if result[1] !\u003d \u0027\u0027:"},{"line_number":48,"context_line":"            raise exception.ManilaException("}],"source_content_type":"text/x-python","patch_set":2,"id":"3ac371cc_0716eda6","line":45,"range":{"start_line":45,"start_character":15,"end_line":45,"end_character":32},"in_reply_to":"9ad45d7e_8d61a5ab","updated":"2016-08-16 06:49:04.000000000","message":"You are of course right that the attack surface isn\u0027t too big. If the host is compromised, it doesn\u0027t matter to which resources the container has access or which privileges it has. So the only real problem are the samba ports in the neutron network.\nBut, just in case an attacker achieves to compromise the container using these ports, I would really like to see as much isolation between container and host as possible.\n\nSo if you find a solution to minimise the resources shared between them I would really appreciate it.\nFor example, you could create one volume group per container and mount /dev/\u003cvolume_group\u003e into the container instead of whole /dev (but i am not sure if this works, we would have to try it out...)","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"de683c13e0bcc3b3f5f49d24feb06473466fd0cc","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":43,"context_line":"               \"--cap-add\u003dALL\","},{"line_number":44,"context_line":"               \"--name\u003d%s\" % name, \u0027-v\u0027, \"/tmp/shares:/shares\","},{"line_number":45,"context_line":"               \"-v\", \"/dev:/dev\", image_name]"},{"line_number":46,"context_line":"        result \u003d self._inner_execute(cmd) or [\u0027\u0027, 1]"},{"line_number":47,"context_line":"        if result[1] !\u003d \u0027\u0027:"},{"line_number":48,"context_line":"            raise exception.ManilaException("}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_8d61a5ab","line":45,"range":{"start_line":45,"start_character":15,"end_line":45,"end_character":32},"in_reply_to":"9ad45d7e_a0d93ef5","updated":"2016-08-12 09:16:57.000000000","message":"Yes, this is a potential security issue. On the other hand the only thing this container does is sharing stuff via samba or ganesha-nfs (not yet, but there is a change adding ganesha-nfs support). There are two ways to access this container: via neutron network it is plugged in and directly via host. If it is accessed via host then the host is already compromised. The only way to interact with the container from within neutron network is by accessing samba ports, so probably not a big risk here too. And it is already running in privileged mode anyway, which is not very good security either and I have not yet figured out a way to do it right security-wise and be able to share things. On the third hand bad security practices are bad security practices no matter what so trying to restrict capabilities and access to /dev is on my TODO list.","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"0d062dce6491d8581e3ad77283845cae5ecedc50","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make  docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security this seems to be the only sane"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_546f58fb","line":43,"range":{"start_line":43,"start_character":42,"end_line":43,"end_character":44},"updated":"2016-08-18 11:40:38.000000000","message":"extra space","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"812c6a5b24a038b2e8418faed915bd28c75f3956","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make  docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security this seems to be the only sane"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_fa4d8dc4","line":43,"range":{"start_line":43,"start_character":42,"end_line":43,"end_character":44},"in_reply_to":"3ac371cc_546f58fb","updated":"2016-08-18 11:49:16.000000000","message":"Done","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"0d062dce6491d8581e3ad77283845cae5ecedc50","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make  docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_cf457543","line":45,"range":{"start_line":45,"start_character":19,"end_line":45,"end_character":20},"updated":"2016-08-18 11:40:38.000000000","message":",","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"812c6a5b24a038b2e8418faed915bd28c75f3956","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make  docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_1acd0931","line":45,"range":{"start_line":45,"start_character":19,"end_line":45,"end_character":20},"in_reply_to":"3ac371cc_cf457543","updated":"2016-08-18 11:49:16.000000000","message":"Done","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"0d062dce6491d8581e3ad77283845cae5ecedc50","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        # (aovchinnikov): To actually make  docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_afc75994","line":46,"range":{"start_line":46,"start_character":44,"end_line":46,"end_character":45},"updated":"2016-08-18 11:40:38.000000000","message":",","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"812c6a5b24a038b2e8418faed915bd28c75f3956","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        # (aovchinnikov): To actually make  docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_fae46dac","line":46,"range":{"start_line":46,"start_character":44,"end_line":46,"end_character":45},"in_reply_to":"3ac371cc_afc75994","updated":"2016-08-18 11:49:16.000000000","message":"Done","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"0d062dce6491d8581e3ad77283845cae5ecedc50","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"},{"line_number":50,"context_line":"        # to interact with /dev/dm-X it must be already present inside"},{"line_number":51,"context_line":"        # the container\u0027s /dev i.e. it must have been -v shared during"},{"line_number":52,"context_line":"        # container start-up. So we should either precreate an unknown"},{"line_number":53,"context_line":"        # number of /dev/dm-Xs (one per LV), share them all and hope"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_0fc02d4f","line":50,"range":{"start_line":50,"start_character":36,"end_line":50,"end_character":37},"updated":"2016-08-18 11:40:38.000000000","message":",","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"812c6a5b24a038b2e8418faed915bd28c75f3956","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"},{"line_number":50,"context_line":"        # to interact with /dev/dm-X it must be already present inside"},{"line_number":51,"context_line":"        # the container\u0027s /dev i.e. it must have been -v shared during"},{"line_number":52,"context_line":"        # container start-up. So we should either precreate an unknown"},{"line_number":53,"context_line":"        # number of /dev/dm-Xs (one per LV), share them all and hope"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_9a00d935","line":50,"range":{"start_line":50,"start_character":36,"end_line":50,"end_character":37},"in_reply_to":"3ac371cc_0fc02d4f","updated":"2016-08-18 11:49:16.000000000","message":"Done","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"0d062dce6491d8581e3ad77283845cae5ecedc50","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # for the best or share the entire /dev and hope for the best."},{"line_number":55,"context_line":"        # The risk of allowing a container having access to entire host\u0027s"},{"line_number":56,"context_line":"        # /dev lies in a possibility of third party exploiting samba and"},{"line_number":57,"context_line":"        # nfs-ganesha features to gain access to all hosts\u0027s devices."},{"line_number":58,"context_line":"        # Such exploits, however, would require having access to a network"},{"line_number":59,"context_line":"        # where such container resides. Thus one must carefully estimate"},{"line_number":60,"context_line":"        # possible risks when using this driver, paying special attention"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_4fea2575","line":57,"range":{"start_line":57,"start_character":53,"end_line":57,"end_character":58},"updated":"2016-08-18 11:40:38.000000000","message":"host","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"812c6a5b24a038b2e8418faed915bd28c75f3956","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # for the best or share the entire /dev and hope for the best."},{"line_number":55,"context_line":"        # The risk of allowing a container having access to entire host\u0027s"},{"line_number":56,"context_line":"        # /dev lies in a possibility of third party exploiting samba and"},{"line_number":57,"context_line":"        # nfs-ganesha features to gain access to all hosts\u0027s devices."},{"line_number":58,"context_line":"        # Such exploits, however, would require having access to a network"},{"line_number":59,"context_line":"        # where such container resides. Thus one must carefully estimate"},{"line_number":60,"context_line":"        # possible risks when using this driver, paying special attention"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_fafbcd44","line":57,"range":{"start_line":57,"start_character":53,"end_line":57,"end_character":58},"in_reply_to":"3ac371cc_4fea2575","updated":"2016-08-18 11:49:16.000000000","message":"Done","commit_id":"41ad18ac77190fd3987d646ae8aa632c414f6349"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"937b2ffb0f9a073bd10981d4f244ccaea135c012","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it, we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security, this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"},{"line_number":50,"context_line":"        # to interact with /dev/dm-X, it must be already present inside"},{"line_number":51,"context_line":"        # the container\u0027s /dev i.e. it must have been -v shared during"},{"line_number":52,"context_line":"        # container start-up. So we should either precreate an unknown"},{"line_number":53,"context_line":"        # number of /dev/dm-Xs (one per LV), share them all and hope"},{"line_number":54,"context_line":"        # for the best or share the entire /dev and hope for the best."},{"line_number":55,"context_line":"        # The risk of allowing a container having access to entire host\u0027s"},{"line_number":56,"context_line":"        # /dev lies in a possibility of third party exploiting samba and"},{"line_number":57,"context_line":"        # nfs-ganesha features to gain access to all host\u0027s devices."},{"line_number":58,"context_line":"        # Such exploits, however, would require having access to a network"},{"line_number":59,"context_line":"        # where such container resides. Thus one must carefully estimate"},{"line_number":60,"context_line":"        # possible risks when using this driver, paying special attention"},{"line_number":61,"context_line":"        # to possibly untrusted environments."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":64,"context_line":"               \"-v\", \"/dev:/dev\", \"--name\u003d%s\" % name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_f6dd5371","line":61,"range":{"start_line":43,"start_character":8,"end_line":61,"end_character":45},"updated":"2016-09-05 13:46:08.000000000","message":"The security problem is indeed concerning. I think this is an interesting topic for the weekly meeting, other devs may suggest a different approach.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"8b81f17ee5c96d20a712913c375a46319d971974","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it, we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security, this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"},{"line_number":50,"context_line":"        # to interact with /dev/dm-X, it must be already present inside"},{"line_number":51,"context_line":"        # the container\u0027s /dev i.e. it must have been -v shared during"},{"line_number":52,"context_line":"        # container start-up. So we should either precreate an unknown"},{"line_number":53,"context_line":"        # number of /dev/dm-Xs (one per LV), share them all and hope"},{"line_number":54,"context_line":"        # for the best or share the entire /dev and hope for the best."},{"line_number":55,"context_line":"        # The risk of allowing a container having access to entire host\u0027s"},{"line_number":56,"context_line":"        # /dev lies in a possibility of third party exploiting samba and"},{"line_number":57,"context_line":"        # nfs-ganesha features to gain access to all host\u0027s devices."},{"line_number":58,"context_line":"        # Such exploits, however, would require having access to a network"},{"line_number":59,"context_line":"        # where such container resides. Thus one must carefully estimate"},{"line_number":60,"context_line":"        # possible risks when using this driver, paying special attention"},{"line_number":61,"context_line":"        # to possibly untrusted environments."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":64,"context_line":"               \"-v\", \"/dev:/dev\", \"--name\u003d%s\" % name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_171eb66f","line":61,"range":{"start_line":43,"start_character":0,"end_line":61,"end_character":45},"updated":"2016-09-13 11:40:12.000000000","message":"These comments make it sound like there are additional risks using the container driver relative to other drivers.  But in the meeting I thought that Ben, and I think you, argued that that is not the case and that this driver is suitable for production use.  If that is true then I think this comment gives the wrong impression and should be re-worked.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"df26c3dfe8cd1b42f768a037c31371042307dfd5","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it, we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security, this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"},{"line_number":50,"context_line":"        # to interact with /dev/dm-X, it must be already present inside"},{"line_number":51,"context_line":"        # the container\u0027s /dev i.e. it must have been -v shared during"},{"line_number":52,"context_line":"        # container start-up. So we should either precreate an unknown"},{"line_number":53,"context_line":"        # number of /dev/dm-Xs (one per LV), share them all and hope"},{"line_number":54,"context_line":"        # for the best or share the entire /dev and hope for the best."},{"line_number":55,"context_line":"        # The risk of allowing a container having access to entire host\u0027s"},{"line_number":56,"context_line":"        # /dev lies in a possibility of third party exploiting samba and"},{"line_number":57,"context_line":"        # nfs-ganesha features to gain access to all host\u0027s devices."},{"line_number":58,"context_line":"        # Such exploits, however, would require having access to a network"},{"line_number":59,"context_line":"        # where such container resides. Thus one must carefully estimate"},{"line_number":60,"context_line":"        # possible risks when using this driver, paying special attention"},{"line_number":61,"context_line":"        # to possibly untrusted environments."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":64,"context_line":"               \"-v\", \"/dev:/dev\", \"--name\u003d%s\" % name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_127fa4e0","line":61,"range":{"start_line":43,"start_character":0,"end_line":61,"end_character":45},"in_reply_to":"9a89bdaa_171eb66f","updated":"2016-09-13 11:51:11.000000000","message":"Good point, thank you. I don\u0027t want to remove the comment completely as the question might get raised again, but it indeed looks a little scary now.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"0a617a1c15ad0a135d3ce1caded03e78543f0aed","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        # (aovchinnikov): --privileged is required for both samba and"},{"line_number":41,"context_line":"        # nfs-ganesha to actually allow access to shared folders."},{"line_number":42,"context_line":"        #"},{"line_number":43,"context_line":"        # (aovchinnikov): To actually make docker container mount a"},{"line_number":44,"context_line":"        # logical volume created after container start-up to some location"},{"line_number":45,"context_line":"        # inside it, we must share entire /dev with it. While this is"},{"line_number":46,"context_line":"        # probably a gaping hole in security, this seems to be the only sane"},{"line_number":47,"context_line":"        # way to do it. The reason is when a logical volume gets created"},{"line_number":48,"context_line":"        # several new things appear in /dev: a new /dev/dm-X and a symlink"},{"line_number":49,"context_line":"        # in /dev/volume_group_name pointing to /dev/dm-X. But to be able"},{"line_number":50,"context_line":"        # to interact with /dev/dm-X, it must be already present inside"},{"line_number":51,"context_line":"        # the container\u0027s /dev i.e. it must have been -v shared during"},{"line_number":52,"context_line":"        # container start-up. So we should either precreate an unknown"},{"line_number":53,"context_line":"        # number of /dev/dm-Xs (one per LV), share them all and hope"},{"line_number":54,"context_line":"        # for the best or share the entire /dev and hope for the best."},{"line_number":55,"context_line":"        # The risk of allowing a container having access to entire host\u0027s"},{"line_number":56,"context_line":"        # /dev lies in a possibility of third party exploiting samba and"},{"line_number":57,"context_line":"        # nfs-ganesha features to gain access to all host\u0027s devices."},{"line_number":58,"context_line":"        # Such exploits, however, would require having access to a network"},{"line_number":59,"context_line":"        # where such container resides. Thus one must carefully estimate"},{"line_number":60,"context_line":"        # possible risks when using this driver, paying special attention"},{"line_number":61,"context_line":"        # to possibly untrusted environments."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        cmd \u003d [\"docker\", \"run\", \"-d\", \"-i\", \"-t\", \"--privileged\","},{"line_number":64,"context_line":"               \"-v\", \"/dev:/dev\", \"--name\u003d%s\" % name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_1be60144","line":61,"range":{"start_line":43,"start_character":8,"end_line":61,"end_character":45},"in_reply_to":"9a89bdaa_f6dd5371","updated":"2016-09-07 09:15:39.000000000","message":"Yes, it would be nice to discuss the problem on the meeting. The important thing to remember however is that containers are used solely to avoid direct interactions with network namespaces. In other words, we are not actually expecting it to be more secure than running several smbds/nfs-ganeshas on a host in different network namespaces. To summarize: probably it is not something to be too worried about, but it is something that should be kept in mind.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"}],"manila/share/drivers/container/driver.py":[{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"4760789962d424693e0776d875b7e7af4f31b502","unresolved":false,"context_lines":[{"line_number":126,"context_line":"            [\"mkdir\", \"-m\", \"750\", \"/shares/%s\" % share_name]"},{"line_number":127,"context_line":"        )"},{"line_number":128,"context_line":"        self.storage.provide_storage(share)"},{"line_number":129,"context_line":"        lv_device \u003d self.storage._get_lv_device(share)"},{"line_number":130,"context_line":"        self.container.execute("},{"line_number":131,"context_line":"            server_id,"},{"line_number":132,"context_line":"            [\"mount\", lv_device, \"/shares/%s\" % share_name]"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_98e869e4","line":129,"range":{"start_line":129,"start_character":20,"end_line":129,"end_character":54},"updated":"2016-09-12 15:03:58.000000000","message":"It is storage-specific command. And, moreover, you call here private method. Such thing should be wrapped somehow.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"2f2cd782d3f1715c67e75d48892929584fbb706a","unresolved":false,"context_lines":[{"line_number":126,"context_line":"            [\"mkdir\", \"-m\", \"750\", \"/shares/%s\" % share_name]"},{"line_number":127,"context_line":"        )"},{"line_number":128,"context_line":"        self.storage.provide_storage(share)"},{"line_number":129,"context_line":"        lv_device \u003d self.storage._get_lv_device(share)"},{"line_number":130,"context_line":"        self.container.execute("},{"line_number":131,"context_line":"            server_id,"},{"line_number":132,"context_line":"            [\"mount\", lv_device, \"/shares/%s\" % share_name]"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_e0cc3c37","line":129,"range":{"start_line":129,"start_character":20,"end_line":129,"end_character":54},"in_reply_to":"9a89bdaa_98e869e4","updated":"2016-09-13 07:55:41.000000000","message":"How many storage classes are you planning to add to the driver? If you are not planning on adding anything then what is the point of stating obvious? Unfortunately containers and underlying storage have to be tightly coupled, with lvm being the only option for all foreseeable future. If you have any real suggestions on how to improve this you are welcome to state them. container_helper.py is the right place to do it. Also there is no such thing as private method in python. Leading underscore is a naming convention, just like self and cls, the only difference is that it tends to be abused all the time.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"4760789962d424693e0776d875b7e7af4f31b502","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            [\"umount\", \"/shares/%s\" % share.share_id]"},{"line_number":161,"context_line":"        )"},{"line_number":162,"context_line":"        self.storage.extend_share(share, new_size, share_server)"},{"line_number":163,"context_line":"        lv_device \u003d self.storage._get_lv_device(share)"},{"line_number":164,"context_line":"        self.container.execute("},{"line_number":165,"context_line":"            server_id,"},{"line_number":166,"context_line":"            [\"mount\", lv_device, \"/shares/%s\" % share.share_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_38c03d50","line":163,"range":{"start_line":163,"start_character":8,"end_line":163,"end_character":54},"updated":"2016-09-12 15:03:58.000000000","message":"same here.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"2f2cd782d3f1715c67e75d48892929584fbb706a","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            [\"umount\", \"/shares/%s\" % share.share_id]"},{"line_number":161,"context_line":"        )"},{"line_number":162,"context_line":"        self.storage.extend_share(share, new_size, share_server)"},{"line_number":163,"context_line":"        lv_device \u003d self.storage._get_lv_device(share)"},{"line_number":164,"context_line":"        self.container.execute("},{"line_number":165,"context_line":"            server_id,"},{"line_number":166,"context_line":"            [\"mount\", lv_device, \"/shares/%s\" % share.share_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_c0ee588a","line":163,"range":{"start_line":163,"start_character":8,"end_line":163,"end_character":54},"in_reply_to":"9a89bdaa_38c03d50","updated":"2016-09-13 07:55:41.000000000","message":"same here.","commit_id":"45d96d3fe0ab6aed065f547f6d5ca3aeae4058be"}],"manila/share/drivers/container/protocol_helper.py":[{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"cfe75cdeeb443c34f656e20428bf550ab2a6a8ec","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def create_share(self, server_id):"},{"line_number":37,"context_line":"        share_name \u003d self.share.share_id"},{"line_number":38,"context_line":"        share_lv_group \u003d self.conf.container_volume_group"},{"line_number":39,"context_line":"        cmd \u003d [\"mount\", os.path.join(\"/dev\", share_lv_group, share_name),"},{"line_number":40,"context_line":"               \"/shares/%s\" % share_name]"},{"line_number":41,"context_line":"        self.container.execute(server_id, cmd)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_2b2c0f98","line":38,"range":{"start_line":38,"start_character":8,"end_line":38,"end_character":22},"updated":"2016-08-11 15:48:34.000000000","message":"Since groups in LVM are called \"volume groups\", the name \"share_lv_groups\" sounds a bit wrong to me. Maybe you could rename it to something like \"share_volume_group\".","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"},{"author":{"_account_id":6938,"name":"Alexey Ovchinnikov","email":"aovchinnikov@mirantis.com","username":"aovchinnikov"},"change_message_id":"de683c13e0bcc3b3f5f49d24feb06473466fd0cc","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def create_share(self, server_id):"},{"line_number":37,"context_line":"        share_name \u003d self.share.share_id"},{"line_number":38,"context_line":"        share_lv_group \u003d self.conf.container_volume_group"},{"line_number":39,"context_line":"        cmd \u003d [\"mount\", os.path.join(\"/dev\", share_lv_group, share_name),"},{"line_number":40,"context_line":"               \"/shares/%s\" % share_name]"},{"line_number":41,"context_line":"        self.container.execute(server_id, cmd)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9ad45d7e_5bd5a8e2","line":38,"range":{"start_line":38,"start_character":8,"end_line":38,"end_character":22},"in_reply_to":"9ad45d7e_2b2c0f98","updated":"2016-08-12 09:16:57.000000000","message":"Ok, the name is not the best indeed.","commit_id":"34b8dead357d8a905c8ba8ae7daabe3aa47bf038"}]}
