Skip to content

Sync Kafka ACLs between clusters

Grant what is missing, revoke what should not be there, and keep a way back.

Terminal recording of kurkik kafka sync

The recording shows kurkik kafka sync on the demo sandbox; its data differs from this example.

Shown here: one broker. Other broker setups are further down.

Nothing changes yet. --dry-run only shows what would happen.

$ kurkik kafka sync a.yaml b --acls --revoke --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (12)
+ grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
The cluster also holds DENY User:analytics READ on TOPIC customers.updated, and Kafka checks DENY first: until it is revoked (--revoke, when the document does not declare it) this grant changes nothing.
+ grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
+ grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
+ grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
+ grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
- revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set) [revokes access]
User:auditor loses DESCRIBE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set) [revokes access]
User:billing loses READ on customers.updated; a client relying on it fails from then on.
- revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set) [revokes access]
User:ops loses WRITE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set) [revokes access]
User:orders-service loses WRITE on orders.; a client relying on it fails from then on.
- revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set) [revokes access]
User:reporting loses DESCRIBE on reporting; a client relying on it fails from then on.
- revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set) [revokes access]
User:analytics loses READ on customers.updated; a client relying on it fails from then on.
left alone (9)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided orders.created groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
cannot change ALLOW User:admin ALTER on CLUSTER kafka-cluster acl
ALLOW User:admin ALTER on CLUSTER kafka-cluster is about the cluster itself - who may administer it - not about a service's topics or groups. sync does not grant it; kafka-acls --add --cluster does, if it belongs here.
and 2 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER on CLUSTER
12 changes, 6 destroy - 1 still differs
rehearsal
[?] not attempted grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set)
not rehearsed: Kafka has no validate-only ACL change
The cluster would accept every request it was shown. 12 could not be rehearsed - Kafka has no validate-only deletion or ACL change, and a schema registry no validate-only write. Nothing was changed.
exit 2
$ kurkik kafka sync a.yaml b --acls --revoke --yes
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (12)
+ grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
The cluster also holds DENY User:analytics READ on TOPIC customers.updated, and Kafka checks DENY first: until it is revoked (--revoke, when the document does not declare it) this grant changes nothing.
+ grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
+ grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
+ grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
+ grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
- revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set) [revokes access]
User:auditor loses DESCRIBE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set) [revokes access]
User:billing loses READ on customers.updated; a client relying on it fails from then on.
- revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set) [revokes access]
User:ops loses WRITE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set) [revokes access]
User:orders-service loses WRITE on orders.; a client relying on it fails from then on.
- revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set) [revokes access]
User:reporting loses DESCRIBE on reporting; a client relying on it fails from then on.
- revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set) [revokes access]
User:analytics loses READ on customers.updated; a client relying on it fails from then on.
left alone (9)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided orders.created groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
cannot change ALLOW User:admin ALTER on CLUSTER kafka-cluster acl
ALLOW User:admin ALTER on CLUSTER kafka-cluster is about the cluster itself - who may administer it - not about a service's topics or groups. sync does not grant it; kafka-acls --add --cluster does, if it belongs here.
and 2 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER on CLUSTER
12 changes, 6 destroy - 1 still differs
applied
[+] done grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
[+] done grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
[+] done grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
[+] done grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
[+] done grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
[+] done grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
[+] done revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set)
[+] done revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set)
[+] done revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set)
[+] done revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set)
[+] done revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set)
[+] done revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set)
Applied 12 of 12 changes - 9 left alone
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 2

Written before the first change.

