redpanda icon indicating copy to clipboard operation
redpanda copied to clipboard

redpanda: Deduplicate ACLs

Open andresaristizabal opened this issue 4 years ago • 4 comments

Right now when we send a request for creating ACL, Redpanda add ACL no matter if exist a previous ACL for the same service account (+ sourcename on topic and group).

example:

request 1: service-account1{topic(topic1): alter, read and write}
request 2: service-account1{topic(topic1): read and write}
list acl request: [service-account1{topic(topic1): alter, read and write}, service-account1{topic(topic1): read and write}]

we need that Redpanda only saves the last ACLs that we sent: expected behavior:

request 1: service-account1{topic(topic1): alter, read and write, cluster: alter-config}
request 2: service-account1{topic(topic1): read and write, cluster: read-config}
list acl request: [service-account1{topic(topic1): read and write, cluster: read-config}]

andresaristizabal avatar May 20 '21 13:05 andresaristizabal

@andresaristizabal I'm looking at the ACL implementation and we already have some deduplication. I'm wondering if in your example above alter and read and write are separate ACLs but alter implies read/write and so the duplication in this case is a UI issue. If you add the same ACL twice does it properly deduplicate?

dotnwat avatar May 26 '21 05:05 dotnwat

request 1: service-account1{topic(topic1): alter, read and write} <- this is 3 differents acl for same sourceName (topic1) and specifict service account

andresaristizabal avatar May 26 '21 15:05 andresaristizabal

let me add, the complete flow

andresaristizabal avatar May 26 '21 15:05 andresaristizabal

Oh, I tested again and now Redpanda doesn't allow create duplicate ACL (ServiceAccount+SourceName+permission), but I found another problem related to "update" the ACL. when I send: request 1: service-account1, acls: { sourceName: topic(topic1), permissions: [alter, read and write]} it works fine, but when I send request 2: service-account1, acls: { sourceName: topic(topic1), permissions: [read]} this responses :+1: but when I list the ACL, I see the previous permissions: [alter, read and write] and I expected to receive: [read].

andresaristizabal avatar May 26 '21 18:05 andresaristizabal

ACLs are additive, not complete replacements -- closing as working as intended

twmb avatar Apr 18 '23 02:04 twmb