You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/manage/pages/schema-reg/schema-reg-authorization.adoc
+257Lines changed: 257 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,212 @@ Not all Kafka operations are supported when using Redpanda Schema Registry ACLs.
196
196
197
197
For additional guidance on these operations, see the link:/api/doc/schema-registry/operation/operation-get_security_acls[Redpanda Schema Registry API].
198
198
199
+
=== Operation definitions
200
+
201
+
You can use the following operations to control access to Schema Registry resources:
202
+
203
+
* **`read`**: Allows user to read schemas and their content. Required for consuming messages that use Schema Registry, fetching specific schema versions, and reading schema content by ID.
204
+
* **`write`**: Allows user to register new schemas and schema versions. Required for producing messages with new schemas and updating existing subjects with new schema versions.
205
+
* **`delete`**: Allows user to delete schema versions and subjects. Required for cleanup operations and removing deprecated schemas.
206
+
* **`describe`**: Allows user to list and describe Schema Registry resources. Required for discovering available subjects, listing schema versions, and viewing metadata.
207
+
* **`describe_configs`**: Allows user to read configuration settings. Required for viewing compatibility settings, reading modes (IMPORT/READWRITE), and checking global or per-subject configurations.
208
+
* **`alter_configs`**: Allows user to modify configuration settings. Required for changing compatibility levels, setting IMPORT mode for migrations, and updating global or per-subject configurations.
209
+
210
+
=== Common use cases
211
+
212
+
The following examples show which operations are required for common Schema Registry tasks:
213
+
214
+
==== Schema Registry migration
215
+
216
+
When migrating schemas between clusters, you must have **different ACLs for source and target clusters**.
217
+
218
+
**Source cluster (read-only):**
219
+
220
+
[,bash]
221
+
----
222
+
# Read schemas from source Schema Registry
223
+
rpk security acl create \
224
+
--allow-principal User:migrator-user \
225
+
--operation read,describe \
226
+
--registry-global \
227
+
--brokers <source-brokers>
228
+
----
229
+
230
+
This grants:
231
+
232
+
* `read` - Read schemas by ID from source
233
+
* `describe` - List all subjects in source
234
+
235
+
[NOTE]
236
+
====
237
+
The `describe_configs` operation is required to read Schema Registry configuration settings, including compatibility modes and IMPORT mode status.
238
+
====
239
+
240
+
**Target cluster (read-write):**
241
+
242
+
[,bash]
243
+
----
244
+
# Write schemas to target Schema Registry and manage IMPORT mode
See xref:manage:security/authorization/acl.adoc[Configure Access Control Lists] for Kafka ACL configuration.
268
+
====
269
+
270
+
[NOTE]
271
+
====
272
+
The target Schema Registry must be in IMPORT mode to preserve schema IDs during migration. Only superusers or principals with `alter_configs` permission on the `registry` resource can change the global mode.
273
+
ifndef::env-cloud[]
274
+
See xref:manage:schema-reg/schema-reg-api.adoc#set-global-mode[Set global mode].
275
+
endif::[]
276
+
ifdef::env-cloud[]
277
+
See xref:schema-reg:schema-reg-api.adoc#set-global-mode[Set global mode].
278
+
endif::[]
279
+
====
280
+
281
+
==== Complete migration setup workflow
282
+
283
+
For a complete migration setup, follow this workflow:
284
+
285
+
1. **Bootstrap superusers** - Configure superusers using `.bootstrap.yaml` before enabling authentication
286
+
2. **Create migration user** - Create dedicated migration user with minimal required permissions
287
+
3. **Configure Schema Registry ACLs** - Grant read access on source, read-write access on target
288
+
4. **Configure Kafka ACLs** - Grant topic read/write, consumer group, and cluster permissions
289
+
5. **Enable SASL authentication** - Enable SASL/SCRAM-SHA-256 on both clusters
290
+
6. **Enable ACL authorization** - Enable `kafka_enable_authorization` and `schema_registry_enable_authorization`
291
+
7. **Set target to IMPORT mode** - Enable IMPORT mode on target Schema Registry
292
+
8. **Start migration** - Begin data and schema migration
293
+
9. **Verify ACLs** - Test that permissions work correctly and restrictions are enforced
294
+
10. **Complete migration** - Disable IMPORT mode after migration completes
295
+
296
+
For a complete working example with Docker Compose, see the https://github.com/redpanda-data/redpanda-labs/tree/main/docker-compose/redpanda-migrator-demo[Redpanda Migrator Demo].
297
+
298
+
[NOTE]
299
+
====
300
+
**Schema Registry Internal Client Authentication:** When SASL authentication is enabled on your Kafka cluster, the Schema Registry's internal Kafka client must also be configured with SASL credentials. Configure these using node-level properties:
Without these credentials, Schema Registry operations that interact with Kafka (like storing schema data) will fail with "broker_not_available" errors.
310
+
====
311
+
312
+
==== Read-only access for consumers
313
+
314
+
Applications that only consume messages with schemas require:
315
+
316
+
[,bash]
317
+
----
318
+
# For consuming with schema validation
319
+
rpk security acl create \
320
+
--allow-principal consumer-app \
321
+
--operation read \
322
+
--registry-subject "orders-*" \
323
+
--resource-pattern-type prefixed
324
+
----
325
+
326
+
This allows:
327
+
328
+
* Reading schema content by ID (embedded in messages)
329
+
* Viewing specific schema versions
330
+
331
+
This does _not_ allow listing all subjects or modifying schemas.
332
+
333
+
==== Producer access
334
+
335
+
Applications that produce messages with schemas require:
336
+
337
+
[,bash]
338
+
----
339
+
# For producing with new schemas
340
+
rpk security acl create \
341
+
--allow-principal producer-app \
342
+
--operation read,write,describe \
343
+
--registry-subject "orders-*" \
344
+
--resource-pattern-type prefixed
345
+
----
346
+
347
+
This allows:
348
+
349
+
* Checking if schemas already exist (`describe`)
350
+
* Reading existing schema versions (`read`)
351
+
* Registering new schema versions (`write`)
352
+
353
+
==== Schema administrator access
354
+
355
+
Schema administrators who manage compatibility and cleanup require:
356
+
357
+
[,bash]
358
+
----
359
+
# For full schema management
360
+
rpk security acl create \
361
+
--allow-principal schema-admin \
362
+
--operation all \
363
+
--registry-global
364
+
----
365
+
366
+
This grants all operations, including:
367
+
368
+
* Managing compatibility settings
369
+
* Deleting deprecated schemas
370
+
* Viewing and modifying configurations
371
+
* Listing all subjects and schemas
372
+
373
+
=== Pattern-based ACLs for Schema Registry
374
+
375
+
When using subject name patterns (like `orders-*`), always specify `--resource-pattern-type prefixed`:
376
+
377
+
[,bash]
378
+
----
379
+
# Correct - matches all subjects starting with "orders-"
380
+
rpk security acl create \
381
+
--allow-principal User:app \
382
+
--operation read \
383
+
--registry-subject "orders-" \
384
+
--resource-pattern-type prefixed
385
+
386
+
# Incorrect - treats "orders-*" as literal subject name
387
+
rpk security acl create \
388
+
--allow-principal User:app \
389
+
--operation read \
390
+
--registry-subject "orders-*"
391
+
----
392
+
393
+
Pattern types:
394
+
395
+
* **`prefixed`** - Matches subjects starting with the specified string (for example, `orders-` matches `orders-value`, `orders-key`)
396
+
* **`literal`** - Matches exact subject name only (default if not specified)
397
+
398
+
[TIP]
399
+
====
400
+
Redpanda recommends using the topic naming strategy where subjects follow the pattern `<topicName>-key` or `<topicName>-value`. With this strategy, you can use a single prefixed ACL to grant access to both key and value subjects for a topic.
401
+
402
+
Example: `--registry-subject "orders-" --resource-pattern-type prefixed` grants access to both `orders-key` and `orders-value` subjects.
When using the `--registry-global` option, be aware that `REGISTRY` resource types are global and apply to all of Schema Registry. They do not have a resource name because they are not tied to a specific resource. There are no resource names missing here.
These are Schema Registry ACLs only. You also require Kafka ACLs for topics, consumer groups, and cluster operations. See xref:manage:security/authorization/acl.adoc[Configure Access Control Lists].
0 commit comments