rollback.yaml
system: "Apache Kafka"
target: "MkU3OEVBNTcwNTJENDM2Qk"
createdAt: "<time>"
document: "~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml"
entries:
- forAction: "grant-access:ALLOW User:reporting READ on GROUP reporting:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:reporting READ on GROUP reporting"
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "*"
name: "reporting"
operation: "READ"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:reporting"
resourceType: "GROUP"
- forAction: "grant-access:ALLOW User:analytics READ on TOPIC customers.updated:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:analytics READ on TOPIC customers.updated"
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "*"
name: "customers.updated"
operation: "READ"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:analytics"
resourceType: "TOPIC"
- forAction: "grant-access:ALLOW User:audit DESCRIBE on TOPIC orders.created:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:audit DESCRIBE on TOPIC orders.created"
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "*"
name: "orders.created"
operation: "DESCRIBE"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:audit"
resourceType: "TOPIC"
- forAction: "grant-access:ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1"
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "10.0.0.1"
name: "orders.created"
operation: "WRITE"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:ops"
resourceType: "TOPIC"
- forAction: "grant-access:ALLOW User:billing READ on TOPIC payments.settled:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:billing READ on TOPIC payments.settled"
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "*"
name: "payments.settled"
operation: "READ"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:billing"
resourceType: "TOPIC"
- forAction: "grant-access:ALLOW User:orders-service WRITE on TOPIC prefix orders.:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:orders-service WRITE on TOPIC prefix orders."
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "*"
name: "orders."
operation: "WRITE"
patternType: "PREFIXED"
permission: "ALLOW"
principal: "User:orders-service"
resourceType: "TOPIC"
- forAction: "revoke-access:ALLOW User:auditor DESCRIBE on TOPIC orders.created:acl"
undo: "RESTORE_ACCESS"
target: "ALLOW User:auditor DESCRIBE on TOPIC orders.created"
field: "acl"
preState:
value: "ALLOW User:auditor DESCRIBE on TOPIC orders.created"
override: true
definition:
host: "*"
name: "orders.created"
operation: "DESCRIBE"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:auditor"
resourceType: "TOPIC"
- forAction: "revoke-access:ALLOW User:billing READ on TOPIC customers.updated:acl"
undo: "RESTORE_ACCESS"
target: "ALLOW User:billing READ on TOPIC customers.updated"
field: "acl"
preState:
value: "ALLOW User:billing READ on TOPIC customers.updated"
override: true
definition:
host: "*"
name: "customers.updated"
operation: "READ"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:billing"
resourceType: "TOPIC"
- forAction: "revoke-access:ALLOW User:ops WRITE on TOPIC orders.created:acl"
undo: "RESTORE_ACCESS"
target: "ALLOW User:ops WRITE on TOPIC orders.created"
field: "acl"
preState:
value: "ALLOW User:ops WRITE on TOPIC orders.created"
override: true
definition:
host: "*"
name: "orders.created"
operation: "WRITE"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:ops"
resourceType: "TOPIC"
- forAction: "revoke-access:ALLOW User:orders-service WRITE on TOPIC orders.:acl"
undo: "RESTORE_ACCESS"
target: "ALLOW User:orders-service WRITE on TOPIC orders."
field: "acl"
preState:
value: "ALLOW User:orders-service WRITE on TOPIC orders."
override: true
definition:
host: "*"
name: "orders."
operation: "WRITE"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:orders-service"
resourceType: "TOPIC"
- forAction: "revoke-access:ALLOW User:reporting DESCRIBE on GROUP reporting:acl"
undo: "RESTORE_ACCESS"
target: "ALLOW User:reporting DESCRIBE on GROUP reporting"
field: "acl"
preState:
value: "ALLOW User:reporting DESCRIBE on GROUP reporting"
override: true
definition:
host: "*"
name: "reporting"
operation: "DESCRIBE"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:reporting"
resourceType: "GROUP"
- forAction: "revoke-access:DENY User:analytics READ on TOPIC customers.updated:acl"
undo: "RESTORE_ACCESS"
target: "DENY User:analytics READ on TOPIC customers.updated"
field: "acl"
preState:
value: "DENY User:analytics READ on TOPIC customers.updated"
override: true
definition:
host: "*"
name: "customers.updated"
operation: "READ"
patternType: "LITERAL"
permission: "DENY"
principal: "User:analytics"
resourceType: "TOPIC"

Download rollback.yaml

$ kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes
Revert b to b-<time>.snapshot.yaml - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: what the run being undone changed, as its rollback records it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (12)
+ grant DENY User:analytics READ on TOPIC customers.updated acl
+ grant ALLOW User:reporting DESCRIBE on GROUP reporting acl
+ grant ALLOW User:orders-service WRITE on TOPIC orders. acl
+ grant ALLOW User:ops WRITE on TOPIC orders.created acl
+ grant ALLOW User:billing READ on TOPIC customers.updated acl
+ grant ALLOW User:auditor DESCRIBE on TOPIC orders.created acl
- revoke ALLOW User:orders-service WRITE on TOPIC prefix orders. acl [revokes access]
User:orders-service loses what sync granted it; a client that has started relying on it fails.
- revoke ALLOW User:billing READ on TOPIC payments.settled acl [revokes access]
User:billing loses what sync granted it; a client that has started relying on it fails.
- revoke ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl [revokes access]
User:ops loses what sync granted it; a client that has started relying on it fails.
- revoke ALLOW User:audit DESCRIBE on TOPIC orders.created acl [revokes access]
User:audit loses what sync granted it; a client that has started relying on it fails.
- revoke ALLOW User:analytics READ on TOPIC customers.updated acl [revokes access]
User:analytics loses what sync granted it; a client that has started relying on it fails.
- revoke ALLOW User:reporting READ on GROUP reporting acl [revokes access]
User:reporting loses what sync granted it; a client that has started relying on it fails.
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER on CLUSTER
12 changes, 6 destroy
applied
[+] done grant DENY User:analytics READ on TOPIC customers.updated acl
[+] done grant ALLOW User:reporting DESCRIBE on GROUP reporting acl
[+] done grant ALLOW User:orders-service WRITE on TOPIC orders. acl
[+] done grant ALLOW User:ops WRITE on TOPIC orders.created acl
[+] done grant ALLOW User:billing READ on TOPIC customers.updated acl
[+] done grant ALLOW User:auditor DESCRIBE on TOPIC orders.created acl
[+] done revoke ALLOW User:orders-service WRITE on TOPIC prefix orders. acl
[+] done revoke ALLOW User:billing READ on TOPIC payments.settled acl
[+] done revoke ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl
[+] done revoke ALLOW User:audit DESCRIBE on TOPIC orders.created acl
[+] done revoke ALLOW User:analytics READ on TOPIC customers.updated acl
[+] done revoke ALLOW User:reporting READ on GROUP reporting acl
Applied 12 of 12 changes
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 0

After the revert, compared with how it was before: Drift: 0 changed · 0 unmanaged · 0 missing (no drift) - 34 matched

source.yaml, 211 lines
asyncapi: 3.0.0
info:
title: a Apache Kafka API
version: 1.0.0-SNAPSHOT
description: "Generated by reading the a cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk."
servers:
broker-1:
host: a-kafka-1:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
acl:
- principal: User:admin
host: '*'
operation: ALTER
permission: ALLOW
resourceType: CLUSTER
patternType: LITERAL
name: kafka-cluster
- principal: User:reporting
host: '*'
operation: READ
permission: ALLOW
resourceType: GROUP
patternType: LITERAL
name: reporting
- principal: User:analytics
host: '*'
operation: READ
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: customers.updated
- principal: User:audit
host: '*'
operation: DESCRIBE
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: orders.created
- principal: User:billing
host: '*'
operation: READ
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: orders.created
- principal: User:ops
host: 10.0.0.1
operation: WRITE
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: orders.created
- principal: User:billing
host: '*'
operation: READ
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: payments.settled
- principal: User:orders-service
host: '*'
operation: WRITE
permission: ALLOW
resourceType: TOPIC
patternType: PREFIXED
name: orders.
groups: []
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-1:19092,EXTERNAL://a-kafka-1:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "1"
controller.listener.names: CONTROLLER
controller.quorum.voters: 1@kafka-1:9093
group.initial.rebalance.delay.ms: "0"
inter.broker.listener.name: INTERNAL
listener.security.protocol.map: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT"
listeners: "INTERNAL://0.0.0.0:19092,EXTERNAL://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093"
min.insync.replicas: "1"
node.id: "1"
offsets.topic.replication.factor: "1"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "1"
clientConfiguration:
bootstrap.servers: a-kafka-1:9092
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
channels:
customers.updated:
address: customers.updated
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
topicConfiguration:
cleanup.policy:
- compact
x-kurkik:
kafka:
channel:
topic: customers.updated
partitions: 3
replicas: 1
topicConfiguration:
cleanup.policy: compact
orders.created:
address: orders.created
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
topicConfiguration:
retention.ms: 604800000
x-kurkik:
kafka:
channel:
topic: orders.created
partitions: 3
replicas: 1
topicConfiguration:
retention.ms: "604800000"
payments.settled:
address: payments.settled
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
x-kurkik:
kafka:
channel:
topic: payments.settled
partitions: 3
replicas: 1
topicConfiguration:
min.insync.replicas: "1"
retention.bytes: "10737418240"
operations:
receive_customers.updated:
action: receive
channel:
$ref: "#/channels/customers.updated"
x-kurkik:
kafka:
operation:
security:
- User:analytics
consumerConfiguration: {}
groupConfiguration: {}
receive_orders.created:
action: receive
channel:
$ref: "#/channels/orders.created"
x-kurkik:
kafka:
operation:
security:
- User:billing
consumerConfiguration: {}
groupConfiguration: {}
receive_payments.settled:
action: receive
channel:
$ref: "#/channels/payments.settled"
x-kurkik:
kafka:
operation:
security:
- User:billing
consumerConfiguration: {}
groupConfiguration: {}
send_customers.updated:
action: send
channel:
$ref: "#/channels/customers.updated"
x-kurkik:
kafka:
operation:
security: []
producerConfiguration: {}
send_orders.created:
action: send
channel:
$ref: "#/channels/orders.created"
x-kurkik:
kafka:
operation:
security:
- User:ops
- User:orders-service
producerConfiguration: {}
send_payments.settled:
action: send
channel:
$ref: "#/channels/payments.settled"
x-kurkik:
kafka:
operation:
security: []
producerConfiguration: {}

