Skip to content

Commit 9fbb3e9

Browse files
Feediver1coderabbitai[bot]micheleRP
authored
DOC-1550 Unresolved Schema Registry AuthZ issues (#1332)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: micheleRP <michele@redpanda.com>
1 parent a851c8d commit 9fbb3e9

2 files changed

Lines changed: 80 additions & 43 deletions

File tree

modules/manage/pages/schema-reg/schema-reg-authorization.adoc

Lines changed: 78 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ Starting in v25.2, Schema Registry Authorization provides fine-grained access co
2323

2424
=== How to manage Schema Registry Authorization
2525

26-
You can manage Schema Registry Authorization in two ways:
26+
You can manage Schema Registry Authorization in the following ways:
2727

28-
- **Using rpk**: Use the xref:reference:rpk/rpk-security/rpk-security-acl-create.adoc[`rpk security acl create`] command, just like you would for other Kafka ACLs.
29-
- **Using the API**: Use the link:/api/doc/schema-registry/operation/operation-get_security_acls[Redpanda Schema Registry API] endpoints.
28+
- **rpk**: Use the xref:reference:rpk/rpk-security/rpk-security-acl-create.adoc[`rpk security acl create`] command, just like you would for other Kafka ACLs.
29+
- **Schema Registry API**: Use the link:/api/doc/schema-registry/operation/operation-get_security_acls[Redpanda Schema Registry API] endpoints.
30+
ifndef::env-cloud[]
31+
- **{ui}**: After enabling Schema Registry Authorization for your cluster, you can use {ui} to manage Schema Registry ACLs. See xref:manage:security/authorization/acl.adoc[].
32+
endif::[]
33+
ifdef::env-cloud[]
34+
- **{ui}**: After enabling Schema Registry Authorization for your cluster, you can use {ui} to manage Schema Registry ACLs. See xref:security:/authorization/acl.adoc[].
35+
endif::[]
3036

3137
=== Schema Registry ACL resource types
3238

@@ -102,20 +108,20 @@ Not all Kafka operations are supported when using Redpanda Schema Registry ACLs.
102108
| none/open
103109
| -
104110

105-
| `/schema/ids/\{id}`
111+
| `/schemas/ids/\{id}`
106112
| `GET`
107113
| `read`
108114
| `subject`
109115

110-
| `/schema/ids/\{versions}`
116+
| `/schemas/ids/\{versions}`
111117
| `GET`
112118
| `describe`
113119
| `registry`
114120

115-
| `/schema/ids/\{subjects}`
121+
| `/schemas/ids/\{subjects}`
116122
| `GET`
117123
| `describe`
118-
| `subject`
124+
| `registry`
119125

120126
| `/subjects`
121127
| `GET`
@@ -124,7 +130,7 @@ Not all Kafka operations are supported when using Redpanda Schema Registry ACLs.
124130

125131
| `/subjects/\{subject}`
126132
| `POST`
127-
| `read`
133+
| `write`
128134
| `subject`
129135

130136
| `/subjects/\{subject}`
@@ -162,7 +168,7 @@ Not all Kafka operations are supported when using Redpanda Schema Registry ACLs.
162168
| `describe`
163169
| `registry`
164170

165-
| `compatibility/subjects/\{subject}/versions/\{version}`
171+
| `/compatibility/subjects/\{subject}/versions/\{version}`
166172
| `POST`
167173
| `read`
168174
| `subject`
@@ -197,11 +203,32 @@ For additional guidance on these operations, see the link:/api/doc/schema-regist
197203
Before you can enable Schema Registry Authorization, you must have:
198204

199205
ifndef::env-cloud[]
200-
* A valid Redpanda Enterprise license
206+
* A valid Redpanda Enterprise license.
207+
endif::[]
208+
209+
ifdef::env-cloud[]
210+
* `rpk` v25.2+ installed. For installation instructions, see xref:manage:rpk/rpk-install.adoc[rpk installation].
211+
endif::[]
212+
213+
ifndef::env-cloud[]
214+
* `rpk` v25.2+ installed. For installation instructions, see xref:get-started:rpk-install.adoc[rpk installation].
201215
endif::[]
202216

203-
* `rpk` v25.2+
204-
* Cluster administrator permissions to modify cluster configuration
217+
ifndef::env-cloud[]
218+
* Authentication enabled using `schema_registry_api.authn_method`, which specifies how clients must authenticate when accessing the Schema Registry API. See xref:reference:properties/broker-properties.adoc#schema-registry[Schema Registry broker properties].
219+
endif::[]
220+
221+
ifndef::env-cloud[]
222+
* If you have listeners configured for Schema Registry, ensure you xref:manage:security/authentication.adoc#basic-authentication[configure authentication] for them and that your configuration points to the correct Schema Registry address (correct scheme, host, and port) for the same cluster you are targeting with your Kafka brokers.
223+
endif::[]
224+
225+
* Cluster administrator permissions to modify cluster configurations.
226+
For example, to enable management of Schema Registry ACLs by the principal `schema_registry_admin`, run:
227+
228+
[,bash]
229+
----
230+
rpk security acl create --allow-principal schema_registry_admin --cluster --operation alter
231+
----
205232

206233
=== Enable authorization
207234

@@ -212,13 +239,6 @@ To enable Schema Registry Authorization for your cluster, run:
212239
rpk cluster config set schema_registry_enable_authorization true
213240
----
214241

215-
To enable management of Schema Registry ACLs by the principal `schema_registry_admin`, run:
216-
217-
[,bash]
218-
----
219-
rpk security acl create --allow-principal schema_registry_admin --cluster --operation alter
220-
----
221-
222242
For details, see xref:reference:properties/cluster-properties.adoc#schema_registry_enable_authorization[`schema_registry_enable_authorization`].
223243

224244
== Create and manage Schema Registry ACLs
@@ -287,7 +307,7 @@ rpk security acl create \
287307
--allow-role SoftwareEng
288308
289309
# You can add more ACLs to this role later
290-
rpk security acl create --allow-role "RedpandaRole:SoftwareEng" [additional-acl-flags]
310+
rpk security acl create --allow-role "SoftwareEng" [additional-acl-flags]
291311
----
292312

293313
After creating the role, assign it to users:
@@ -306,7 +326,7 @@ jane User
306326

307327
When creating ACLs that include Schema Registry subjects, you might encounter errors if the subject doesn't exist or if there are configuration issues.
308328

309-
==== Common error: Subject not found
329+
==== Subject not found
310330

311331
Sometimes an ACL for a Kafka topic is created successfully, but the Schema Registry subject ACL fails:
312332

@@ -349,31 +369,49 @@ User:alice * SUBJECT bar-value LITERAL READ
349369
User:alice * TOPIC bar LITERAL READ ALLOW
350370
----
351371

352-
The `Not found` error occurs in the request: `12:17:33.935 DEBUG sending request {"method": "POST", "URL: "http://127.0.0.1:8081/security/acls", "has_bearer": false,
353-
"has_basic_auth": false}`, meaning that the endpoint is not available (because you are using an older Redpanda version). You must upgrade to the current version of Redpanda.
372+
The `Not found` error occurs in the request: `12:17:33.935 DEBUG sending request {"method": "POST", "URL: "http://127.0.0.1:8081/security/acls", "has_bearer": false,
373+
"has_basic_auth": false}`. This typically means the endpoint is unavailable. Verify:
374+
* You're on Redpanda v25.2+.
375+
* `schema_registry_enable_authorization` is set to `true`.
376+
* Your rpk Schema Registry URL points to the correct host/scheme/port.
377+
Upgrade if needed and correct configuration before retrying.
354378

355-
ifndef::env-cloud[]
356-
This next error occurs when the user tries to create two ACLs, one for a topic and one for a registry-subject:
379+
==== Inconsistent listener configuration
380+
381+
This error occurs when the user tries to create an ACL for a principal:
357382

358-
[bash]
383+
[,bash]
384+
----
385+
rpk security acl create --allow-principal "superuser" --operation "all" --registry-global -v
386+
13:07:02.810 DEBUG opening connection to broker {"addr": "seed-036d6a67.d2hiu9c8ljef72usuu20.fmc.prd.cloud.redpanda.com:9092", "broker": "seed_0"}
387+
...
388+
13:07:03.304 DEBUG sending request {"method": "POST", "URL": "https://127.0.0.1:8080/security/acls", "has_bearer": false, "has_basic_auth": true}
389+
PRINCIPAL HOST RESOURCE-TYPE RESOURCE-NAME RESOURCE-PATTERN-TYPE OPERATION PERMISSION ERROR
390+
User:superuser * REGISTRY LITERAL ALL ALLOW unable to POST "https://127.0.0.1:8080/security/acls": Post "https://127.0.0.1:8080/security/acls": http: server gave HTTP response to HTTPS client
359391
----
360-
$ rpk security acl create --topic private --allow-principal mary --operation read --registry-subject private-key -v
361-
18:27:05.485 DEBUG opening connection to broker {"addr": "127.0.0.1:9092", "broker": "seed_0"}
362-
18:27:05.485 DEBUG connection opened to broker {"addr": "127.0.0.1:9092", "broker": "seed_0"}
363-
18:27:05.485 DEBUG issuing api versions request {"broker": "seed_0", "version": 4}
364-
18:27:05.485 DEBUG wrote ApiVersions v4 {"broker": "seed_0", "bytes_written": 31, "write_wait": "14.584µs", "time_to_write": "18.25µs", "err": null}
365-
18:27:05.487 DEBUG read ApiVersions v4 {"broker": "seed_0", "bytes_read": 331, "read_wait": "23.583µs", "time_to_read": "1.847542ms", "err": null}
366-
18:27:05.487 DEBUG connection initialized successfully {"addr": "127.0.0.1:9092", "broker": "seed_0"}
367-
18:27:05.487 DEBUG wrote CreateACLs v2 {"broker": "seed_0", "bytes_written": 45, "write_wait": "2.564792ms", "time_to_write": "8.75µs", "err": null}
368-
18:27:05.489 DEBUG read CreateACLs v2 {"broker": "seed_0", "bytes_read": 19, "read_wait": "20.042µs", "time_to_read": "1.465375ms", "err": null}
369-
18:27:05.489 DEBUG sending request {"method": "POST", "URL": "http://127.0.0.1:8081/security/acls", "has_bearer": false, "has_basic_auth": false}
392+
393+
When using Schema Registry Authorization, ensure that your Kafka brokers and Schema Registry address target the same cluster and that the Schema Registry address uses the correct scheme/host/port. In the example above, `rpk` communicates with a remote broker (`...:9092`) but posts to a local Schema Registry address over HTTPS (`https://127.0.0.1:8080/security/acls`), while the local Schema Registry appears to be HTTP-only. To align them:
394+
* Set the correct Schema Registry address (host and scheme) for the target cluster.
395+
* Ensure TLS settings match the Schema Registry endpoint (HTTP vs HTTPS).
396+
* Avoid mixing remote broker addresses with a local Schema Registry address unless it is intentional and properly configured.
397+
398+
See xref:reference:rpk/rpk-registry/rpk-registry.adoc[rpk registry] for Schema Registry configuration commands.
399+
400+
==== Resource names do not appear
401+
402+
The following output appears to suggest that there are missing resource names for the registry resource types:
403+
404+
[,bash]
405+
----
406+
rpk security acl create --allow-principal jane --operation read,write --topic private --registry-global
370407
PRINCIPAL HOST RESOURCE-TYPE RESOURCE-NAME RESOURCE-PATTERN-TYPE OPERATION PERMISSION ERROR
371-
User:mary * SUBJECT private-key LITERAL READ ALLOW Invalid license: not present
372-
User:mary * TOPIC private LITERAL READ ALLOW
408+
User:jane * REGISTRY LITERAL READ ALLOW
409+
User:jane * REGISTRY LITERAL WRITE ALLOW
410+
User:jane * TOPIC private LITERAL READ ALLOW
411+
User:jane * TOPIC private LITERAL WRITE ALLOW
373412
----
374413

375-
The `Invalid license: not present` error indicates that the user is trying to create an ACL for a resource that requires a license, but no license is present. See xref:get-started:licensing/overview.adoc[Licensing overview] for details on how to obtain a license.
376-
endif::[]
414+
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.
377415

378416
== Suggested reading
379417

modules/reference/pages/properties/cluster-properties.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5687,9 +5687,6 @@ Always normalize schemas. If set, this overrides the `normalize` parameter in re
56875687
Enables ACL-based authorization for Schema Registry requests. When `true`, Schema Registry
56885688
uses ACL-based authorization instead of the default `public/user/superuser` authorization model.
56895689

5690-
ifndef::env-cloud[]
5691-
Requires authentication to be enabled using the xref:reference:properties/broker-properties.adoc#schema_registry_auth_method[`authentication_method`] property in the `schema_registry_api` broker configuration.
5692-
endif::[]
56935690
ifdef::env-cloud[]
56945691
Requires authentication to be enabled using the `authentication_method` property in the `schema_registry_api` broker configuration.
56955692
endif::[]
@@ -5700,7 +5697,9 @@ endif::[]
57005697

57015698
*Type:* boolean
57025699

5700+
ifndef::env-cloud[]
57035701
*Enterprise license required:* `true`
5702+
endif::[]
57045703

57055704
*Default:* `false`
57065705

0 commit comments

Comments
 (0)