rbac: updating aaa_mode to no-auth via rest api doesnt reset mt flag

Bug #1650417 reported by Senthilnathan Murugappan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Fix Committed
Medium
Deepinder Setia
R3.2
Fix Committed
Medium
Deepinder Setia
Trunk
Fix Committed
Medium
Deepinder Setia

Bug Description

1) Update aaa_mode to no-auth from rbac via rest api
2) create VN
3) read back the VN would fail with below traces

aaa_mode_http_put should reset self._multi_tenancy flag when aaa-mode is updated to 'no-auth' via rest api.

self = <vnc_cfg_api_server.vnc_perms.VncPermissions object>
self.validate_perms = <bound method VncPermissions.validate_perms of <vnc_cfg_api_server.vnc_perms.VncPermissions object>>
request = <BaseRequest: GET http://127.0.0.1/virtual-netwo...961d-363a71968567&exclude_hrefs=True&detail=True>
id = 'a893db67-7c76-4ab8-a2a9-ec2c1f5c6be8'
global PERMS_R = 4
id_perms = {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7, 'share': []}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_perms.py in validate_perms(self=<vnc_cfg_api_server.vnc_perms.VncPermissions object>, request=<BaseRequest: GET http://127.0.0.1/virtual-netwo...961d-363a71968567&exclude_hrefs=True&detail=True>, uuid='a893db67-7c76-4ab8-a2a9-ec2c1f5c6be8', mode=4, id_perms={'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7, 'share': []})
   62 return (True, 'R')
   63
   64 owner = id_perms['permissions']['owner']
   65 group = id_perms['permissions']['group']
   66 perms = id_perms['permissions']['owner_access'] << 6 | \
owner undefined
id_perms = {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7, 'share': []}

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 1697, in handler_trap_exception
    response = handler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/vnc_api_stats.py", line 17, in wrapper
    response = func(api_server_obj, resource_type, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 1126, in http_resource_list
    req_fields, include_shared, exclude_hrefs)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 3116, in _list_collection
    obj_result = self.obj_view(resource_type, obj_result)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 738, in obj_view
    if self._permissions.check_perms_read(get_request(), l['uuid'], id_perms=uuid_to_perms2[l['uuid']])[0] == True]
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_perms.py", line 214, in check_perms_read
    return self.validate_perms(request, id, PERMS_R, id_perms)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_perms.py", line 64, in validate_perms
    owner = id_perms['permissions']['owner']
KeyError: 'permissions'

Tags: rbac
Changed in juniperopenstack:
importance: Undecided → Medium
Revision history for this message
Deepinder Setia (dsetia) wrote :

Senthil, can you list exact commands in step #2 and #3 for me to reproduce this?

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/27466
Submitter: Deepinder Setia (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/27489
Submitter: Deepinder Setia (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/27466
Committed: http://github.org/Juniper/contrail-controller/commit/c4f8ed9782d8443136b01d8f4ecba35517bbffe4
Submitter: Zuul (<email address hidden>)
Branch: master

commit c4f8ed9782d8443136b01d8f4ecba35517bbffe4
Author: Deepinder Setia <email address hidden>
Date: Tue Dec 20 15:23:05 2016 -0800

Change in aaa mode should be reflected in runtime auth pipeline.
Avoid using deprecated multi_tenancy flag. Instead peek at API
server object to manipulate the pipeline

Change-Id: Iea5ca7652ffd5c89102cb2639f7888db651a9fbb
Closes-Bug: #1650417

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/27489
Committed: http://github.org/Juniper/contrail-controller/commit/c38d160f0ba33aefce4f2538315255eaf97e7031
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit c38d160f0ba33aefce4f2538315255eaf97e7031
Author: Deepinder Setia <email address hidden>
Date: Tue Dec 20 15:23:05 2016 -0800

Change in aaa mode should be reflected in runtime auth pipeline.
Avoid using deprecated multi_tenancy flag. Instead peek at API
server object to manipulate the pipeline

Change-Id: Iea5ca7652ffd5c89102cb2639f7888db651a9fbb
Closes-Bug: #1650417

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

Review in progress for https://review.opencontrail.org/29814
Submitter: Deepinder Setia (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/29814
Committed: http://github.org/Juniper/contrail-controller/commit/e481beef3470a00afc06c2738b0989ab6097f892
Submitter: Zuul (<email address hidden>)
Branch: R3.1

commit e481beef3470a00afc06c2738b0989ab6097f892
Author: Deepinder Setia <email address hidden>
Date: Tue Dec 20 15:23:05 2016 -0800

Change in aaa mode should be reflected in runtime auth pipeline.
Avoid using deprecated multi_tenancy flag. Instead peek at API
server object to manipulate the pipeline

Change-Id: Iea5ca7652ffd5c89102cb2639f7888db651a9fbb
Closes-Bug: #1650417
(cherry picked from commit c38d160f0ba33aefce4f2538315255eaf97e7031)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.