Download source.yaml

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 1 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 1 --config cleanup.policy=compact
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:analytics --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:audit --operation Describe --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic payments.settled
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:ops --allow-host 10.0.0.1 --operation Write --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:orders-service --operation Write --topic orders. --resource-pattern-type prefixed
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:reporting --operation Read --group reporting
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:admin --operation Alter --cluster

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 1 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 1 --config cleanup.policy=compact
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --deny-principal User:analytics --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:auditor --operation Describe --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:ops --operation Write --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:orders-service --operation Write --topic orders.
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:reporting --operation Describe --group reporting

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092
kurkik conn add kafka b --bootstrap b-kafka-1:9092
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --acls --revoke --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --acls --revoke --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt
Show the plan
$ kurkik kafka sync a.yaml b --acls --revoke --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (12)
+ grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
The cluster also holds DENY User:analytics READ on TOPIC customers.updated, and Kafka checks DENY first: until it is revoked (--revoke, when the document does not declare it) this grant changes nothing.
+ grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
+ grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
+ grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
+ grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
- revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set) [revokes access]
User:auditor loses DESCRIBE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set) [revokes access]
User:billing loses READ on customers.updated; a client relying on it fails from then on.
- revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set) [revokes access]
User:ops loses WRITE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set) [revokes access]
User:orders-service loses WRITE on orders.; a client relying on it fails from then on.
- revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set) [revokes access]
User:reporting loses DESCRIBE on reporting; a client relying on it fails from then on.
- revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set) [revokes access]
User:analytics loses READ on customers.updated; a client relying on it fails from then on.
left alone (13)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided orders.created groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
cannot change ALLOW User:admin ALTER on CLUSTER kafka-cluster acl
ALLOW User:admin ALTER on CLUSTER kafka-cluster is about the cluster itself - who may administer it - not about a service's topics or groups. sync does not grant it; kafka-acls --add --cluster does, if it belongs here.
and 6 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER on CLUSTER
12 changes, 6 destroy - 1 still differs
rehearsal
[?] not attempted grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set)
not rehearsed: Kafka has no validate-only ACL change
The cluster would accept every request it was shown. 12 could not be rehearsed - Kafka has no validate-only deletion or ACL change, and a schema registry no validate-only write. Nothing was changed.
exit 2

