Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RBAC: Add ability to delete role ACLs when deleting the role itself in the Admin API #17437

Merged
merged 8 commits into from
Mar 28, 2024

Conversation

oleiman
Copy link
Member

@oleiman oleiman commented Mar 27, 2024

Closes https://github.com/redpanda-data/core-internal/issues/1203

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

{std::move(role_binding_filter)}, 5s);

for (const auto& r : results) {
co_await throw_on_error(*req, r.error, model::controller_ntp);
Copy link
Member Author

Choose a reason for hiding this comment

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

Might be preferable to fail silently here. Idk. Any opinions?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably log it... or maybe include it in the response but still reutrn a 2XX response code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd probably log it

As in "log it and don't fail" or "log it and fail"? I'm kind of leaning toward just a log line and success, since any error here is functionally non-retryable (b/c the role is already gone).

include it in the response...

The success code here is 204 (No Content) so not much room for "extra" context. Might be confusing to have two different success modes.

While deleting a role, also delete ACLs if the `delete_acls` query
param is present and alpha-convertible to bool{true}.

We can do this by submitting a single delete_acls command to the
cluster controller with a "catch-all" filter for any acl entry bound
to the corresponding role principal.

This is NOT atomic with respect to the corresponding role management
command. It is possible that role deletion could succeed while some
or all ACL deletions return an error. In this case, the delete_role
operation will not be undone, but ACLs may be deleted manually on the
client side as needed.
Default "User", prepended to the `--allow-principal` value.

This is useful for testing "delete everything" behavior on the
DELETE role endpoint.
@oleiman
Copy link
Member Author

oleiman commented Mar 28, 2024

force push to log failed ACL deletions instead of failing the request outright

@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Mar 28, 2024

new failures in https://buildkite.com/redpanda/redpanda/builds/46941#018e8291-c049-483c-8af1-8fce00235b49:

"rptest.tests.consumer_group_test.ConsumerGroupTest.test_group_recovery"

new failures in https://buildkite.com/redpanda/redpanda/builds/46941#018e8291-c04e-47bc-bcf7-d98c435bd2c8:

"rptest.tests.partition_move_interruption_test.PartitionMoveInterruption.test_cancelling_partition_move.replication_factor=3.unclean_abort=False.recovery=no_recovery.compacted=False"

Copy link
Contributor

@michael-redpanda michael-redpanda left a comment

Choose a reason for hiding this comment

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

lgtm

@oleiman
Copy link
Member Author

oleiman commented Mar 28, 2024

@michael-redpanda michael-redpanda merged commit c239c55 into redpanda-data:dev Mar 28, 2024
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants