-
Type:
Suggestion
-
Resolution: Done
-
Component/s: Permissions, User Management, Crowd & LDAP integration
Summary
- Crowd has an option send lowercase username/group information to Bamboo
- this option prevents permissions granted to users and groups in Bamboo from validating
Steps to reproduce
1. Crowd
- add an Bamboo Application in Crowd
- add an UPPERCASE group (e.g.: BAMBOO-CROWD)
- add user to the group above
select * from cwd_user where user_name = "crowd.user"
id user_name lower_user_name active created_date updated_date first_name lower_first_name last_name lower_last_name display_name lower_display_name email_address lower_email_address external_id directory_id credential 360449 CROWD.USER crowd.user T 2016-04-05 12:38:58 2016-04-05 12:38:58 CROWD.USER crowd.user Crowd crowd CROWD.USER Crowd crowd.user crowd CROWD.USER@crowd.webserver crowd.user@crowd.webserver c234b32b-ac88-488f-8dd5-56def17f87d8 32769 {PKCS5S2} Kh5u4iJggIZqH8dQ3QfEVGWnjPLft+gsVEFDxrSd9sR7MTsoyMe2O+3Qb/WZQ/g8
select * from cwd_group where lower_group_name like "%bamboo-crowd%"
id group_name lower_group_name active is_local created_date updated_date description group_type directory_id 327681 BAMBOO-CROWD bamboo-crowd T F 2016-04-05 12:15:11 2016-04-05 12:15:11 GROUP 32769 select * from cwd_membership where child_name = "crowd.user"
id parent_id child_id membership_type group_type parent_name lower_parent_name child_name lower_child_name directory_id 425985 327681 360449 GROUP_USER GROUP BAMBOO-CROWD bamboo-crowd CROWD.USER crowd.user 32769
2. Bamboo
- go to Bamboo and add Crowd under "Bamboo administration >> Overview >> Security >> User repositories"
- go to "Bamboo administration >> Overview >> Security >> Users"
Username Email Full name Groups admin admin@crowd.webserver Administrator Crowd bamboo-admin
crowd-administratorsCROWD.USER CROWD.USER@crowd.webserver CROWD.USER Crowd BAMBOO-CROWD
3. Crowd
- go to Crowd under "Application >> Bamboo >> Options" tab
- select "Lower case output"
Lower case output Convert all users and groups to lower case when passing the data to the application. This can be used to achieve case insensitivity for applications when the underlying directories contain mixed-cased data.
4. Bamboo
- go to Bamboo and add Crowd under "Bamboo administration >> Overview >> Security >> User repositories" and hit Synchronise now
- go to "Bamboo administration >> Overview >> Security >> Users"
Username Email Full name Groups admin admin@crowd.webserver Administrator Crowd bamboo-admin
crowd-administratorscrowd.user CROWD.USER@crowd.webserver CROWD.USER Crowd bamboo-crowd
Please, notice username and group are now being displayed as lowercase. - go to Project / Plan under "Plan configuration >> Permissions" tab
- add a Group permission
Groups BAMBOO-CROWD [x] View [ ] Edit [x] Build [ ] Clone [ ] Admin] - Log in to Bamboo using CROWD.USER user
Expected Result
- Bamboo should update Group name by reflecting the change within Global and Plan permissions
Actual Result
- group does not have Build permissions to Project / Plan
Investigation done
- permissions are granted based on Username and Group and not based on IDs
- usernames from External Directory are added to the Bamboo's database only when user authenticates against Bamboo. Rest calls against Crowd are made from Bamboo to gather information about user/group
- Bamboo allows Group permission to be set up as UPPERCASE or lowercase
Workaround
- disable "Lower case output" under "Application >> Bamboo >> Options" tab and re-sync users/groups in Bamboo;
- OR add user(s) / group(s) permission as they are being displayed in Bamboo (in lowercase based on the above)
Groups bamboo-crowd [x] View [ ] Edit [x] Build [ ] Clone [ ] Admin] - OR update Bamboo's database:
Before running any UPDATE statement, please backup your database.- stop Bamboo
- extract from Bamboo's database all groups from external directory (e.g.: Crowd/Jira/LDAP)
select SID from ACL_ENTRY where SID not in (select groupname from groups) and TYPE = 'GROUP_PRINCIPAL' order by SID;
SID BAMBOO-CROWD crowd-administrators - update groups to lowercase
update ACL_ENTRY set SID = 'bamboo-crowd', where SID = 'BAMBOO-CROWD' and TYPE = 'GROUP_PRINCIPAL';
- start Bamboo
- relates to
-
BAM-17443 Allow Bamboo to create groups with upper-case charactes and spaces
- Closed