SAP-samples / btp-setup-automator

Automate the setup of your SAP BTP account with the SAP BTP CLI and other CLI tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Wrong Role Collection assignment

AnatolManikalo opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Are you using the latest docker image for BTPSA?

  • I'm using the latest docker image for BTPSA.

Which area is mainly impacted

Cloud Foundry setups

Current Behavior

  1. All users mentioned in parameters.json under "myusergroups" section are added as Subaccount Administrators during "btp create accounts/subaccount" step (logfile.txt attachment, Line 77)

  2. Wrong users are assigned to Role Collections during "btp assign security/role-collection" step (logfile.txt attachment, Line 157) — my user (anatol.manikalo@sap.com) is added to "Cloud Connector Administrator" Role Collection despite my "test_tool.json" usecase asks to add only "placeholder" group which doesn't include me (there's only one email: "m.marek+1@sap.com")

Expected Behavior

  1. Only users from "admins" and "owners" groups are added to Subaccount Administrators as mentioned in "test_tool.json" (lines 19-24)
  2. Only users mentioned in "test_tool.json" usecase (lines 28-32) are assigned to "Cloud Connector Administrator" Role Collection

Steps To Reproduce

./run
docker exec -it *** sh
./btpsa

Logs and configuration files available?

Archive.zip

Anything else?

Hello colleagues,
My "parameters.json" file has information about 3 user groups: "admins", "placeholder", "owners"
My "test_tool" usecase declares to assign:

  • groups "admins" and "owners" to "Subaccount Administrator" Role Collection;
  • group "placeholder" to "Cloud Connector Administrator" Role Collection
  • groups "admins" and "owners" to CF OrgManager role

In fact, ALL users from "parameters.json" are added as Subaccount Administrators during "btp create accounts/subaccount" step (logfile.txt attachment, Line 77)

Also my user (anatol.manikalo@sap.com) is added to "Cloud Connector Administrator" Role Collection despite my "test_tool.json" usecase asks to add only "placeholder" group which doesn't include me (there's only one email: "m.marek+1@sap.com")

P.S. Could you please let me know how to disable default space creation? logfile.txt line 114

Thanks @AnatolManikalo .
Regarding your points:

  • "In fact, ALL users from "parameters.json" are added as Subaccount Administrators during "btp create accounts/subaccount" step (logfile.txt attachment, Line 77)": for me it looks like it is working as you have defined it, as all names are taken from the admins and owners list.
  • I'll fix the other issue that the user who is calling the script is assigned to all roles by default.

Hi @rui1610
Thanks for quick reply.

Regarding point 1: according to lines 22-24 of the usecase, only "admins" and "owners" groups should be added to Subaccount Administrator role collection, however in fact user from "placeholder" group (m.marek+1@sap.com) is added as well during "btp --format json create accounts/subaccount" step (line 77 of logfile.txt).

I checked the log attentively and noticed that "Subaccount Administrator" Role Collection assignment happens twice during the run of the script: on subaccount creation step and on Role assignment step (line 77 and lines 131-157 of logfile.txt). Should it be the case?

The reported bug is fixed. The fix is available in the dev branch (incl. Docker image) and will be available in main with release 1.2.0

Close issue - release 1.2.0 is available.
Docker Image is updated (docker pull ghcr.io/sap-samples/btp-setup-automator:btpsa-v1.2.0)