Skip to content

Commit

Permalink
add(kafka): commands for managing native ACLs
Browse files Browse the repository at this point in the history
  • Loading branch information
biggusdonzus committed Dec 2, 2024
1 parent c5ee83d commit 45d32f4
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/tools/cli/service-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ More information on `integration-delete`, `integration-endpoint-create`,
can be found in
[the dedicated page](service/integration).

### `avn service kafka-acl`

Manages the Apache Kafka® native ACL entries.

More information on `kafka-acl-add`, `kafka-acl-delete` and `kafka-acl-list` can be found
in [the dedicated page](service/kafka-acl).

### `avn service keypair get`

Service keypair commands. The use cases for this command are limited to
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/cli/service/acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Lists Aiven for Apache Kafka® ACL entries.
avn service acl-list kafka-doc
```

An example of `account service acl-list` output:
An example of `avn service acl-list` output:

```text
ID USERNAME TOPIC PERMISSION
Expand Down
71 changes: 71 additions & 0 deletions docs/tools/cli/service/kafka-acl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: avn service kafka-acl
---

Full list of commands for `avn service kafka-acl`.

## Manage Apache Kafka® native access control lists

Commands for managing Apache Kafka® native ACLs via `avn` commands.

### `avn service kafka-acl-add`

Adds an Apache Kafka® native ACL entry.

| Parameter | Information |
| ------------------------- | ------------------------------------------------------------------------------- |
| `service_name` | The name of the service |
| `--principal` | The principal for the ACLs, must be in the form User:name |
| `--topic` | Topic resource type to which ACL should be added |
| `--group` | Group resource type to which ACL should be added |
| `--cluster` | The ACL is applied to the clusger resource |
| `--transactional-id` | TransactionalId resource type to which ACL should be added |
| `--operation` | The operation type: possible values are `Describe`,`DescribeConfigs`,<br/>`Alter`,`IdempotentWrite`,`Read`,`Delete`,`Create`,`ClusterAction`,<br/>`All`,`Write`,`AlterConfigs`,`CreateTokens`,`DescribeTokens` |
| `--host` | The host for the ACLs, a value of '*' matches all hosts (default: *) |
| `--resource-pattern-type` | The type of the resource pattern, can be LITERAL or PREFIXED (default: LITERAL) |
! `--deny` | Create a DENY rule (default is ALLOW) |

**Example:** Add an ACLs for user `userA` to `Read` on topics having name starting
with `topic2020` in the service `kafka-doc`.

```
avn service kafka-acl-add kafka-doc --principal User:userA --operation Read --topic topic2020 --resource-pattern-type PREFIXED
```

### `avn service kafka-acl-delete`

Deletes an Apache Kafka® native ACL entry.

| Parameter | Information |
| -------------- | --------------------------- |
| `service_name` | The name of the service |
| `acl_id` | The id of the ACL to delete |

**Example:** Delete the native ACL with id `acl3604f96c74a` on service named `kafka-doc`.

```
avn service kafka-acl-delete kafka-doc acl3604f96c74a
```

### `avn service kafka-acl-list`

Lists Apache Kafka® native ACL entries.

| Parameter | Information |
| -------------- | ----------------------- |
| `service_name` | The name of the service |

**Example:** List the ACLs defined for a service named `kafka-doc`.

```
avn service kafka-acl-list kafka-doc
```

An example of `avn service kafka-acl-list` output:

```text
ID PERMISSION_TYPE PRINCIPAL OPERATION RESOURCE_TYPE PATTERN_TYPE RESOURCE_NAME HOST
============== =============== ========== ========= ============= ============ ============= ====
acl4f9ed69c8aa ALLOW User:John Write Topic LITERAL orders *
acl4f9ed6e6371 ALLOW User:Frida Write Topic PREFIXED invoices *
```
1 change: 1 addition & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ const sidebars: SidebarsConfig = {
'tools/cli/service/es-acl',
'tools/cli/service/flink',
'tools/cli/service/integration',
'tools/cli/service/kafka-acl',
'tools/cli/service/m3',
'tools/cli/service/privatelink',
'tools/cli/service/schema-registry-acl',
Expand Down

0 comments on commit 45d32f4

Please sign in to comment.