)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d996ae0ed6585ca9a106b41456f807355302188","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patchset adds an RBAC overview documentation section dedicated"},{"line_number":10,"context_line":"to:"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"* Defining what RBAC is"},{"line_number":13,"context_line":"* Nomenclature"},{"line_number":14,"context_line":"* Briefly how Patrole validates it in OpenStack"},{"line_number":15,"context_line":"* Test Coverage"},{"line_number":16,"context_line":"* Policy in code documentation as a prerequisite for test stability"},{"line_number":17,"context_line":"* Which tests are currently stable and which require more work"},{"line_number":18,"context_line":"* Multi-policy support introduction"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: Ib411e4d06210135f7bd1cb90d5b6d59da2e5d076"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_86891dc8","line":18,"range":{"start_line":12,"start_character":0,"end_line":18,"end_character":35},"updated":"2018-07-05 08:01:59.000000000","message":"from name of file and section it looks like that this doc will talk only about RBAC overview but that is not the case.\n\nThis is mixed with \"What RBAC is\" \"Patrole coverage and scope etc\"\n\nwe should keep both content separate. Below is the structure i was thinking. what you say? \n\n* Overview\n\n    * RBAC Overview - \u003cthis talk about RBAC as general and how openstack do it. mainly the content you are writing in this patch. idea is if anyone reading about patrole they get very first content of what RBAC is in OpenStack\u003e\n    * Patrole - The OpenStack RBAC Validation Test Suite - \u003ccurrent overview content patrole doc has\u003e\n\n* User’s Guide - \u003ccurrent doc on master\u003e\n\n* Field Guide - \u003chere we move the patrole scope, coverage etc what you are writing in this patch. \u003e\n\n* Developer’s Guide - \u003ccurrent doc on master\u003e","commit_id":"f41d0954d3208a61352393729f26a8479a8af794"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d11a397e34dc622eb8415ceb6ac77d59fba791c7","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patchset adds an RBAC overview documentation section dedicated"},{"line_number":10,"context_line":"to:"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"* Defining what RBAC is"},{"line_number":13,"context_line":"* Nomenclature"},{"line_number":14,"context_line":"* Briefly how Patrole validates it in OpenStack"},{"line_number":15,"context_line":"* Test Coverage"},{"line_number":16,"context_line":"* Policy in code documentation as a prerequisite for test stability"},{"line_number":17,"context_line":"* Which tests are currently stable and which require more work"},{"line_number":18,"context_line":"* Multi-policy support introduction"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: Ib411e4d06210135f7bd1cb90d5b6d59da2e5d076"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_7d8c8b2d","line":18,"range":{"start_line":12,"start_character":0,"end_line":18,"end_character":35},"in_reply_to":"5f7c97a3_86891dc8","updated":"2018-07-05 13:40:07.000000000","message":"I can move some of the content that isn\u0027t directly relevant to RBAC to another doc guide. I\u0027m not sure if Patrole is the best place to keep RBAC overview documentation for OpenStack. I only wanted to put enough in there that would be enough to understand RBAC from a validation perspective, so things like terminology, how other projects use it, etc. is important.\n\nLooking back over the docs, I think some of it is too technical and I try to include too much information for just an overview, so I will split this up into multiple parts. Beginning with just the RBAC overview information and submit the other parts separately.","commit_id":"f41d0954d3208a61352393729f26a8479a8af794"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"10e8d61d09f541cb127f8540ffba4238919bfcdb","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patchset adds an RBAC overview documentation section dedicated"},{"line_number":10,"context_line":"to:"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"* Defining what RBAC is"},{"line_number":13,"context_line":"* Nomenclature"},{"line_number":14,"context_line":"* Briefly how Patrole validates it in OpenStack"},{"line_number":15,"context_line":"* Test Coverage"},{"line_number":16,"context_line":"* Policy in code documentation as a prerequisite for test stability"},{"line_number":17,"context_line":"* Which tests are currently stable and which require more work"},{"line_number":18,"context_line":"* Multi-policy support introduction"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: Ib411e4d06210135f7bd1cb90d5b6d59da2e5d076"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"5f7c97a3_61a5a647","line":18,"range":{"start_line":12,"start_character":0,"end_line":18,"end_character":35},"updated":"2018-07-19 05:41:21.000000000","message":"few of them are not valid as per latest changes- like Test Coverage,  Which tests are currently stable and which require more work etc","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"}],"doc/source/index.rst":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"99137ae058c7365c2b2a1772256458fe138c2b66","unresolved":false,"context_lines":[{"line_number":9,"context_line":"   :maxdepth: 2"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"   overview"},{"line_number":12,"context_line":"   rbac-overview"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Patrole Configuration Guide"},{"line_number":15,"context_line":"---------------------------"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_17594f5a","line":12,"range":{"start_line":12,"start_character":3,"end_line":12,"end_character":16},"updated":"2018-06-15 03:14:50.000000000","message":"same comment as in base patch, let\u0027s keep these overview in \u0027Overview\u0027 section\n\nand this can be above than overview section as it talk about more broader area of RBAC?","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"7ac294e5b1c330f73f52c49b5150b5cba100d2c8","unresolved":false,"context_lines":[{"line_number":9,"context_line":"   :maxdepth: 2"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"   overview"},{"line_number":12,"context_line":"   rbac-overview"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Patrole Configuration Guide"},{"line_number":15,"context_line":"---------------------------"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_bad60e53","line":12,"range":{"start_line":12,"start_character":3,"end_line":12,"end_character":16},"in_reply_to":"5f7c97a3_17594f5a","updated":"2018-06-18 15:55:14.000000000","message":"Sure I will put under RBAC section. I put as WIP since I need to add some additional sections, like explicit vs. implicit policy enforcement and whether we should even handle implicit policy enforcement (I am leaning toward No because it means we have to steer away from policy in code documentation). However, for multi-policy case it kind of becomes necessary in rarer cases to address implicit policy enforcement.\n\nSections like this is what the RBAC overview section is for since the discussion is rather involved.","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"398862d5357a8db0af16940c9d5c5c71fe554507","unresolved":false,"context_lines":[{"line_number":9,"context_line":"   :maxdepth: 2"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"   overview"},{"line_number":12,"context_line":"   rbac-overview"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Patrole Configuration Guide"},{"line_number":15,"context_line":"---------------------------"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_fcc6b868","line":12,"range":{"start_line":12,"start_character":3,"end_line":12,"end_character":16},"in_reply_to":"5f7c97a3_bad60e53","updated":"2018-06-19 01:55:37.000000000","message":"Done","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"}],"doc/source/rbac-overview.rst":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4e654d39028ef4720cb44297737cedd37b055fd2","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The following nomenclature is used throughout Patrole documentation so it is"},{"line_number":17,"context_line":"important to understand what each term means in order to understand concepts"},{"line_number":18,"context_line":"related to RBAC in OpenStack."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":".. glossary::"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"5f7c97a3_883e1127","line":18,"range":{"start_line":18,"start_character":19,"end_line":18,"end_character":28},"updated":"2018-06-10 20:31:51.000000000","message":"Patrole","commit_id":"2b14082221fa85ec886ccebccd071a10a3719698"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"1686c6c7614f825c0e0f102454961cb990d233e0","unresolved":false,"context_lines":[{"line_number":32,"context_line":"but in reality many API endpoints enforce multiple policies. Thus, to offer"},{"line_number":33,"context_line":"accurate validation, Patrole handles multiple policies."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":".. _governance goal: https://governance.openstack.org/tc/goals/queens/policy-in-code.html"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Coverage"},{"line_number":38,"context_line":"--------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_d5ab41d3","line":35,"updated":"2018-06-11 04:52:24.000000000","message":"Move elsewhere","commit_id":"1719b02599ae3f05e32a38c208384f1df375561e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ca62aefe0266e11c4dbb906fa91185be52283e36","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"Note that Swift currently does not have RBAC so is not covered by Patrole."},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"Policy in Code Documentation"},{"line_number":51,"context_line":"----------------------------"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"The `governance goal`_ enumerates many advantages with policy in code. However,"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_552df192","line":50,"range":{"start_line":50,"start_character":1,"end_line":50,"end_character":14},"updated":"2018-06-11 04:42:17.000000000","message":"Call this just Policy in Code","commit_id":"1719b02599ae3f05e32a38c208384f1df375561e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"a061817408012de89e66c687c5791a70ba15089f","unresolved":false,"context_lines":[{"line_number":105,"context_line":"     - No"},{"line_number":106,"context_line":"     - No"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"Glossary"},{"line_number":109,"context_line":"--------"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"The following nomenclature is used throughout Patrole documentation so it is"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_be43f9af","line":108,"range":{"start_line":108,"start_character":0,"end_line":108,"end_character":8},"updated":"2018-06-11 14:49:12.000000000","message":"I think this is useful because I can\u0027t find any centralized information on RBAC in OpenStack that\u0027s easy to read. The discussion on RBAC usually requires advanced understanding or sweeps over a lot of territory very quickly.\n\nBecause past Patrole contributors have confused some of these terms and because they will probably continue to elude some people (especially non-devs) I feel like this section is appropriate.","commit_id":"1719b02599ae3f05e32a38c208384f1df375561e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ca62aefe0266e11c4dbb906fa91185be52283e36","unresolved":false,"context_lines":[{"line_number":113,"context_line":"related to RBAC in Patrole."},{"line_number":114,"context_line":""},{"line_number":115,"context_line":".. glossary::"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"  authorize"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    The act of ``oslo.policy`` determining whether a user can perform a"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_9515c93f","line":116,"updated":"2018-06-11 04:42:17.000000000","message":"Can also add entry for Tempest credentials","commit_id":"1719b02599ae3f05e32a38c208384f1df375561e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"8bf8c75fbab42edc694c76e65439e429f90019cf","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"  policy"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    Implements an RBAC rule. Each policy is defined by a one-line statement in"},{"line_number":135,"context_line":"    the form \"\u003ctarget\u003e\" : \"\u003crule\u003e\". For more information, reference OpenStack\u0027s"},{"line_number":136,"context_line":"    `policy documentation`_."},{"line_number":137,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_fcb18a02","line":134,"range":{"start_line":134,"start_character":4,"end_line":134,"end_character":14},"updated":"2018-06-11 00:20:22.000000000","message":"Defines","commit_id":"1719b02599ae3f05e32a38c208384f1df375561e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ca62aefe0266e11c4dbb906fa91185be52283e36","unresolved":false,"context_lines":[{"line_number":138,"context_line":"  policy action"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    See :term:`policy target`."},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"  policy in code"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    Registers default OpenStack policies for a service in the service\u0027s code"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_d50fc12b","line":141,"updated":"2018-06-11 04:42:17.000000000","message":"Add entry for policy file","commit_id":"1719b02599ae3f05e32a38c208384f1df375561e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4cf59b869abae772b21c893f788648af25ff2129","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Policy Validation"},{"line_number":14,"context_line":"-----------------"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Each OpenStack service uses `oslo.policy`_ as the library for RBAC. Patrole"},{"line_number":17,"context_line":"relies on the same library for deriving the expected test result."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Afterward, Patrole calls the API resource that enforces an RBAC policy."}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_89a8a48c","line":16,"range":{"start_line":16,"start_character":62,"end_line":16,"end_character":66},"updated":"2018-06-19 00:58:51.000000000","message":"RBAC authorization","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"398862d5357a8db0af16940c9d5c5c71fe554507","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Policy Validation"},{"line_number":14,"context_line":"-----------------"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Each OpenStack service uses `oslo.policy`_ as the library for RBAC. Patrole"},{"line_number":17,"context_line":"relies on the same library for deriving the expected test result."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Afterward, Patrole calls the API resource that enforces an RBAC policy."}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_9cdd4443","line":16,"range":{"start_line":16,"start_character":62,"end_line":16,"end_character":66},"in_reply_to":"5f7c97a3_89a8a48c","updated":"2018-06-19 01:55:37.000000000","message":"Done","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4cf59b869abae772b21c893f788648af25ff2129","unresolved":false,"context_lines":[{"line_number":16,"context_line":"Each OpenStack service uses `oslo.policy`_ as the library for RBAC. Patrole"},{"line_number":17,"context_line":"relies on the same library for deriving the expected test result."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Afterward, Patrole calls the API resource that enforces an RBAC policy."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Finally, Patrole checks whether the expected and actual results match."},{"line_number":22,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_49928c5a","line":19,"range":{"start_line":19,"start_character":56,"end_line":19,"end_character":58},"updated":"2018-06-19 00:58:51.000000000","message":"the expected","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"398862d5357a8db0af16940c9d5c5c71fe554507","unresolved":false,"context_lines":[{"line_number":16,"context_line":"Each OpenStack service uses `oslo.policy`_ as the library for RBAC. Patrole"},{"line_number":17,"context_line":"relies on the same library for deriving the expected test result."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Afterward, Patrole calls the API resource that enforces an RBAC policy."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Finally, Patrole checks whether the expected and actual results match."},{"line_number":22,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_1ce934e2","line":19,"range":{"start_line":19,"start_character":56,"end_line":19,"end_character":58},"in_reply_to":"5f7c97a3_49928c5a","updated":"2018-06-19 01:55:37.000000000","message":"Done","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4cf59b869abae772b21c893f788648af25ff2129","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Afterward, Patrole calls the API resource that enforces an RBAC policy."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Finally, Patrole checks whether the expected and actual results match."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For more information about this workflow, see the :ref:`rbac-validation`."},{"line_number":24,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_099c9468","line":21,"range":{"start_line":21,"start_character":56,"end_line":21,"end_character":63},"updated":"2018-06-19 00:58:51.000000000","message":"test results","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"398862d5357a8db0af16940c9d5c5c71fe554507","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Afterward, Patrole calls the API resource that enforces an RBAC policy."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Finally, Patrole checks whether the expected and actual results match."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For more information about this workflow, see the :ref:`rbac-validation`."},{"line_number":24,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_bcb920ed","line":21,"range":{"start_line":21,"start_character":56,"end_line":21,"end_character":63},"in_reply_to":"5f7c97a3_099c9468","updated":"2018-06-19 01:55:37.000000000","message":"Done","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"31905b3b0d2708b07e2e95253b10ebe659e6a15b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"By default, Patrole validates default OpenStack policies. This is so that"},{"line_number":31,"context_line":"the out-of-the-box defaults are sanity-checked, to ensure that OpenStack"},{"line_number":32,"context_line":"services are secure, from an RBAC perspective, for each release."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Custom Policy Validation"},{"line_number":35,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_c555781f","line":33,"updated":"2018-06-14 05:03:46.000000000","message":"Can add ref to policy in code below to state how this is done.","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"7206f5f66bb1983cfacc9abd27a25c5abc832dd7","unresolved":false,"context_lines":[{"line_number":38,"context_line":"policies are modified with custom overrides in production. OpenStack\u0027s"},{"line_number":39,"context_line":"`policy.yaml`_ documentation claims that \"modifying policy can have unexpected"},{"line_number":40,"context_line":"side effects\", which is why Patrole was created: to ensure that custom"},{"line_number":41,"context_line":"overrides allow the principle of least privilege to be tailor-made to exact"},{"line_number":42,"context_line":"exact specifications via policy overrides, without:"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"* causing unintended side effects (breaking API endpoints, breaking"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_a534fcfb","line":41,"range":{"start_line":41,"start_character":70,"end_line":41,"end_character":75},"updated":"2018-06-14 05:04:43.000000000","message":"duplicate","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"398862d5357a8db0af16940c9d5c5c71fe554507","unresolved":false,"context_lines":[{"line_number":38,"context_line":"policies are modified with custom overrides in production. OpenStack\u0027s"},{"line_number":39,"context_line":"`policy.yaml`_ documentation claims that \"modifying policy can have unexpected"},{"line_number":40,"context_line":"side effects\", which is why Patrole was created: to ensure that custom"},{"line_number":41,"context_line":"overrides allow the principle of least privilege to be tailor-made to exact"},{"line_number":42,"context_line":"exact specifications via policy overrides, without:"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"* causing unintended side effects (breaking API endpoints, breaking"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_9cb6a4f9","line":41,"range":{"start_line":41,"start_character":70,"end_line":41,"end_character":75},"in_reply_to":"5f7c97a3_a534fcfb","updated":"2018-06-19 01:55:37.000000000","message":"Done","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4cf59b869abae772b21c893f788648af25ff2129","unresolved":false,"context_lines":[{"line_number":59,"context_line":"Perhaps in an ideal world each API endpoint would enforce only one policy,"},{"line_number":60,"context_line":"but in reality some API endpoints enforce multiple policies. Thus, to offer"},{"line_number":61,"context_line":"accurate validation, Patrole handles multiple policies for select tests."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"Coverage"},{"line_number":64,"context_line":"--------"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5f7c97a3_497b6c28","line":62,"updated":"2018-06-19 00:58:51.000000000","message":"This will require a link to multi-policy once that documentation is written.","commit_id":"a4b3a9285ef63025bfbec5416ebc39d551792b81"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"398862d5357a8db0af16940c9d5c5c71fe554507","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"Services publish their policy-to-API mapping via policy in code documentation."},{"line_number":189,"context_line":"This mapping includes the list of APIs that authorize a policy, for each"},{"line_number":190,"context_line":"policy declared within a service. "},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"For example, Nova\u0027s policy in code documentation is located in the"},{"line_number":193,"context_line":"`Nova repository`_ under ``nova/policies``. Likewise, Keystone\u0027s policy in"}],"source_content_type":"text/x-rst","patch_set":7,"id":"5f7c97a3_7cdaa84b","line":190,"range":{"start_line":190,"start_character":33,"end_line":190,"end_character":34},"updated":"2018-06-19 01:55:37.000000000","message":"WS","commit_id":"42cd9d8f97ff8b9ec35e64720b634e590bfc971a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"b16ec1cdac3492642108f5d3849ce3a18cdd423b","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":".. _oslo.policy: https://docs.openstack.org/oslo.policy/latest/"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Policy Validation Considerations"},{"line_number":29,"context_line":"--------------------------------"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Services leverage the `oslo.policy`_ library differently to customize their"}],"source_content_type":"text/x-rst","patch_set":8,"id":"5f7c97a3_5c76cc41","line":28,"updated":"2018-06-19 02:00:41.000000000","message":"I think I should move this section toward the end as it is the most technical and assumes that the reader has read the other sections first","commit_id":"809a1c7e5924cda68df614553eabf101dce5b16f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"29a15198895b0928fa1b0caccb393ef2f0fa3f65","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"For more information about this workflow, see the :ref:`rbac-validation`."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":".. _oslo.policy: https://docs.openstack.org/oslo.policy/latest/"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Supported Validation Types"},{"line_number":29,"context_line":"--------------------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_a76d57cd","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":63},"updated":"2018-06-20 18:39:25.000000000","message":"Should move this to bottom.","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"101f070ae89a5b57ae8283fa29eeae09e6ddaea5","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"For more information about this workflow, see the :ref:`rbac-validation`."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":".. _oslo.policy: https://docs.openstack.org/oslo.policy/latest/"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Supported Validation Types"},{"line_number":29,"context_line":"--------------------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_1c9fa602","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":63},"in_reply_to":"5f7c97a3_a76d57cd","updated":"2018-06-21 20:32:27.000000000","message":"Done","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"8f90fd36afb83587dae7ea39f29bbaa971c7739b","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"Policy Validation Considerations"},{"line_number":154,"context_line":"--------------------------------"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"Services leverage the `oslo.policy`_ library differently to customize their"},{"line_number":157,"context_line":"authorization, which has implications on testing and validation."},{"line_number":158,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_ab343d4a","line":155,"updated":"2018-06-21 00:33:58.000000000","message":"Should add discussion on custom vs default policy and gaps related to defaults and how validating custom is difficult and still a wip as it requires a lot of test robustness","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"101f070ae89a5b57ae8283fa29eeae09e6ddaea5","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"Policy Validation Considerations"},{"line_number":154,"context_line":"--------------------------------"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"Services leverage the `oslo.policy`_ library differently to customize their"},{"line_number":157,"context_line":"authorization, which has implications on testing and validation."},{"line_number":158,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_dc84ceb3","line":155,"in_reply_to":"5f7c97a3_ab343d4a","updated":"2018-06-21 20:32:27.000000000","message":"Done","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"29a15198895b0928fa1b0caccb393ef2f0fa3f65","unresolved":false,"context_lines":[{"line_number":162,"context_line":"Critical authorization refers to raising an exception following failed policy"},{"line_number":163,"context_line":"authorization. Services can provide a `flag`_ to `oslo.policy`_ to control"},{"line_number":164,"context_line":"whether an exception is raised (critical) or whether a boolean value is"},{"line_number":165,"context_line":"returned (non-critical)."},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"This means that Patrole must account for policy failure in a few ways:"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_079c4bbd","line":165,"updated":"2018-06-20 18:39:25.000000000","message":"Should expand and say the second case is used for conditionally adding fields to response bodies or adding objects to lists","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"101f070ae89a5b57ae8283fa29eeae09e6ddaea5","unresolved":false,"context_lines":[{"line_number":162,"context_line":"Critical authorization refers to raising an exception following failed policy"},{"line_number":163,"context_line":"authorization. Services can provide a `flag`_ to `oslo.policy`_ to control"},{"line_number":164,"context_line":"whether an exception is raised (critical) or whether a boolean value is"},{"line_number":165,"context_line":"returned (non-critical)."},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"This means that Patrole must account for policy failure in a few ways:"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_fc0e6a3b","line":165,"in_reply_to":"5f7c97a3_079c4bbd","updated":"2018-06-21 20:32:27.000000000","message":"Done","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"29a15198895b0928fa1b0caccb393ef2f0fa3f65","unresolved":false,"context_lines":[{"line_number":169,"context_line":"* An API raises a **403 Forbidden**. (critical authZ failure)"},{"line_number":170,"context_line":"* An API fails to add a field to a response body. (non-critical authZ failure)"},{"line_number":171,"context_line":"* An API returns an empty response body. (non-critical authZ failure)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":".. note::"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"  In the case of Neutron, a **404 Not Found** may be raised instead of a"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_e7810f4f","line":172,"updated":"2018-06-20 18:39:25.000000000","message":"A list is empty or is missing some available resources","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"101f070ae89a5b57ae8283fa29eeae09e6ddaea5","unresolved":false,"context_lines":[{"line_number":169,"context_line":"* An API raises a **403 Forbidden**. (critical authZ failure)"},{"line_number":170,"context_line":"* An API fails to add a field to a response body. (non-critical authZ failure)"},{"line_number":171,"context_line":"* An API returns an empty response body. (non-critical authZ failure)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":".. note::"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"  In the case of Neutron, a **404 Not Found** may be raised instead of a"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_1c14864c","line":172,"in_reply_to":"5f7c97a3_e7810f4f","updated":"2018-06-21 20:32:27.000000000","message":"Done","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"c8a162062e4bed484db37c018627e6ebc158b521","unresolved":false,"context_lines":[{"line_number":231,"context_line":"However, Patrole tries to avoid validating implicit or indirect policy calls"},{"line_number":232,"context_line":"for 2 important reasons:"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"#. It is not covered by policy in code documentation which makes it very"},{"line_number":235,"context_line":"   difficult to guarantee stable tests."},{"line_number":236,"context_line":"#. Internal code can change often, making it very difficult to guarantee"},{"line_number":237,"context_line":"   stable tests."},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"Multiple Policy Authorization"},{"line_number":240,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_7c433ab1","line":237,"range":{"start_line":234,"start_character":0,"end_line":237,"end_character":16},"updated":"2018-06-21 20:11:46.000000000","message":"Can phrase this better, in a less repetitive way","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"101f070ae89a5b57ae8283fa29eeae09e6ddaea5","unresolved":false,"context_lines":[{"line_number":231,"context_line":"However, Patrole tries to avoid validating implicit or indirect policy calls"},{"line_number":232,"context_line":"for 2 important reasons:"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"#. It is not covered by policy in code documentation which makes it very"},{"line_number":235,"context_line":"   difficult to guarantee stable tests."},{"line_number":236,"context_line":"#. Internal code can change often, making it very difficult to guarantee"},{"line_number":237,"context_line":"   stable tests."},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"Multiple Policy Authorization"},{"line_number":240,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5f7c97a3_bc0c7242","line":237,"range":{"start_line":234,"start_character":0,"end_line":237,"end_character":16},"in_reply_to":"5f7c97a3_7c433ab1","updated":"2018-06-21 20:32:27.000000000","message":"Done","commit_id":"327ff0bee0fef9326bc3b5e98cd5056afe760da4"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":5,"context_line":"Introduction"},{"line_number":6,"context_line":"------------"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"Role-Based Access Control (RBAC) is used by each OpenStack service to delegate"},{"line_number":9,"context_line":"access to resources to authorized users. Patrole is concerned with validating"},{"line_number":10,"context_line":"that each of these resources *can* be accessed by authorized users and *cannot*"},{"line_number":11,"context_line":"be accessed by unauthorized users."}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_fe014705","line":8,"range":{"start_line":8,"start_character":41,"end_line":8,"end_character":66},"updated":"2018-06-25 21:40:30.000000000","message":"not so sure about Swift, I think they use ACLs","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d6de169718789870f0af548d2e89ae885d654bad","unresolved":false,"context_lines":[{"line_number":5,"context_line":"Introduction"},{"line_number":6,"context_line":"------------"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"Role-Based Access Control (RBAC) is used by each OpenStack service to delegate"},{"line_number":9,"context_line":"access to resources to authorized users. Patrole is concerned with validating"},{"line_number":10,"context_line":"that each of these resources *can* be accessed by authorized users and *cannot*"},{"line_number":11,"context_line":"be accessed by unauthorized users."}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_6f3b3fc7","line":8,"range":{"start_line":8,"start_character":41,"end_line":8,"end_character":66},"in_reply_to":"5f7c97a3_fe014705","updated":"2018-06-26 00:01:08.000000000","message":"True, will update to say \"most every\"","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Policy Validation"},{"line_number":14,"context_line":"-----------------"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Each OpenStack service uses `oslo.policy`_ as the library for RBAC"},{"line_number":17,"context_line":"authorization. Patrole relies on the same library for deriving expected"},{"line_number":18,"context_line":"test results."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_fe2aa77b","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":22},"updated":"2018-06-25 21:40:30.000000000","message":"I think the exception would be Swift","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4c34c59f84935b0a410f88e57ceefd9c73a151c3","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Policy Validation"},{"line_number":14,"context_line":"-----------------"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Each OpenStack service uses `oslo.policy`_ as the library for RBAC"},{"line_number":17,"context_line":"authorization. Patrole relies on the same library for deriving expected"},{"line_number":18,"context_line":"test results."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_2fdd476c","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":22},"in_reply_to":"5f7c97a3_fe2aa77b","updated":"2018-06-26 00:14:48.000000000","message":"Reprhased","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":17,"context_line":"authorization. Patrole relies on the same library for deriving expected"},{"line_number":18,"context_line":"test results."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Afterward, Patrole calls the API resource that enforces the RBAC policy."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Finally, Patrole checks whether the expected and actual test results match."},{"line_number":23,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_1e31a3ed","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":9},"updated":"2018-06-25 21:40:30.000000000","message":"nit : Afterwards","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d6de169718789870f0af548d2e89ae885d654bad","unresolved":false,"context_lines":[{"line_number":17,"context_line":"authorization. Patrole relies on the same library for deriving expected"},{"line_number":18,"context_line":"test results."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Afterward, Patrole calls the API resource that enforces the RBAC policy."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Finally, Patrole checks whether the expected and actual test results match."},{"line_number":23,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_af6e37c5","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":9},"in_reply_to":"5f7c97a3_1e31a3ed","updated":"2018-06-26 00:01:08.000000000","message":"Both are correct, this is the American way, Afterwards is the British way, though Americans use both.","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"87168bea7ff6bd474c9af893167817c2a1339f50","unresolved":false,"context_lines":[{"line_number":17,"context_line":"authorization. Patrole relies on the same library for deriving expected"},{"line_number":18,"context_line":"test results."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Afterward, Patrole calls the API resource that enforces the RBAC policy."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Finally, Patrole checks whether the expected and actual test results match."},{"line_number":23,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_d77b00f1","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":9},"in_reply_to":"5f7c97a3_af6e37c5","updated":"2018-06-26 13:42:49.000000000","message":"I had no idea :)","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":65,"context_line":"Patrole offers support for validating APIs that enforce multiple policies."},{"line_number":66,"context_line":"Perhaps in an ideal world each API endpoint would enforce only one policy,"},{"line_number":67,"context_line":"but in reality some API endpoints enforce multiple policies. Thus, to offer"},{"line_number":68,"context_line":"accurate validation, Patrole handles multiple policies for select tests."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Coverage"},{"line_number":71,"context_line":"--------"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_3e125ffe","line":68,"range":{"start_line":68,"start_character":59,"end_line":68,"end_character":72},"updated":"2018-06-25 21:40:30.000000000","message":"select tests - for services that use policy in code and the API code clearly shows multiple policy actions being validated.","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d6de169718789870f0af548d2e89ae885d654bad","unresolved":false,"context_lines":[{"line_number":65,"context_line":"Patrole offers support for validating APIs that enforce multiple policies."},{"line_number":66,"context_line":"Perhaps in an ideal world each API endpoint would enforce only one policy,"},{"line_number":67,"context_line":"but in reality some API endpoints enforce multiple policies. Thus, to offer"},{"line_number":68,"context_line":"accurate validation, Patrole handles multiple policies for select tests."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Coverage"},{"line_number":71,"context_line":"--------"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_0f5f2b0f","line":68,"range":{"start_line":68,"start_character":59,"end_line":68,"end_character":72},"in_reply_to":"5f7c97a3_3e125ffe","updated":"2018-06-26 00:01:08.000000000","message":"Thanks, will add better criteria using a bullet list and put a TODO to link to multi-policy validation which will elaborate on it. It\u0027s a WIP right now.","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":171,"context_line":"*meaningfully* perform negative testing against that action to confirm whether"},{"line_number":172,"context_line":"an unauthorized user is disallowed to perform the action."},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"For example, if a hypothetical policy is defined as \"list_servers:@\" (where"},{"line_number":175,"context_line":"\"@\" allows anyone to perform the \"list_servers\" action), then when Patrole"},{"line_number":176,"context_line":"runs a test that validates that policy, no matter the role it uses,"},{"line_number":177,"context_line":"the test will always pass with a successful response code."}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_7e78d729","line":174,"range":{"start_line":174,"start_character":12,"end_line":174,"end_character":30},"updated":"2018-06-25 21:40:30.000000000","message":"hypothetically if a policy..","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4c34c59f84935b0a410f88e57ceefd9c73a151c3","unresolved":false,"context_lines":[{"line_number":171,"context_line":"*meaningfully* perform negative testing against that action to confirm whether"},{"line_number":172,"context_line":"an unauthorized user is disallowed to perform the action."},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"For example, if a hypothetical policy is defined as \"list_servers:@\" (where"},{"line_number":175,"context_line":"\"@\" allows anyone to perform the \"list_servers\" action), then when Patrole"},{"line_number":176,"context_line":"runs a test that validates that policy, no matter the role it uses,"},{"line_number":177,"context_line":"the test will always pass with a successful response code."}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_6f6edf96","line":174,"range":{"start_line":174,"start_character":12,"end_line":174,"end_character":30},"in_reply_to":"5f7c97a3_7e78d729","updated":"2018-06-26 00:14:48.000000000","message":"Done","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"This means that Patrole must account for policy failure in a few ways:"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"* An API raises a **403 Forbidden**. (critical authZ failure)"},{"line_number":206,"context_line":"* An API fails to add a field to a response body. (non-critical authZ failure)"},{"line_number":207,"context_line":"* An API returns an empty response body. (non-critical authZ failure)"},{"line_number":208,"context_line":"* A list is empty or is missing some available resources only visible to"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_beb0afdd","line":205,"range":{"start_line":205,"start_character":47,"end_line":205,"end_character":52},"updated":"2018-06-25 21:40:30.000000000","message":"auth?","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"87168bea7ff6bd474c9af893167817c2a1339f50","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"This means that Patrole must account for policy failure in a few ways:"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"* An API raises a **403 Forbidden**. (critical authZ failure)"},{"line_number":206,"context_line":"* An API fails to add a field to a response body. (non-critical authZ failure)"},{"line_number":207,"context_line":"* An API returns an empty response body. (non-critical authZ failure)"},{"line_number":208,"context_line":"* A list is empty or is missing some available resources only visible to"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_975a687f","line":205,"range":{"start_line":205,"start_character":47,"end_line":205,"end_character":52},"in_reply_to":"5f7c97a3_8fa01bf5","updated":"2018-06-26 13:42:49.000000000","message":"thanks for clarifying","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d6de169718789870f0af548d2e89ae885d654bad","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"This means that Patrole must account for policy failure in a few ways:"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"* An API raises a **403 Forbidden**. (critical authZ failure)"},{"line_number":206,"context_line":"* An API fails to add a field to a response body. (non-critical authZ failure)"},{"line_number":207,"context_line":"* An API returns an empty response body. (non-critical authZ failure)"},{"line_number":208,"context_line":"* A list is empty or is missing some available resources only visible to"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_8fa01bf5","line":205,"range":{"start_line":205,"start_character":47,"end_line":205,"end_character":52},"in_reply_to":"5f7c97a3_beb0afdd","updated":"2018-06-26 00:01:08.000000000","message":"It\u0027s short for authorization. authZ\u003d authorization, authN \u003d authentication. These are common words in security. But I will change it to say authorization to make it clearer.","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":226,"context_line":"Implicit vs. Explicit Policy Authorization"},{"line_number":227,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":":ref:`policy-in-code` documentation is used to map policies to the APIs that"},{"line_number":230,"context_line":"enforce them. However, the documentation *only* includes an API entry under"},{"line_number":231,"context_line":"a policy if the API *explicitly* enforces the policy. For example, an entry"},{"line_number":232,"context_line":"may look like::"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_bee50fdd","line":229,"range":{"start_line":229,"start_character":51,"end_line":229,"end_character":59},"updated":"2018-06-25 21:40:30.000000000","message":"policy actions","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4c34c59f84935b0a410f88e57ceefd9c73a151c3","unresolved":false,"context_lines":[{"line_number":226,"context_line":"Implicit vs. Explicit Policy Authorization"},{"line_number":227,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":":ref:`policy-in-code` documentation is used to map policies to the APIs that"},{"line_number":230,"context_line":"enforce them. However, the documentation *only* includes an API entry under"},{"line_number":231,"context_line":"a policy if the API *explicitly* enforces the policy. For example, an entry"},{"line_number":232,"context_line":"may look like::"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_af5877f8","line":229,"range":{"start_line":229,"start_character":51,"end_line":229,"end_character":59},"in_reply_to":"5f7c97a3_bee50fdd","updated":"2018-06-26 00:14:48.000000000","message":"Done","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d6de169718789870f0af548d2e89ae885d654bad","unresolved":false,"context_lines":[{"line_number":327,"context_line":""},{"line_number":328,"context_line":"  policy file"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    Prior to `governance goal`_ used by all OpenStack services to define"},{"line_number":331,"context_line":"    policy defaults. Still used by some services, which is why Patrole"},{"line_number":332,"context_line":"    needs to read the policy files to derive policy information for testing."},{"line_number":333,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_af7cf770","line":330,"range":{"start_line":330,"start_character":30,"end_line":330,"end_character":31},"updated":"2018-06-26 00:01:08.000000000","message":"missing comma","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4c34c59f84935b0a410f88e57ceefd9c73a151c3","unresolved":false,"context_lines":[{"line_number":327,"context_line":""},{"line_number":328,"context_line":"  policy file"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    Prior to `governance goal`_ used by all OpenStack services to define"},{"line_number":331,"context_line":"    policy defaults. Still used by some services, which is why Patrole"},{"line_number":332,"context_line":"    needs to read the policy files to derive policy information for testing."},{"line_number":333,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_0f696b8a","line":330,"range":{"start_line":330,"start_character":30,"end_line":330,"end_character":31},"in_reply_to":"5f7c97a3_af7cf770","updated":"2018-06-26 00:14:48.000000000","message":"Never mind","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    Prior to `governance goal`_ used by all OpenStack services to define"},{"line_number":331,"context_line":"    policy defaults. Still used by some services, which is why Patrole"},{"line_number":332,"context_line":"    needs to read the policy files to derive policy information for testing."},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"  policy in code"},{"line_number":335,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_1e1d23bd","line":332,"range":{"start_line":332,"start_character":22,"end_line":332,"end_character":76},"updated":"2018-06-25 21:40:30.000000000","message":"Just a side note, one way around having to have the policy file on the same host as Patrole is to use a custom requirements file.","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d6de169718789870f0af548d2e89ae885d654bad","unresolved":false,"context_lines":[{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    Prior to `governance goal`_ used by all OpenStack services to define"},{"line_number":331,"context_line":"    policy defaults. Still used by some services, which is why Patrole"},{"line_number":332,"context_line":"    needs to read the policy files to derive policy information for testing."},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"  policy in code"},{"line_number":335,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_0f8deb7a","line":332,"range":{"start_line":332,"start_character":22,"end_line":332,"end_character":76},"in_reply_to":"5f7c97a3_1e1d23bd","updated":"2018-06-26 00:01:08.000000000","message":"I will add an entry for it.","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"99a9859338f56d2606b3216d53741b2119265c83","unresolved":false,"context_lines":[{"line_number":351,"context_line":"  role"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    A designation for the set of actions that describe what a user can do in"},{"line_number":354,"context_line":"    the system."},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"  Role-Based Access Control (RBAC)"},{"line_number":357,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_be818fc4","line":354,"updated":"2018-06-25 21:40:30.000000000","message":"managed through Keystone role API","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"29e09e33e7711da8b3b295dc09e9460a7cb9ee5a","unresolved":false,"context_lines":[{"line_number":351,"context_line":"  role"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    A designation for the set of actions that describe what a user can do in"},{"line_number":354,"context_line":"    the system."},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"  Role-Based Access Control (RBAC)"},{"line_number":357,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"5f7c97a3_ef30afa0","line":354,"in_reply_to":"5f7c97a3_be818fc4","updated":"2018-06-26 00:17:41.000000000","message":"Done","commit_id":"a46eb978cdc2d90e0424ff7c21c877f1fd8ab3fa"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"25fa894ab9d740dbc9fc2723fda3ead04a6d6e44","unresolved":false,"context_lines":[{"line_number":282,"context_line":"for 2 important reasons, both of which make it very difficult to guarantee"},{"line_number":283,"context_line":"stable tests:"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"#. Indirect policy invocations not covered by policy in code documentation"},{"line_number":286,"context_line":"#. Internal code can change often, making it difficult to keep track of changes"},{"line_number":287,"context_line":"   to indirect policy invocations"},{"line_number":288,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"5f7c97a3_4fcf637e","line":285,"range":{"start_line":285,"start_character":31,"end_line":285,"end_character":34},"updated":"2018-06-26 00:24:34.000000000","message":"are not","commit_id":"c59d0de21b76801eba0ba9e4a5558ef6a628fdfb"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"87168bea7ff6bd474c9af893167817c2a1339f50","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"* for services *with* policy in code documentation: this documentation"},{"line_number":70,"context_line":"  indicates that a single API endpoint enforces multiple policy actions."},{"line_number":71,"context_line":"* for services *without* policy in code documentation: the API code code"},{"line_number":72,"context_line":"  clearly shows multiple policy actions being validated. Note that in this case"},{"line_number":73,"context_line":"  some degree of log tracing is required by developers to confirm that the"},{"line_number":74,"context_line":"  expected policies are getting enforced, prior to the tests getting merged."}],"source_content_type":"text/x-rst","patch_set":14,"id":"5f7c97a3_578370a9","line":71,"range":{"start_line":71,"start_character":68,"end_line":71,"end_character":72},"updated":"2018-06-26 13:42:49.000000000","message":"duplicate","commit_id":"f00bd991899d7a3b063435545caa56adb4bde37b"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4d6c51b4e97caa2a3490695a4bb4733670ed3eb4","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"* for services *with* policy in code documentation: this documentation"},{"line_number":70,"context_line":"  indicates that a single API endpoint enforces multiple policy actions."},{"line_number":71,"context_line":"* for services *without* policy in code documentation: the API code code"},{"line_number":72,"context_line":"  clearly shows multiple policy actions being validated. Note that in this case"},{"line_number":73,"context_line":"  some degree of log tracing is required by developers to confirm that the"},{"line_number":74,"context_line":"  expected policies are getting enforced, prior to the tests getting merged."}],"source_content_type":"text/x-rst","patch_set":14,"id":"5f7c97a3_ba0429c7","line":71,"range":{"start_line":71,"start_character":68,"end_line":71,"end_character":72},"in_reply_to":"5f7c97a3_578370a9","updated":"2018-06-26 13:58:01.000000000","message":"Done","commit_id":"f00bd991899d7a3b063435545caa56adb4bde37b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d996ae0ed6585ca9a106b41456f807355302188","unresolved":false,"context_lines":[{"line_number":78,"context_line":"  Link to on multi-policy validation documentation section once it has"},{"line_number":79,"context_line":"  been written."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"Coverage"},{"line_number":82,"context_line":"--------"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"Patrole offers test coverage for the following services:"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"* Cinder"},{"line_number":87,"context_line":"* Glance"},{"line_number":88,"context_line":"* Keystone"},{"line_number":89,"context_line":"* Neutron"},{"line_number":90,"context_line":"* Nova"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"Note that Swift currently does not have RBAC so is not covered by Patrole."},{"line_number":93,"context_line":""}],"source_content_type":"text/x-rst","patch_set":15,"id":"5f7c97a3_c639553f","line":90,"range":{"start_line":81,"start_character":0,"end_line":90,"end_character":6},"updated":"2018-07-05 08:01:59.000000000","message":"this section more of patrole bot just RBAC overview.","commit_id":"f41d0954d3208a61352393729f26a8479a8af794"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d996ae0ed6585ca9a106b41456f807355302188","unresolved":false,"context_lines":[{"line_number":116,"context_line":".. _Nova repository: https://github.com/openstack/nova/tree/master/nova/policies"},{"line_number":117,"context_line":".. _Keystone repository: https://github.com/openstack/keystone/tree/master/keystone/common/policies"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"Stability of Tests"},{"line_number":120,"context_line":"^^^^^^^^^^^^^^^^^^"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"Stable tests have the following prerequisites:"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":".. _policy-in-code-support:"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"1. Belong to a service that has implemented the `governance goal`_."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":".. _alignment-with-policy-in-code:"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"2. Have aligned with the service\u0027s policy in code documentation."},{"line_number":131,"context_line":""},{"line_number":132,"context_line":".. _multi-policy-support:"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"3. Selectively implement multi-policy support."},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"For each service supported in Patrole, the table below captures the maturity of"},{"line_number":137,"context_line":"that service\u0027s RBAC tests in accordance with the above criteria:"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":".. list-table:: **Test Stability by Component**"},{"line_number":140,"context_line":"   :header-rows: 1"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"   * - Service Name"},{"line_number":143,"context_line":"     - :ref:`Policy in code implemented \u003cpolicy-in-code-support\u003e`"},{"line_number":144,"context_line":"     - :ref:`Policy in code support \u003calignment-with-policy-in-code\u003e`"},{"line_number":145,"context_line":"     - :ref:`Multi-policy support \u003cmulti-policy-support\u003e`"},{"line_number":146,"context_line":"   * - Cinder"},{"line_number":147,"context_line":"     - Yes"},{"line_number":148,"context_line":"     - WIP"},{"line_number":149,"context_line":"     - WIP"},{"line_number":150,"context_line":"   * - Glance"},{"line_number":151,"context_line":"     - No"},{"line_number":152,"context_line":"     - No"},{"line_number":153,"context_line":"     - No"},{"line_number":154,"context_line":"   * - Keystone"},{"line_number":155,"context_line":"     - Yes"},{"line_number":156,"context_line":"     - Yes"},{"line_number":157,"context_line":"     - WIP"},{"line_number":158,"context_line":"   * - Nova"},{"line_number":159,"context_line":"     - Yes"},{"line_number":160,"context_line":"     - Yes"},{"line_number":161,"context_line":"     - WIP"},{"line_number":162,"context_line":"   * - Neutron"},{"line_number":163,"context_line":"     - No"},{"line_number":164,"context_line":"     - No"},{"line_number":165,"context_line":"     - No"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"Policy Validation Considerations"},{"line_number":168,"context_line":"--------------------------------"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"Services leverage the `oslo.policy`_ library differently to customize their"},{"line_number":171,"context_line":"authorization, which has implications on testing and validation."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":".. _custom-policy-discussion:"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"Default vs. Custom Policy Validation"},{"line_number":176,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"While validating default policy configuration is important in order to ensure"},{"line_number":179,"context_line":"that policy defaults are secure, the defaults contain many gaps from the"},{"line_number":180,"context_line":"perspective of validation. A gap occurs when a policy default is configured"},{"line_number":181,"context_line":"to allow anyone to perform the action, because it means that Patrole cannot"},{"line_number":182,"context_line":"*meaningfully* perform negative testing against that action to confirm whether"},{"line_number":183,"context_line":"an unauthorized user is disallowed to perform the action."},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"For example, hypothetically if a policy is defined as \"list_servers:@\" (where"},{"line_number":186,"context_line":"\"@\" allows anyone to perform the \"list_servers\" action), then when Patrole"},{"line_number":187,"context_line":"runs a test that validates that policy, no matter the role it uses,"},{"line_number":188,"context_line":"the test will always pass with a successful response code."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Ideally, Patrole should be able to validate that every action defined in the"},{"line_number":191,"context_line":"system *cannot* be performed by unauthorized roles."},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"However, such an ideal requires support for custom policy validation. This"},{"line_number":194,"context_line":"requires the ability for Patrole to account for custom policy overrides"},{"line_number":195,"context_line":"in order to:"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"* validate that those overrides behave as expected"},{"line_number":198,"context_line":"* close negative testing gaps that aren\u0027t natively covered by default policies"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"Critical vs. Non-critical Authorization"},{"line_number":201,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Critical authorization refers to raising an exception following failed policy"},{"line_number":204,"context_line":"authorization. Services can provide a `flag`_ to `oslo.policy`_ to control"},{"line_number":205,"context_line":"whether an exception is raised (critical) or whether a boolean value is"},{"line_number":206,"context_line":"returned (non-critical). The non-critical case is useful, for example, for:"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"* conditionally adding fields to response bodies"},{"line_number":209,"context_line":"* adding objects to lists"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"such that unauthorized users are only provided with a subset of a resource\u0027s"},{"line_number":212,"context_line":"data, rather denied access to the resource itself."},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"This means that Patrole must account for policy failure in a few ways:"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"* An API raises a **403 Forbidden**. (critical authorization failure)"},{"line_number":217,"context_line":"* An API fails to add a field to a response body. (non-critical authorization"},{"line_number":218,"context_line":"  failure)"},{"line_number":219,"context_line":"* An API returns an empty response body. (non-critical authorization failure)"},{"line_number":220,"context_line":"* A list is empty or is missing some available resources only visible to"},{"line_number":221,"context_line":"  authorized users. (non-critical authorization failure)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":".. note::"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"  In the case of Neutron, a **404 Not Found** may be raised instead of a"},{"line_number":226,"context_line":"  **403 Forbidden** in order to prevent resource discovery, upon failed"},{"line_number":227,"context_line":"  authorization. Patrole must handle this case as well in order to correctly"},{"line_number":228,"context_line":"  validate Neutron. See `Neutron\u0027s RBAC documentation`_ for further details."},{"line_number":229,"context_line":""},{"line_number":230,"context_line":".. todo::"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"  Link to Neutron multi-policy validation documentation section once it has"},{"line_number":233,"context_line":"  been written."},{"line_number":234,"context_line":""},{"line_number":235,"context_line":".. _flag: https://docs.openstack.org/oslo.policy/latest/reference/api/oslo_policy.policy.html#oslo_policy.policy.Enforcer.enforce"},{"line_number":236,"context_line":".. _Neutron\u0027s RBAC documentation: https://docs.openstack.org/neutron/pike/contributor/internals/policy.html"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"Implicit vs. Explicit Policy Authorization"},{"line_number":239,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":":ref:`policy-in-code` documentation is used to map policy actions to the APIs"},{"line_number":242,"context_line":"that enforce them. However, the documentation *only* includes an API entry"},{"line_number":243,"context_line":"under a policy if the API *explicitly* enforces the policy. For example, an"},{"line_number":244,"context_line":"entry may look like::"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"  policy.DocumentedRuleDefault("},{"line_number":247,"context_line":"      name\u003dEXTEND_POLICY,"},{"line_number":248,"context_line":"      check_str\u003dbase.RULE_ADMIN_OR_OWNER,"},{"line_number":249,"context_line":"      description\u003d\"Extend a volume.\","},{"line_number":250,"context_line":"      operations\u003d["},{"line_number":251,"context_line":"          {"},{"line_number":252,"context_line":"              \u0027method\u0027: \u0027POST\u0027,"},{"line_number":253,"context_line":"              \u0027path\u0027: \u0027/volumes/{volume_id}/action (os-extend)\u0027"},{"line_number":254,"context_line":"          }"},{"line_number":255,"context_line":"      ]),"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"Which means that the ``os-extend`` API *explicitly* enforces the"},{"line_number":258,"context_line":"``EXTEND_POLICY`` policy via a call to ``oslo.policy`` with that policy."},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"But there are many cases where an API may call another API, which in turn"},{"line_number":261,"context_line":"enforces a policy. This means that the first API *indirectly* or *implicitly*"},{"line_number":262,"context_line":"enforces a policy by way of calling another API. For example::"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def _set_bootable(self, req, id, body):"},{"line_number":265,"context_line":"        \"\"\"Update bootable status of a volume.\"\"\""},{"line_number":266,"context_line":"        context \u003d req.environ[\u0027cinder.context\u0027]"},{"line_number":267,"context_line":"        # Not found exception will be handled at the wsgi level"},{"line_number":268,"context_line":"        volume \u003d self.volume_api.get(context, id)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"        bootable \u003d strutils.bool_from_string("},{"line_number":271,"context_line":"            body[\u0027os-set_bootable\u0027][\u0027bootable\u0027], strict\u003dTrue)"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        update_dict \u003d {\u0027bootable\u0027: bootable}"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        self.volume_api.update(context, volume, update_dict)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"Note that the ``os-set_bootable`` API calls the ``get`` and ``update`` actions"},{"line_number":278,"context_line":"in the ``volume_api`` which means that ``os-set_bootable`` *indirectly*"},{"line_number":279,"context_line":"enforces the policies invoked by those internal API calls."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"However, Patrole tries to avoid validating implicit or indirect policy calls"},{"line_number":282,"context_line":"for 2 important reasons, both of which make it very difficult to guarantee"},{"line_number":283,"context_line":"stable tests:"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"#. Indirect policy invocations are not covered by policy in code documentation"},{"line_number":286,"context_line":"#. Internal code can change often, making it difficult to keep track of changes"},{"line_number":287,"context_line":"   to indirect policy invocations"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"Multiple Policy Authorization"},{"line_number":290,"context_line":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"Some APIs enforce multiple policies for a variety of reasons, including:"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"* Complex API workflows."},{"line_number":295,"context_line":"* Adding additional fields to responses."},{"line_number":296,"context_line":"* Performing conditional branches within the API code."},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"Patrole validates multiple policies because otherwise it is not possible to"},{"line_number":299,"context_line":"accurately determine the expected test result, leading to errant test failures."},{"line_number":300,"context_line":""},{"line_number":301,"context_line":".. todo::"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"  Link to multi-policy validation documentation once it has been written for"},{"line_number":304,"context_line":"  details."},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"Glossary"},{"line_number":307,"context_line":"--------"}],"source_content_type":"text/x-rst","patch_set":15,"id":"5f7c97a3_6642c1ae","line":304,"range":{"start_line":119,"start_character":0,"end_line":304,"end_character":10},"updated":"2018-07-05 08:01:59.000000000","message":"ditto","commit_id":"f41d0954d3208a61352393729f26a8479a8af794"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"5f3e5b3bf836c6817de51d0f8651fbcac7b8019f","unresolved":false,"context_lines":[{"line_number":30,"context_line":"directory layout pattern with respect to policy in code."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The policy in code `governance goal`_ enumerates many advantages with following"},{"line_number":33,"context_line":"this RBAC design approach. Another advantage with policy in code is the ability"},{"line_number":34,"context_line":"to validate the officially supported library of policies. A so-called"},{"line_number":35,"context_line":"library of policies offers the following advantages, with respect to"},{"line_number":36,"context_line":"facilitating validation:"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-rst","patch_set":27,"id":"5f7c97a3_dc3a6195","line":34,"range":{"start_line":33,"start_character":27,"end_line":34,"end_character":57},"updated":"2018-07-19 05:52:44.000000000","message":"Reword to say this offers many advantages and just include the list below","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"f7923d3fbcce7b397dba176e95e6209b0cfe2893","unresolved":false,"context_lines":[{"line_number":30,"context_line":"directory layout pattern with respect to policy in code."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The policy in code `governance goal`_ enumerates many advantages with following"},{"line_number":33,"context_line":"this RBAC design approach. Another advantage with policy in code is the ability"},{"line_number":34,"context_line":"to validate the officially supported library of policies. A so-called"},{"line_number":35,"context_line":"library of policies offers the following advantages, with respect to"},{"line_number":36,"context_line":"facilitating validation:"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-rst","patch_set":27,"id":"5f7c97a3_bfd3ae36","line":34,"range":{"start_line":33,"start_character":27,"end_line":34,"end_character":57},"in_reply_to":"5f7c97a3_dc3a6195","updated":"2018-07-20 15:00:29.000000000","message":"Done","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"3dfeba59fa4f6013bf2204b5521111ced7cbb893","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    The `do_raise`_ flag controls whether policy authorization should result"},{"line_number":156,"context_line":"    in an exception getting raised or a boolean value getting returned."},{"line_number":157,"context_line":"    Hard authorization results in an exception getting raised. Usually, this"},{"line_number":158,"context_line":"    results in a ``403 Forbidden`` getting returned for unauthorized requests."},{"line_number":159,"context_line":"    Related term: :term:`soft authorization`."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"  oslo.policy"}],"source_content_type":"text/x-rst","patch_set":27,"id":"5f7c97a3_dc77c18d","line":158,"range":{"start_line":158,"start_character":17,"end_line":158,"end_character":34},"updated":"2018-07-19 05:47:43.000000000","message":"Not true for Neutron - also raises 404 (this needs a special mention in this docs too; I need to check whether the Neutron info on policy authorization has been added to Patrole yet)","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"f7923d3fbcce7b397dba176e95e6209b0cfe2893","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    The `do_raise`_ flag controls whether policy authorization should result"},{"line_number":156,"context_line":"    in an exception getting raised or a boolean value getting returned."},{"line_number":157,"context_line":"    Hard authorization results in an exception getting raised. Usually, this"},{"line_number":158,"context_line":"    results in a ``403 Forbidden`` getting returned for unauthorized requests."},{"line_number":159,"context_line":"    Related term: :term:`soft authorization`."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"  oslo.policy"}],"source_content_type":"text/x-rst","patch_set":27,"id":"5f7c97a3_3f6c7e9b","line":158,"range":{"start_line":158,"start_character":17,"end_line":158,"end_character":34},"in_reply_to":"5f7c97a3_dc77c18d","updated":"2018-07-20 15:00:29.000000000","message":"Done","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"10e8d61d09f541cb127f8540ffba4238919bfcdb","unresolved":false,"context_lines":[{"line_number":224,"context_line":"    The `do_raise`_ flag controls whether policy authorization should result"},{"line_number":225,"context_line":"    in an exception getting raised or a boolean value getting returned."},{"line_number":226,"context_line":"    Soft authorization results in a boolean value getting returned. When policy"},{"line_number":227,"context_line":"    authorization evaluates to true, additional information is included in"},{"line_number":228,"context_line":"    the response body. Related term: :term:`hard authorization`."},{"line_number":229,"context_line":""},{"line_number":230,"context_line":".. _Nova repository: https://github.com/openstack/nova/tree/master/nova/policies"},{"line_number":231,"context_line":".. _Keystone repository: https://github.com/openstack/keystone/tree/master/keystone/common/policies"}],"source_content_type":"text/x-rst","patch_set":27,"id":"5f7c97a3_81f24268","line":228,"range":{"start_line":227,"start_character":37,"end_line":228,"end_character":22},"updated":"2018-07-19 05:41:21.000000000","message":"there might be additional operation done and no change in response body. SO how about this-\n\nadditional operation is performed as part of API request or additional information is included in\n    the response body.","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"f7923d3fbcce7b397dba176e95e6209b0cfe2893","unresolved":false,"context_lines":[{"line_number":224,"context_line":"    The `do_raise`_ flag controls whether policy authorization should result"},{"line_number":225,"context_line":"    in an exception getting raised or a boolean value getting returned."},{"line_number":226,"context_line":"    Soft authorization results in a boolean value getting returned. When policy"},{"line_number":227,"context_line":"    authorization evaluates to true, additional information is included in"},{"line_number":228,"context_line":"    the response body. Related term: :term:`hard authorization`."},{"line_number":229,"context_line":""},{"line_number":230,"context_line":".. _Nova repository: https://github.com/openstack/nova/tree/master/nova/policies"},{"line_number":231,"context_line":".. _Keystone repository: https://github.com/openstack/keystone/tree/master/keystone/common/policies"}],"source_content_type":"text/x-rst","patch_set":27,"id":"5f7c97a3_ff48462b","line":228,"range":{"start_line":227,"start_character":37,"end_line":228,"end_character":22},"in_reply_to":"5f7c97a3_81f24268","updated":"2018-07-20 15:00:29.000000000","message":"Done","commit_id":"fab62f3fc3194bf277c7b03675dfdb8a02484e0e"}]}
