{"id":16880018,"url":"https://github.com/anderseknert/opa-kafka-docker-compose","last_synced_at":"2026-04-16T13:35:47.194Z","repository":{"id":103055489,"uuid":"428317406","full_name":"anderseknert/opa-kafka-docker-compose","owner":"anderseknert","description":"Example of OPA authorization for Kafka using Docker Compose","archived":false,"fork":false,"pushed_at":"2021-11-30T04:53:32.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-14T20:50:41.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anderseknert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-15T15:25:42.000Z","updated_at":"2021-11-16T11:55:31.000Z","dependencies_parsed_at":"2023-04-22T15:57:28.298Z","dependency_job_id":null,"html_url":"https://github.com/anderseknert/opa-kafka-docker-compose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-kafka-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-kafka-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-kafka-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anderseknert%2Fopa-kafka-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anderseknert","download_url":"https://codeload.github.com/anderseknert/opa-kafka-docker-compose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538576,"owners_count":20468740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T15:57:00.058Z","updated_at":"2026-04-16T13:35:47.151Z","avatar_url":"https://github.com/anderseknert.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Policy Agent and Kafka\n\nExample code for running Kafka with client certificates for authentication, and using OPA for authorization decisons.\n\n## Setup\n\n1. Copy an OPA configuration file (`opa-conf.yaml`) into the `opa` directory.\n2. Copy the [OPA Kafka Authorizer Plugin](https://github.com/anderseknert/opa-kafka-plugin) into the `plugin` directory.\n3. Run the `create_cert.sh` script to create server and client certificates. These will be found in the `cert` directory.\n4. `docker compose up`\n\n## Querying Kafka\n\nUsing the `alice` user with a client certificate.\n\n### Producing to a topic\n\n```shell\nbin/kafka-console-producer.sh --broker-list localhost:9093 --topic test --producer.config path/to/cert/client/alice.properties\n\u003e My first message\n\u003e My second message\n...\nCtrl+c\n```\n\n### Consuming from a topic\n\n```shell\nbin/kafka-console-consumer.sh --bootstrap-server localhost:9093 --topic test --consumer.config path/to/cert/client/alice.properties --from-beginning\nMy first message\nMy second message\n...\nCtrl+c\n\nProcessed a total of 4 messages\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanderseknert%2Fopa-kafka-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanderseknert%2Fopa-kafka-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanderseknert%2Fopa-kafka-docker-compose/lists"}