Skip to content

WIP: Adjust Domain Manager policies for Horizon and Terraform compatibility - #384

Merged
josephineSei merged 6 commits into
mainfrom
domain-manager-horizon-compat
Feb 7, 2024
Merged

josephineSei merged 6 commits into
mainfrom
domain-manager-horizon-compat

Conversation

@markus-hentsch

@markus-hentsch markus-hentsch commented Nov 18, 2023 •

Copy link
Copy Markdown
Contributor

Overhauls the Domain Manager policy configuration to improve compatibility with Horizon and Terraform.

Note the following section from the corresponding issue:

FTR, we discussed1 that we do not want to jump the gun and implement full Horizon support for Domain Managers in a way that enables the Domain Manager workflow in the dashboard. Reasoning was that for Domain Managers limited API access (e.g. Keystone only) might be provided and full dashboard usage might not be intended to begin with. Furthermore, debugging and development effort would be required to make Horizon compatible (see comments above).

Due to this, the work on this issue and the linked PR will address:

  • proper interaction for normal users (excluding Domain Managers) with the dashboard when the Domain Manager Standard is deployed
  • improved Terraform API compatibility for Domain Manager users

The PR will not address:

  • Domain Manager functionality (CRUD for users, groups, projects, role assignments in domains) on the Horizon dashboard

Footnotes

  1. https://github.com/SovereignCloudStack/minutes/blob/main/iaas/20231122.md?plain=1#L107-L110 ↩

Aligns the `identity:list_user_projects` policy rule with Keystone's
defaults [1] by incorporating the `_or_owner` part of it. This enables
Domain Managers to successfully log in using Horizon.

[1] https://files.openstack.org/docs/developer/keystone/sample_files/sample_policy.html

Signed-off-by: Markus Hentsch <[email protected]>
@berendt

berendt commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

This modification is also required to make the /identity/users dashboard usable.

identity:get_user": "(rule:is_domain_manager and token.domain.id:%(target.user.domain_id)s) or user_id:%(user_id)s or rule:admin_required"

@berendt

berendt commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

Project details are also not working. Probably identity:get_project has to be modified as well.

You can reproduce this by visiting a listed user in /identity/users. There click on the primary project of the users you are logged with.

@markus-hentsch

Copy link
Copy Markdown
Contributor Author

This modification is also required to make the /identity/users dashboard usable.

identity:get_user": "(rule:is_domain_manager and token.domain.id:%(target.user.domain_id)s) or user_id:%(user_id)s or rule:admin_required"

FTR, this concerns non-domain-manager users, for which it is actually necessary. It does not make a difference for Domain Managers.

Project details are also not working. Probably identity:get_project has to be modified as well.

You can reproduce this by visiting a listed user in /identity/users. There click on the primary project of the users you are logged with.

I can reproduce this with all policy overrides disabled (i.e. deleting policy.yaml and restarting Keystone) and using Keystone's default policies. Thus, I don't think this behavior is caused by the Domain Manager configuration.

Further aligns policy rules where admin_or_owner is used in
Keystone's defaults for better Horizon compatibility.

Signed-off-by: Markus Hentsch <[email protected]>
@markus-hentsch markus-hentsch changed the title WIP: Adjust 'identity:list_user_projects' for Horizon compatibility WIP: Adjust Domain Manager policies for Horizon compatibility Nov 23, 2023
… defaults

Aims to achieve full compatibility with legacy setups (using
"rule:admin_required") as well as the more recent system scope and new RBAC
defaults. Separates the upstream part of the definitions into a dedicated
section for better maintainability.

Signed-off-by: Markus Hentsch <[email protected]>
Lifts the restriction to domain-manager-managed roles for
"identity:check_grant" and "identity:list_grants" (read-only operations)
to enable discoverability of role assignments even for roles which cannot
be assigned or revoked by Domain Managers directly but should be visible
to them.

Signed-off-by: Markus Hentsch <[email protected]>
@markus-hentsch
markus-hentsch force-pushed the domain-manager-horizon-compat branch from a4d73db to 9449c8c Compare December 12, 2023 13:43
@markus-hentsch markus-hentsch changed the title WIP: Adjust Domain Manager policies for Horizon compatibility WIP: Adjust Domain Manager policies for Horizon and Terraform compatibility Dec 12, 2023
@josephineSei josephineSei self-assigned this Jan 8, 2024
@josephineSei

Copy link
Copy Markdown
Contributor

@berendt Could you test these changes again? I will take over from @markus-hentsch and work on any further bugs you might find.

@berendt

berendt commented Jan 9, 2024

Copy link
Copy Markdown
Contributor

@josephineSei I cannot reproduce it right now. I have added the state from this PR in our testbed and it runs both the playbook for the test (https://github.com/osism/testbed/blob/main/environments/openstack/playbook-test-identity.yml) and Refstack (2022.11) completely.

@josephineSei

Copy link
Copy Markdown
Contributor

@berendt does this mean, we can approve and merge this PR?
Or are further tests needed?

@berendt

berendt commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

Fro my POV it can be merged.

@josephineSei josephineSei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the changes and it seems we got a whole policy file within this standard. I only have the question, whether we want this in the standard or maybe a separated extra file?

The last option has the positive side effect, that, when something in the upstream policy changes we do not have to adjust the standard. But maybe that is exactly what we want.

@garloff

garloff commented Feb 6, 2024

Copy link
Copy Markdown
Member

When we split out implementation notes out of standards, we might move the policy file there.
This should not prevent us from merging the standard now, though.

@anjastrunk
anjastrunk self-requested a review February 7, 2024 12:32
Set correct reference

Signed-off-by: josephineSei <[email protected]>
@josephineSei
josephineSei merged commit c7523c7 into main Feb 7, 2024
@josephineSei
josephineSei deleted the domain-manager-horizon-compat branch February 7, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Achieve Horizon and Terraform compatibility for the Domain Manager standard

4 participants