Download

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 3 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 3 --config cleanup.policy=compact
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:analytics --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:audit --operation Describe --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic payments.settled
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:ops --allow-host 10.0.0.1 --operation Write --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:orders-service --operation Write --topic orders. --resource-pattern-type prefixed
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:reporting --operation Read --group reporting
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:admin --operation Alter --cluster

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 3 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 3 --config cleanup.policy=compact
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --deny-principal User:analytics --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:auditor --operation Describe --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:ops --operation Write --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:orders-service --operation Write --topic orders.
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:reporting --operation Describe --group reporting

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092
kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --acls --revoke --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --acls --revoke --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt
Show the plan
$ kurkik kafka sync a.yaml b --acls --revoke --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (12)
+ grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
The cluster also holds DENY User:analytics READ on TOPIC customers.updated, and Kafka checks DENY first: until it is revoked (--revoke, when the document does not declare it) this grant changes nothing.
+ grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
+ grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
+ grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
+ grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
- revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set) [revokes access]
User:auditor loses DESCRIBE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set) [revokes access]
User:billing loses READ on customers.updated; a client relying on it fails from then on.
- revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set) [revokes access]
User:ops loses WRITE on orders.created; a client relying on it fails from then on.
- revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set) [revokes access]
User:orders-service loses WRITE on orders.; a client relying on it fails from then on.
- revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set) [revokes access]
User:reporting loses DESCRIBE on reporting; a client relying on it fails from then on.
- revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set) [revokes access]
User:analytics loses READ on customers.updated; a client relying on it fails from then on.
left alone (13)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided orders.created groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
cannot change ALLOW User:admin ALTER on CLUSTER kafka-cluster acl
ALLOW User:admin ALTER on CLUSTER kafka-cluster is about the cluster itself - who may administer it - not about a service's topics or groups. sync does not grant it; kafka-acls --add --cluster does, if it belongs here.
and 6 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER on CLUSTER
12 changes, 6 destroy - 1 still differs
rehearsal
[?] not attempted grant ALLOW User:reporting READ on GROUP reporting acl (not set) -> ALLOW User:reporting READ on GROUP reporting
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:audit DESCRIBE on TOPIC orders.created acl (not set) -> ALLOW User:audit DESCRIBE on TOPIC orders.created
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1 acl (not set) -> ALLOW User:ops WRITE on TOPIC orders.created from 10.0.0.1
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:billing READ on TOPIC payments.settled acl (not set) -> ALLOW User:billing READ on TOPIC payments.settled
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted grant ALLOW User:orders-service WRITE on TOPIC prefix orders. acl (not set) -> ALLOW User:orders-service WRITE on TOPIC prefix orders.
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:auditor DESCRIBE on TOPIC orders.created acl ALLOW User:auditor DESCRIBE on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:billing READ on TOPIC customers.updated acl ALLOW User:billing READ on TOPIC customers.updated -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:ops WRITE on TOPIC orders.created acl ALLOW User:ops WRITE on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:orders-service WRITE on TOPIC orders. acl ALLOW User:orders-service WRITE on TOPIC orders. -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke ALLOW User:reporting DESCRIBE on GROUP reporting acl ALLOW User:reporting DESCRIBE on GROUP reporting -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted revoke DENY User:analytics READ on TOPIC customers.updated acl DENY User:analytics READ on TOPIC customers.updated -> (not set)
not rehearsed: Kafka has no validate-only ACL change
The cluster would accept every request it was shown. 12 could not be rehearsed - Kafka has no validate-only deletion or ACL change, and a schema registry no validate-only write. Nothing was changed.
exit 2

Download

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --replica-assignment 1:3 --config cleanup.policy=compact
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:analytics --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:audit --operation Describe --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic payments.settled
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:ops --allow-host 10.0.0.1 --operation Write --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:orders-service --operation Write --topic orders. --resource-pattern-type prefixed
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:reporting --operation Read --group reporting
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:admin --operation Alter --cluster

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic customers.updated --replica-assignment 1:3 --config cleanup.policy=compact
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --deny-principal User:analytics --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:auditor --operation Describe --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic customers.updated
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:ops --operation Write --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:orders-service --operation Write --topic orders.
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:reporting --operation Describe --group reporting

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092
kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --acls --revoke --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --acls --revoke --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

All flags: kurkik kafka sync · more Apache Kafka sync examples